class SharedInfrastructure::Output

Attributes

root[RW]

Public Class Methods

fake_root(root = nil) { || ... } click to toggle source

Fake root. If block is given, change the root only for the duration of the block. If no block is given, is the same as configure.

# File lib/shared_infrastructure/output.rb, line 26
def fake_root(root = nil)
  if block_given?
    begin
      save_root = Output.root
      fake_root(root)
      result = yield
    ensure
      fake_root(save_root)
      result
    end
  else
    self.root = root
  end
end
file_name(file_name) click to toggle source
# File lib/shared_infrastructure/output.rb, line 41
def file_name(file_name)
  return file_name unless Output.root
  file_name = File.join(Output.root, file_name)
  FileUtils.mkdir_p(File.dirname(file_name))
  file_name
end
new(file_name, *args) click to toggle source
Calls superclass method
# File lib/shared_infrastructure/output.rb, line 18
def initialize(file_name, *args)
  super Output.file_name(file_name), *args
end