From 7057181db58f551e6d5d2ecf29976b8a54fce1cd Mon Sep 17 00:00:00 2001 From: Jorge Bucaran <jbucaran@me.com> Date: Fri, 30 Jan 2015 09:06:05 +0900 Subject: [PATCH] Rename .markdown to .md; add links to plugins and fix typos. --- README.markdown => README.md | 15 +++--- plugins/README.markdown | 43 --------------- plugins/README.md | 41 ++++++++++++++ .../fish-spec/{README.markdown => README.md} | 54 +++++++++++++------ .../getopts/{README.markdown => README.md} | 9 +--- 5 files changed, 88 insertions(+), 74 deletions(-) rename README.markdown => README.md (83%) delete mode 100644 plugins/README.markdown create mode 100644 plugins/README.md rename plugins/fish-spec/{README.markdown => README.md} (55%) rename plugins/getopts/{README.markdown => README.md} (96%) diff --git a/README.markdown b/README.md similarity index 83% rename from README.markdown rename to README.md index 4d92e90..339629f 100644 --- a/README.markdown +++ b/README.md @@ -3,7 +3,7 @@ [](https://travis-ci.org/bpinto/oh-my-fish) ### Why? - Developing on a shell should be a pleasure. Our goal is to help developers that don't want to spend time configuring their own computer to spend time doing what they want. + Developing on a shell should be a pleasure. Our goal is to help developers that do not want to spend time configuring their own computer to spend time doing what they want. ### How? With the power of our community, we take the already awesome [fish shell][fish] to another level by creating simple-to-use plugins and themes. @@ -13,12 +13,13 @@ ### What? Oh-my-fish is a user-friendly framework for managing your fish-shell configuration. It includes optional plugins (brew, git, rails, python, node, etc) and themes. - ## Installation Oh-my-fish is built for recent versions of the fish shell, namely "fish 2.0". - curl -L https://github.com/bpinto/oh-my-fish/raw/master/tools/install.fish | fish +```fish +curl -L https://github.com/bpinto/oh-my-fish/raw/master/tools/install.fish | fish +``` If you want to install it manually, keep reading. @@ -30,9 +31,6 @@ Enabling a new plugin or theme is as easy as it should be. Open your fish config As an example, to enable rails and git plugins add this line `set fish_plugins git rails` to your configuration file. -## Tests -Oh-My-Fish comes fully tested via `fish-spec`, a plugin bundled with the framework. To learn how to use `fish-spec` in your own projects, check out the [usage guide](plugins/fish-spec/README.markdown). - ## Customization If you have many functions which go well together, you can create custom plugin in the `custom/plugins/PLUGIN_NAME` @@ -50,7 +48,9 @@ just add a new file (ending in .load) into the `custom/` directory. ## Send us your theme! -I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the [themes](themes/) directory. +We are hoping to collect a bunch of themes for our command prompts. You can see existing ones in the [themes](themes/) directory. + +> __Note__: Theme authors, make sure to include a screenshot in your pull request. ## Switching to fish @@ -85,7 +85,6 @@ Substitute /bin/bash with /bin/tcsh or /bin/zsh as appropriate. rm -rf ~/.oh-my-fish - ## Oh My ZSH This project is heavily inspired by [oh-my-zsh][oh-my-zsh] diff --git a/plugins/README.markdown b/plugins/README.markdown deleted file mode 100644 index d937b5f..0000000 --- a/plugins/README.markdown +++ /dev/null @@ -1,43 +0,0 @@ -# Plugins -* __android-sdk__ – [Android SDK](http://developer.android.com/sdk/index.html) integration. -* __archlinux__ – Provides a number of plugins to make using Arch Linux easier. -* __autojump__ – Makes navigating filesystem much faster. See [autojump article](https://github.com/joelthelion/autojump/wiki) and [video](https://www.youtube.com/watch?v=tnNyoMGnbKg). Bindings only, autojump needs to be installed separately. -* __better-alias__ - Provide alias with auto completion. -* __brew__ – [Homebrew](http://brew.sh/) integration. -* __bundler__ – Use Ruby's [Bundler](http://bundler.io/) automatically for some commands. -* __ccache__ – Enable [ccache](http://ccache.samba.org/) to speed up compilation. -* __django__ – Helper for Django Unit tests. Cleans the cached modules as well. -* __ec2__ – Exports env variables for Amazon's EC2 management. -* __emoji-clock__ – The current time with half hour accuracy as an emoji symbol. -* __extract__ – Plugin to expand or extract bundled & compressed files. -* __fish-spec__ - Unit testing as simple as fish. See the [README](fish-spec/README.markdown) for usage instructions. -* __fry__ – Starts [fry](https://github.com/terlar/fry), a simple Ruby version manager for fish. -* __gem__ – Ruby gem integration. -* __getopts__ - A [Unix compliant](http://pubs.opengroup.org/onlinepubs/7908799/xbd/utilconv.html) implementation of [`getopts`](http://en.wikipedia.org/wiki/Getopts) for fish. -* __gi__ – [gitignore.io](http://gitignore.io) CLI for fish. -* __git-flow__ – [git-flow](https://github.com/nvie/gitflow) Completion support for git-flow. -* __jump__ – A port of [Jeroen Janssens’ “jump†utility](http://jeroenjanssens.com/2013/08/16/quickly-navigate-your-filesystem-from-the-command-line.html). -* __local-config__ – Support per-user, per-host and per-platform custom config files. -* __localhost__ – Opens `http://localhost:3000` (and other ports) in the default browser. -* __mc__ – Plugin to start mc with a shell compliant (Bash). -* __msg__ - A technicolor message printer. A colorful alternative to echo. -* __ndenv__ – Helpers for [another node.js version manager](https://github.com/riywo/ndenv). -* __node__ – Adds locally installed NodeJS `npm` binary executable modules to the path. -* __percol__ – Browse your fish history with [percol](https://github.com/mooz/percol). -* __peco__ – Browse your fish history with [peco](https://github.com/peco/peco). -* __osx__ - Integration with Finder and iTunes. -* __php__ – Manage phphttp server. -* __plenv__ – [plenv](https://github.com/tokuhirom/plenv) Perl binary manager integration. -* __pyenv__ – [Simple Python Version Management](https://github.com/yyuu/pyenv) integration. -* __python__ – Set of shortcuts to Python based utilities (pybeatifyjson – clean JSON files, pyclean – remove old `.pyc`, pyhttp & pysmtp – simple HTTP & SMTP servers) -* __rails__ – Alias for executing database migrations. -* __rake__ – Completions for rake tasks. -* __rbenv__ – [rbenv](https://github.com/sstephenson/rbenv) Ruby environment/version manager. -* __replace__ – A port of [replace](https://github.com/thoughtbot/dotfiles/blob/master/bin/replace). -* __rvm__ – [RVM](http://rvm.io) Ruby version manager. -* __ssh__ – ssh conservative $TERM value helper. -* __sublime__ – Creates `subl` command line shortcut to launch [Sublime Text editor](http://sublimetext.com/). -* __tmux__ – Plugin to start tmux with support for 256 colours. -* __vi-mode__ – Basic vi key bindings emulation for fish. -* __xdg__ – Setup [xdg](http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html) environment on Linux. -* __z__ – Integration with [z](https://github.com/rupa/z) (autojump alternative). diff --git a/plugins/README.md b/plugins/README.md new file mode 100644 index 0000000..92fd6d6 --- /dev/null +++ b/plugins/README.md @@ -0,0 +1,41 @@ +# Plugins +* [__android-sdk__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/android-sdk) – [Android SDK](http://developer.android.com/sdk/index.html) integration. +* [__archlinux__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/archlinux) – Provides a number of plugins to make using Arch Linux easier. +* [__better-alias__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/better-alias) - Provide alias with auto completion. +* [__brew__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/brew) – [Homebrew](http://brew.sh/) integration. +* [__bundler__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/bundler) – Use Ruby's [Bundler](http://bundler.io/) automatically for some commands. +* [__ccache__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/ccache) – Enable [ccache](http://ccache.samba.org/) to speed up compilation. +* [__django__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/django) – Helper for Django Unit tests. Cleans the cached modules as well. +* [__ec2__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/ec2) – Exports env variables for Amazon's EC2 management. +* [__emoji-clock__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/emoji-clock) – The current time with half hour accuracy as an emoji symbol. +* [__extract__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/extract) – Plugin to expand or extract bundled & compressed files. +* [__fish-spec__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/fish-spec) - Unit testing as simple as fish. See the [README](fish-spec/README.markdown) for usage instructions. +* [__fry__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/fry) – Starts [fry](https://github.com/terlar/fry), a simple Ruby version manager for fish. +* [__gem__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/gem) – Ruby gem integration. +* [__getopts__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/getopts) [(issues)](https://github.com/bucaran/getopts) - A [Unix compliant](http://pubs.opengroup.org/onlinepubs/7908799/xbd/utilconv.html) implementation of [`getopts`](http://en.wikipedia.org/wiki/Getopts) for fish. +* [__gi__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/gi) – [gitignore.io](http://gitignore.io) CLI for fish. +* [__git-flow__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/git-flow) – [git-flow](https://github.com/nvie/gitflow) Completion support for git-flow. +* [__jump__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/jump) – A port of [Jeroen Janssens’ “jump†utility](http://jeroenjanssens.com/2013/08/16/quickly-navigate-your-filesystem-from-the-command-line.html). +* [__local-config__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/local-config) – Support per-user, per-host and per-platform custom config files. +* [__localhost__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/localhost) – Opens `http://localhost:3000` (and other ports) in the default browser. +* [__mc__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/mc) – Plugin to start mc with a shell compliant (Bash). +* [__msg__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/msg) - A technicolor message printer. A colorful alternative to echo. +* [__ndenv__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/ndenv) – Helpers for [another node.js version manager](https://github.com/riywo/ndenv). +* [__node__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/node) – Adds locally installed NodeJS `npm` binary executable modules to the path. +* [__percol__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/percol) – Browse your fish history with [percol](https://github.com/mooz/percol). +* [__peco__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/peco) – Browse your fish history with [peco](https://github.com/peco/peco). +* [__osx__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/osx) - Integration with Finder and iTunes. +* [__php__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/php) – Manage phphttp server. +* [__plenv__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/plenv) – [plenv](https://github.com/tokuhirom/plenv) Perl binary manager integration. +* [__pyenv__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/pyenv) – [Simple Python Version Management](https://github.com/yyuu/pyenv) integration. +* [__python__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/python) – Set of shortcuts to Python based utilities (pybeatifyjson – clean JSON files, pyclean – remove old `.pyc`, pyhttp & pysmtp – simple HTTP & SMTP servers) +* [__rails__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/rails) – Alias for executing database migrations. +* [__rbenv__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/rbenv) – [rbenv](https://github.com/sstephenson/rbenv) Ruby environment/version manager. +* [__replace__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/replace) – A port of [replace](https://github.com/thoughtbot/dotfiles/blob/master/bin/replace). +* [__rvm__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/rvm) – [RVM](http://rvm.io) Ruby version manager. +* [__ssh__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/ssh) – ssh conservative $TERM value helper. +* [__sublime__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/sublime) – Creates `subl` command line shortcut to launch [Sublime Text editor](http://sublimetext.com/). +* [__tmux__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/tmux) – Plugin to start tmux with support for 256 colours. +* [__vi-mode__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/vi-mode) – Basic vi key bindings emulation for fish. +* [__xdg__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/xdg) – Setup [xdg](http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html) environment on Linux. +* [__z__](https://github.com/bpinto/oh-my-fish/tree/master/plugins/z) – Integration with [z](https://github.com/rupa/z) (autojump alternative). diff --git a/plugins/fish-spec/README.markdown b/plugins/fish-spec/README.md similarity index 55% rename from plugins/fish-spec/README.markdown rename to plugins/fish-spec/README.md index 1357d89..d135f36 100644 --- a/plugins/fish-spec/README.markdown +++ b/plugins/fish-spec/README.md @@ -1,20 +1,15 @@ # fish-spec > Unit testing as simple as fish. -The following guide describes how to use the `fish-spec` plugin that is bundled with Oh-My-Fish. +The following guide describes how to use the `fish-spec` plugin bundled with Oh-My-Fish. ## Install Before you can use `fish-spec`, you need to install [Oh-My-Fish](https://github.com/bpinto/oh-my-fish). ## Usage -Just like any other plugin in Oh-My-Fish, you can start using `fish-spec` in two ways: +Import the library into your fish file via [import](https://github.com/bpinto/oh-my-fish/blob/master/functions/import.fish). -1. Adding the plugin to the `$fish_plugins` global variable declared in your fish configuration file, usually in `~/.config/fish/config.fish`. -2. Directly importing the library into your fish file via [import](https://github.com/bpinto/oh-my-fish/blob/master/functions/import.fish). - -As of now, the most common use case is the second method, as you will probably want to test your own plugins or libraries. - -Inside your project's directory create a new `spec` folder (recommended) and add all your _spec_ files inside. _Spec_ files are regular fish files that must look like `*.spec.fish` and contain your tests. +Inside your project's directory create a new `spec` folder and add all your _spec_ files inside. _Spec_ files are regular fish files that shall look like `*.spec.fish` and contain your tests. You can have multiple `spec.fish` files to organize your tests in a per module basis, or you can squash everything into a single file and use describe blocks to separate groups of tests. @@ -22,7 +17,7 @@ A `spec.file` usually looks like this: ```fish import plugins/fish-spec -import path/to/the-library # plugins/the-library +import plugins/the-library # Use -d to enter a friendly description (optional) function describe_library -d "the grand library" @@ -68,16 +63,43 @@ As of now, there is only one method you should be aware of, [expect](https://git Under the hood, _expect_ checks an _actual_ value, usually a relevant result from your test unit, is equal to, not equal to, etc., to an _expected_ value, as determined by your test. Below are the list of conditions available to use with `expect`: -* __--to-equal__ `<actual>` value equals `<expected>` value -* __--to-not-equal__ `<actual>` value does not equals `<expected>` value -* __--to-contain-all__ all `<actual>` values exist in `<expected>` list -* __--to-not-contain-all__ all `<actual>` values does not exist in `<expected>` list -* __--to-be-true__ exit status should be _truthy_ -* __--to-be-false__ exit status should be _falsy_ +* __--to-equal__ +`<actual>` value equals the `<expected>` value. For example: +```fish +expect $my_value --to-equal 5 +``` + +* __--to-not-equal__ +`<actual>` value does not equal the `<expected>` value +```fish +expect $my_string --to-not-equal "oh-the-fish" +``` + +* __--to-contain-all__ all `<actual>` values exist in the `<expected>` list +```fish +expect $elements --to-contain-all "earth" "fire" "water" "air" +``` + +* __--to-not-contain-all__ no `<actual>` values exist in `<expected>` list +```fish +expect $our_planets --to-not-not-contain-all "golomo" "borg prime" "rigel" "terra" +``` + +* __--to-be-true__ the exit status should be _truthy_ +```fish +__my_plugin_improve_workflow +expect $status --to-be-true +``` + +* __--to-be-false__ the exit status should be _falsy_ +```fish +__my_plugin_erase_drive +expect $status --to-be-false +``` ## FAQ 1. __How to use `fish-spec` without Oh-My-Fish?__ -`fish-spec` is still a work in progress and as it currently stands, it is only available bundled with Oh-My-Fish. As the library matures and grows, however, it is possible a future guide describing how to export `fish-spec` will be written. +`fish-spec` is currently only available bundled with Oh-My-Fish. As the library matures and grows, however, a future guide describing how to export `fish-spec` may be written. ## Authors + [Bruno Pinto](https://github.com/bpinto) diff --git a/plugins/getopts/README.markdown b/plugins/getopts/README.md similarity index 96% rename from plugins/getopts/README.markdown rename to plugins/getopts/README.md index 0767143..74c130e 100644 --- a/plugins/getopts/README.markdown +++ b/plugins/getopts/README.md @@ -1,17 +1,12 @@ # getopts > friendly [`getopts`](http://en.wikipedia.org/wiki/Getopts) for [fish](https://fishshell.com) :fish: -## Install +## Usage ```fish -git clone https://github.com/bucaran/getopts -mv getopts/getopts.fish custom/functions/path +Add `getopts` to your `$fish_plugins` or import directly into your library via `import plugins/getopts`. ``` -## Tests - -Tests are implemented via [Oh-My-Fish](https://github.com/bpinto/oh-my-fish) spec runner _fish-spec_. - ## Premise Every utility / function needs to handle arguments. What usually happens is that every function does all the grunt work to parse `$argv` itself, and while some patterns do tend to recur, it's different almost every time. Enter fish `getopts`. -- GitLab