Module: Kerb

Defined in:
lib/kerb.rb,
lib/kerb/version.rb,
lib/kerb/template.rb

Defined Under Namespace

Modules: VERSION Classes: Template

Class Method Summary collapse

Class Method Details

.render(erb, vars) ⇒ Object



6
7
8
9
# File 'lib/kerb.rb', line 6

def self.render(erb, vars)
  template = Kerb::Template.new(erb, vars)
  template.render
end

.render_to_file(erb, vars, file) ⇒ Object



11
12
13
14
15
16
# File 'lib/kerb.rb', line 11

def self.render_to_file(erb, vars, file)
  template = Kerb::Template.new(erb, vars)
  output = template.render

  File.open(file, 'w') { |f| f.write(output) }
end

.versionObject



10
11
12
# File 'lib/kerb/version.rb', line 10

def self.version
  Gem::Version.new VERSION::STRING
end