Class: Buffet::Project
- Inherits:
-
Object
- Object
- Buffet::Project
- Defined in:
- lib/buffet/project.rb
Instance Attribute Summary collapse
-
#directory ⇒ Object
readonly
Returns the value of attribute directory.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #directory_on_slave ⇒ Object
-
#initialize(directory) ⇒ Project
constructor
A new instance of Project.
- #support_dir_on_slave ⇒ Object
- #sync_to(slave) ⇒ Object
Constructor Details
#initialize(directory) ⇒ Project
Returns a new instance of Project.
6 7 8 9 |
# File 'lib/buffet/project.rb', line 6 def initialize directory @name = File.basename directory @directory = File. directory end |
Instance Attribute Details
#directory ⇒ Object (readonly)
Returns the value of attribute directory.
4 5 6 |
# File 'lib/buffet/project.rb', line 4 def directory @directory end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/buffet/project.rb', line 3 def name @name end |
Instance Method Details
#directory_on_slave ⇒ Object
11 12 13 |
# File 'lib/buffet/project.rb', line 11 def directory_on_slave "#{Buffet.workspace_dir}/#{name}" end |
#support_dir_on_slave ⇒ Object
15 16 17 |
# File 'lib/buffet/project.rb', line 15 def support_dir_on_slave "#{directory_on_slave}/.buffet" end |
#sync_to(slave) ⇒ Object
19 20 21 22 |
# File 'lib/buffet/project.rb', line 19 def sync_to slave slave.execute "mkdir -p #{directory_on_slave}" slave.rsync directory + '/', directory_on_slave end |