Class: Testbeds::Index
- Inherits:
-
Object
- Object
- Testbeds::Index
- Defined in:
- lib/testbeds/index.rb,
lib/testbeds/index/testbed.rb
Defined Under Namespace
Classes: Testbed
Instance Attribute Summary collapse
-
#beds ⇒ Object
readonly
Returns the value of attribute beds.
Instance Method Summary collapse
- #find_index_file(base_path = Pathname.new('.')) ⇒ Object
-
#initialize ⇒ Index
constructor
A new instance of Index.
- #store_in(dest) ⇒ Object
- #testbeds(&block) ⇒ Object (also: #testbed)
Constructor Details
#initialize ⇒ Index
Returns a new instance of Index.
13 14 15 16 17 18 19 |
# File 'lib/testbeds/index.rb', line 13 def initialize @store_in = "testbeds" @beds = [] raise "no Bedfile found" unless file = find_index_file src = File.read file eval src, binding, file end |
Instance Attribute Details
#beds ⇒ Object (readonly)
Returns the value of attribute beds.
3 4 5 |
# File 'lib/testbeds/index.rb', line 3 def beds @beds end |
Instance Method Details
#find_index_file(base_path = Pathname.new('.')) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/testbeds/index.rb', line 5 def find_index_file base_path = Pathname.new('.') path = File.(base_path.join('Bedfile')) return path if File.file?(path) # if we hit root, there is no Bedfile return nil if path =~ /:\\Bedfile/ or path =~ /^\/Bedfile/ find_index_file base_path.join('..') end |
#store_in(dest) ⇒ Object
27 28 29 |
# File 'lib/testbeds/index.rb', line 27 def store_in dest @store_in = dest end |