class Write

Attributes

file[R]

Public Class Methods

new(config) click to toggle source
# File lib/bgem.rb, line 163
def initialize config
  @file = Pathname config.output
  @scope = config.scope
end

Public Instance Methods

[](string) click to toggle source
# File lib/bgem.rb, line 170
def [] string
  file.dirname.mkpath

  if @scope
    @scope.each do |header|
      string = "#{header}\n#{string.indent INDENT}\nend"
    end
  end

  file.write "#{string}\n"
end