Module: Helpers::Common
- Defined in:
- lib/quapistrano/support/common.rb
Instance Method Summary collapse
- #_cset(variable, *args, &block) ⇒ Object
- #is_using(something, with_some_var) ⇒ Object
- #is_using_nginx ⇒ Object
- #is_using_unicorn ⇒ Object
- #join_cmds(*cmds) ⇒ Object
- #say(msg) ⇒ Object
- #try_bundle ⇒ Object
Instance Method Details
#_cset(variable, *args, &block) ⇒ Object
11 12 13 |
# File 'lib/quapistrano/support/common.rb', line 11 def _cset(variable, *args, &block) set(variable, *args, &block) unless exists?(variable) end |
#is_using(something, with_some_var) ⇒ Object
27 28 29 |
# File 'lib/quapistrano/support/common.rb', line 27 def is_using(something, with_some_var) exists?(with_some_var.to_sym) && fetch(with_some_var.to_sym).to_s.downcase == something end |
#is_using_nginx ⇒ Object
19 20 21 |
# File 'lib/quapistrano/support/common.rb', line 19 def is_using_nginx is_using('nginx',:web_server) end |
#is_using_unicorn ⇒ Object
23 24 25 |
# File 'lib/quapistrano/support/common.rb', line 23 def is_using_unicorn is_using('unicorn',:app_server) end |
#join_cmds(*cmds) ⇒ Object
7 8 9 |
# File 'lib/quapistrano/support/common.rb', line 7 def join_cmds *cmds cmds.join(' && ') end |
#say(msg) ⇒ Object
3 4 5 |
# File 'lib/quapistrano/support/common.rb', line 3 def say msg Capistrano::CLI.ui.say(msg) end |
#try_bundle ⇒ Object
15 16 17 |
# File 'lib/quapistrano/support/common.rb', line 15 def try_bundle defined?(Bundler) ? "bundle exec" : "" end |