Class: Shoestring::CopyConfigFile
- Defined in:
- lib/shoestring/copy_config_file.rb
Instance Attribute Summary collapse
-
#destination_file ⇒ Object
readonly
Returns the value of attribute destination_file.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#source_file ⇒ Object
readonly
Returns the value of attribute source_file.
Instance Method Summary collapse
- #check ⇒ Object
-
#initialize(name, source_file, destination_file) ⇒ CopyConfigFile
constructor
A new instance of CopyConfigFile.
Methods inherited from Base
Constructor Details
#initialize(name, source_file, destination_file) ⇒ CopyConfigFile
Returns a new instance of CopyConfigFile.
7 8 9 10 11 |
# File 'lib/shoestring/copy_config_file.rb', line 7 def initialize(name, source_file, destination_file) @name = name @source_file = source_file @destination_file = destination_file end |
Instance Attribute Details
#destination_file ⇒ Object (readonly)
Returns the value of attribute destination_file.
5 6 7 |
# File 'lib/shoestring/copy_config_file.rb', line 5 def destination_file @destination_file end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/shoestring/copy_config_file.rb', line 5 def name @name end |
#source_file ⇒ Object (readonly)
Returns the value of attribute source_file.
5 6 7 |
# File 'lib/shoestring/copy_config_file.rb', line 5 def source_file @source_file end |
Instance Method Details
#check ⇒ Object
13 14 15 16 17 18 |
# File 'lib/shoestring/copy_config_file.rb', line 13 def check unless File.exists?(destination_file) FileUtils.cp source_file, destination_file end puts "#{name}: check!" end |