Module: Caplets::Utils
- Defined in:
- lib/caplets/utils.rb
Overview
This is just a collection of handy methods to use while writing tasks
Instance Method Summary collapse
Instance Method Details
#rake(cmd) ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/caplets/utils.rb', line 3 def rake(cmd) run_current [ "RAILS_ENV=#{fetch(:environment)}", fetch(:rake, 'rake'), cmd ].join(' ') end |
#run_current(*cmds) ⇒ Object
11 12 13 |
# File 'lib/caplets/utils.rb', line 11 def run_current(*cmds) run ["cd #{fetch(:current_path)}"].concat(cmds).join(' && ') end |
#run_multi(*cmds) ⇒ Object
15 16 17 |
# File 'lib/caplets/utils.rb', line 15 def run_multi(*cmds) run cmds.join(' ; ') end |