Class: Testbeds::Bed
- Inherits:
-
Object
- Object
- Testbeds::Bed
- Defined in:
- lib/testbeds/bed.rb
Instance Attribute Summary collapse
-
#dependencies ⇒ Object
readonly
Returns the value of attribute dependencies.
-
#gemfile ⇒ Object
readonly
Returns the value of attribute gemfile.
-
#rakefile ⇒ Object
readonly
Returns the value of attribute rakefile.
-
#store_in ⇒ Object
readonly
Returns the value of attribute store_in.
Instance Method Summary collapse
-
#initialize(gemfile, dependencies, rakefile, init_script, store_in) ⇒ Bed
constructor
A new instance of Bed.
- #name ⇒ Object
- #namespace ⇒ Object
- #run_init_script ⇒ Object
- #template(str) ⇒ Object
Constructor Details
#initialize(gemfile, dependencies, rakefile, init_script, store_in) ⇒ Bed
Returns a new instance of Bed.
23 24 25 26 27 28 29 30 31 |
# File 'lib/testbeds/bed.rb', line 23 def initialize gemfile, dependencies, rakefile, init_script, store_in @store_in = Pathname.new File.(store_in) @gemfile = File. gemfile @rakefile = @store_in.join template(rakefile) @init_script = init_script @dependencies = dependencies.collect do |dep| @store_in.join template(dep) end end |
Instance Attribute Details
#dependencies ⇒ Object (readonly)
Returns the value of attribute dependencies.
5 6 7 |
# File 'lib/testbeds/bed.rb', line 5 def dependencies @dependencies end |
#gemfile ⇒ Object (readonly)
Returns the value of attribute gemfile.
5 6 7 |
# File 'lib/testbeds/bed.rb', line 5 def gemfile @gemfile end |
#rakefile ⇒ Object (readonly)
Returns the value of attribute rakefile.
5 6 7 |
# File 'lib/testbeds/bed.rb', line 5 def rakefile @rakefile end |
#store_in ⇒ Object (readonly)
Returns the value of attribute store_in.
5 6 7 |
# File 'lib/testbeds/bed.rb', line 5 def store_in @store_in end |
Instance Method Details
#name ⇒ Object
15 16 17 |
# File 'lib/testbeds/bed.rb', line 15 def name @name ||= Pathname.new File.basename(gemfile) end |
#namespace ⇒ Object
7 8 9 |
# File 'lib/testbeds/bed.rb', line 7 def namespace "testbed:#{name}" end |
#run_init_script ⇒ Object
19 20 21 |
# File 'lib/testbeds/bed.rb', line 19 def run_init_script instance_eval &@init_script if @init_script end |
#template(str) ⇒ Object
11 12 13 |
# File 'lib/testbeds/bed.rb', line 11 def template str ERB.new(str).result(binding) end |