diff --git a/README.md b/README.md index 24a44ce..ef7c9f4 100644 --- a/README.md +++ b/README.md @@ -8,84 +8,82 @@ upload content to https://gist.github.com/. ## Installation -‌If you have ruby installed: +* If you have ruby installed: gem install gist -‌If you're using Bundler: +* If you're using Bundler: source :rubygems gem 'gist' -‌For OS X, gist lives in Homebrew +* For OS X, `gist` lives in Homebrew brew install gist -‌For FreeBSD, gist lives in ports +* For FreeBSD, `gist` lives in ports pkg install gist -<200c>For Ubuntu/Debian +* For Ubuntu/Debian, `gist` has been renamed to `gist-paste` to avoid a name conflict apt install gist -Note: Debian renames the binary to `gist-paste` to avoid a name conflict. - ## Command -‌To upload the contents of `a.rb` just: +* To upload the contents of `a.rb` just: gist a.rb -‌Upload multiple files: +* Upload multiple files: gist a b c gist *.rb -‌By default it reads from STDIN, and you can set a filename with `-f`. +* By default it reads from STDIN, and you can set a filename with `-f`. gist -f test.rb .[.]` (e.g. -`~/.gist.http.github.internal.example.com` for the GITHUB_URL example above) instead of `~/.gist`. +`~/.gist.http.github.internal.example.com` for the `GITHUB_URL` example above) instead of `~/.gist`. If you have multiple servers or use Enterprise and public GitHub often, you can work around this by creating scripts that set the env var and then run `gist`. Keep in mind that to use the public GitHub you must unset the env var. Just @@ -158,14 +156,13 @@ setting it to the public URL will not work. Use `unset GITHUB_URL` If you cannot use passwords, as most Enterprise installations do, you can generate the token via the web interface and then simply save the string in the correct file. Avoid line breaks or you might see: -``` -$ gist -l -Error: Bad credentials -``` + + $ gist -l + Error: Bad credentials # Library -‌You can also use Gist as a library from inside your ruby code: +* You can also use Gist as a library from inside your ruby code: Gist.gist("Look.at(:my => 'awesome').code") @@ -181,26 +178,26 @@ If you need more advanced features you can also pass: NOTE: The access_token must have the `gist` scope and may also require the `user:email` scope. -‌If you want to upload multiple files in the same gist, you can: +* If you want to upload multiple files in the same gist, you can: Gist.multi_gist("a.rb" => "Foo.bar", "a.py" => "Foo.bar") -‌If you'd rather use gist's builtin access_token, then you can force the user +* If you'd rather use gist's builtin access_token, then you can force the user to obtain one by calling: Gist.login! -‌This will take them through the process of obtaining an OAuth2 token, and storing it +This will take them through the process of obtaining an OAuth2 token, and storing it in `~/.gist`, where it can later be read by `Gist.gist` ## Configuration -‌If you'd like `-o` or `-c` to be the default when you use the gist executable, add an +* If you'd like `-o` or `-c` to be the default when you use the gist executable, add an alias to your `~/.bashrc` (or equivalent). For example: alias gist='gist -c' -‌If you'd prefer gist to open a different browser, then you can export the BROWSER +* If you'd prefer gist to open a different browser, then you can export the BROWSER environment variable: export BROWSER=google-chrome diff --git a/Rakefile b/Rakefile index 006f559..cb3e0dd 100644 --- a/Rakefile +++ b/Rakefile @@ -11,9 +11,7 @@ end task :man do mkdir_p "build" - File.write "README.md.ron", File.read("README.md").gsub("\u200c", "* ") - sh 'ronn --roff --manual="Gist manual" README.md.ron' - rm 'README.md.ron' + sh 'ronn --roff --manual="Gist manual" README.md' mv 'README.1', 'build/gist.1' end