Class: LumiaServer::Secret
- Inherits:
-
Object
- Object
- LumiaServer::Secret
- Defined in:
- lib/lumia-server/secret.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#destination ⇒ Object
readonly
Returns the value of attribute destination.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(home, data) ⇒ Secret
constructor
A new instance of Secret.
Constructor Details
#initialize(home, data) ⇒ Secret
Returns a new instance of Secret.
8 9 10 11 12 |
# File 'lib/lumia-server/secret.rb', line 8 def initialize(home, data) @data = data @source = File.join(home, data['source']) @destination = File.join('build', data['destination']) end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
4 5 6 |
# File 'lib/lumia-server/secret.rb', line 4 def data @data end |
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
6 7 8 |
# File 'lib/lumia-server/secret.rb', line 6 def destination @destination end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
5 6 7 |
# File 'lib/lumia-server/secret.rb', line 5 def source @source end |
Instance Method Details
#build ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/lumia-server/secret.rb', line 14 def build # Quick Fix if File.extname(destination).empty? FileUtils.mkdir_p destination end Dir.glob(source).each do |file| FileUtils.cp_r(file, destination) puts "Copied #{file} to #{File.absolute_path(destination)}" end end |