Class: TestHelpers::Generation::Bukkit
- Inherits:
-
Object
- Object
- TestHelpers::Generation::Bukkit
- Defined in:
- lib/isolation/abstract_unit.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #delete(file) ⇒ Object
-
#initialize(path) ⇒ Bukkit
constructor
A new instance of Bukkit.
- #write(file, string) ⇒ Object
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
#path ⇒ Object (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 |