Class: Geordi::CapistranoConfig
- Inherits:
-
Object
- Object
- Geordi::CapistranoConfig
- Defined in:
- lib/geordi/capistrano_config.rb
Instance Attribute Summary collapse
-
#root ⇒ Object
Returns the value of attribute root.
Instance Method Summary collapse
- #env ⇒ Object
-
#initialize(stage) ⇒ CapistranoConfig
constructor
A new instance of CapistranoConfig.
- #primary_server ⇒ Object
- #remote_root ⇒ Object
- #servers ⇒ Object
- #shell ⇒ Object
- #user(server) ⇒ Object
Constructor Details
#initialize(stage) ⇒ CapistranoConfig
Returns a new instance of CapistranoConfig.
6 7 8 9 10 |
# File 'lib/geordi/capistrano_config.rb', line 6 def initialize(stage) self.stage = stage self.root = find_project_root! load_deploy_info end |
Instance Attribute Details
#root ⇒ Object
Returns the value of attribute root.
4 5 6 |
# File 'lib/geordi/capistrano_config.rb', line 4 def root @root end |
Instance Method Details
#env ⇒ Object
32 33 34 |
# File 'lib/geordi/capistrano_config.rb', line 32 def env deploy_info[/^\s*set\s*:rails_env,\s*['"](.*?)['"]/, 1] end |
#primary_server ⇒ Object
21 22 23 24 25 26 |
# File 'lib/geordi/capistrano_config.rb', line 21 def primary_server # Actually, servers may have a :primary property. From Capistrano 3, the # first listed server is the primary one by default, which is a good- # enough default for us. servers.first end |
#remote_root ⇒ Object
28 29 30 |
# File 'lib/geordi/capistrano_config.rb', line 28 def remote_root File.join deploy_info[/^\s*set\s*:deploy_to,\s*['"](.*?)['"]/, 1], 'current' end |
#servers ⇒ Object
17 18 19 |
# File 'lib/geordi/capistrano_config.rb', line 17 def servers deploy_info.scan(/^\s*server\s*['"](.*?)['"]/).flatten end |
#shell ⇒ Object
36 37 38 |
# File 'lib/geordi/capistrano_config.rb', line 36 def shell 'bash --login' end |