Skip to content

Commit

Permalink
add docs for inplace edit
Browse files Browse the repository at this point in the history
  • Loading branch information
grosser committed Aug 27, 2011
1 parent c9efde8 commit aa7e9ea
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Readme.md
Expand Up @@ -4,7 +4,7 @@ Install
=======
sudo gem install pru

Working with rvm / many gemsets -> only install once (1.9 recommended)
Working with rvm / many gemsets -> only install once

rvm 1.9.2 exec gem install pru
echo 'alias pru="rvm 1.9.2 exec pru"' >> ~/.bash_profile
Expand All @@ -24,6 +24,7 @@ Reduce works on all lines as Array<br/>

-I, --libdir DIR Add DIR to load path
--require LIB Require LIB (also comma-separated)
-i, --inplace-edit FILE Edit FILE inplace

-h, --help Show this.
-v, --version Show Version
Expand Down Expand Up @@ -52,7 +53,7 @@ Reduce works on all lines as Array<br/>

# wc --- count lines
ls -al | wc -l
ls -al | pru --reuduce 'size'
ls -al | pru --reduce 'size'

# sed -- replace a 5 with five
ls -al | sed 's/5/five/'
Expand All @@ -73,6 +74,9 @@ Reduce works on all lines as Array<br/>
# Find a gem version matching a requirement e.g. ~> 1.0.0
curl http://rubygems.org/api/v1/versions/bundler | pru --require json 'JSON.parse(self).map{|g|g["number"]}.find{|v| Gem::Requirement.new("~>1.0.1").satisfied_by? Gem::Version.new(v) }'

# Cleanup strange whitespace in a file
pru -i Rakefile 'gsub(/\r\n/,"\n").gsub(/\t/," ")'

Authors
=======
### [Contributors](http://github.com/grosser/pru/contributors)
Expand Down

0 comments on commit aa7e9ea

Please sign in to comment.