README.md in cmds-0.2.5 vs README.md in cmds-0.2.6
- old
+ new
@@ -34,20 +34,20 @@
Or, "what's it look like?"...
- Instead of
- ```Ruby
+ ```ruby
`psql \
--username=#{ (db_config['username'] || ENV['USER']).shellescape } \
#{ db_config['database'].shellescape } \
< #{ filepath.shellescape }`
```
write
- ```Ruby
+ ```ruby
Cmds 'psql %{opts} %{db} < %{dump}',
db: db_config['database'],
dump: filepath,
opts: {
username: db_config['username'] || ENV['USER']
@@ -63,11 +63,11 @@
Cmds takes care of shell escaping for you.
- Instead of
- ```Ruby
+ ```ruby
`PGPASSWORD=#{ config[:password].shellescape } \
pg_dump \
--username=#{ config[:username].shellescape } \
--host=#{ config[:host].shellescape } \
--port=#{ config[:port].shellescape } \
@@ -75,11 +75,11 @@
> #{ filepath.shellescape }`
```
which can be really hard to pick out what's going on from a quick glance, write
- ```Ruby
+ ```ruby
Cmds.new(
'pg_dump %{opts} %{database}',
kwds: {
opts: {
username: config[:username],
@@ -96,11 +96,11 @@
I find it much easier to see what's going on their quickly.
Again, with some additional comments and examples:
- ```Ruby
+ ```ruby
# We're going to instantiate a new {Cmds} object this time, because we're
# not just providing values for the string template, we're specifying an
# environment variable for the child process too.
#
cmd = Cmds.new(
@@ -180,10 +180,10 @@
[Erubis]: http://www.kuwata-lab.com/erubis/
For how it works check out
1. {Cmds::ERBContext}
-2. {Cmds::ShellERuby}
+2. {Cmds::ShellEruby}
3. {Cmds#render}
******************************************************************************