Class: Testspace::Space

Inherits:
Object
  • Object
show all
Defined in:
lib/testspace/space.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Space

Returns a new instance of Space.



3
4
5
# File 'lib/testspace/space.rb', line 3

def initialize(options = {})
  @options = options
end

Instance Attribute Details

#dirObject (readonly)

Returns the value of attribute dir.



7
8
9
# File 'lib/testspace/space.rb', line 7

def dir
  @dir
end

Instance Method Details

#enter(&block) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/testspace/space.rb', line 13

def enter(&block)
  ::Dir.mktmpdir do |dir|
    @dir = dir
    expand
    block.call
  end
end

#fromObject



30
31
32
# File 'lib/testspace/space.rb', line 30

def from
  @from ||= @options[:from]
end

#moduleObject



9
10
11
# File 'lib/testspace/space.rb', line 9

def module
  @module ||= ::Testspace::Modules.create
end