Class: Buffet::Project

Inherits:
Object
  • Object
show all
Defined in:
lib/buffet/project.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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.expand_path directory
end

Instance Attribute Details

#directoryObject (readonly)

Returns the value of attribute directory.



4
5
6
# File 'lib/buffet/project.rb', line 4

def directory
  @directory
end

#nameObject

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_slaveObject



11
12
13
# File 'lib/buffet/project.rb', line 11

def directory_on_slave
  "#{Buffet.workspace_dir}/#{name}"
end

#support_dir_on_slaveObject



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