Class: Gloss::Writer

Inherits:
Object
  • Object
show all
Defined in:
lib/gloss/writer.rb

Instance Method Summary collapse

Constructor Details

#initialize(content, src_path, output = nil) ⇒ Writer

Returns a new instance of Writer.



9
10
11
12
13
# File 'lib/gloss/writer.rb', line 9

def initialize(content, src_path, output = nil)
  @content = content
  @src_path = src_path
  @output = output
end

Instance Method Details

#runObject



14
15
16
17
18
19
20
21
22
# File 'lib/gloss/writer.rb', line 14

def run()
  write_to_output() { |otpt|
    sb = shebang
    (if sb
      otpt.puts(sb)
    end)
    otpt.puts(@content)
  }
end