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 10 |
# File 'lib/caplets/utils.rb', line 3 def rake(cmd) run_current [ "RAILS_ENV=#{fetch(:environment)}", fetch(:bin_cmd,''), fetch(:rake, 'rake'), cmd ].join(' ') end |
#run_current(*cmds) ⇒ Object
12 13 14 |
# File 'lib/caplets/utils.rb', line 12 def run_current(*cmds) run ["cd #{fetch(:current_path)}"].concat(cmds).join(' && ') end |
#run_multi(*cmds) ⇒ Object
16 17 18 |
# File 'lib/caplets/utils.rb', line 16 def run_multi(*cmds) run cmds.join(' ; ') end |