Class: TestHelpers::Generation::Bukkit

Inherits:
Object
  • Object
show all
Defined in:
lib/isolation/abstract_unit.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Bukkit

Returns a new instance of Bukkit.



166
167
168
# File 'lib/isolation/abstract_unit.rb', line 166

def initialize(path)
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



164
165
166
# File 'lib/isolation/abstract_unit.rb', line 164

def path
  @path
end

Instance Method Details

#delete(file) ⇒ Object



176
177
178
# File 'lib/isolation/abstract_unit.rb', line 176

def delete(file)
  File.delete("#{@path}/#{file}")
end

#write(file, string) ⇒ Object



170
171
172
173
174
# File 'lib/isolation/abstract_unit.rb', line 170

def write(file, string)
  path = "#{@path}/#{file}"
  FileUtils.mkdir_p(File.dirname(path))
  File.open(path, "w") {|f| f.puts string }
end