class FlavoredGherkin::HtmlFlavour
Html Flavored Gherkin
Public Instance Methods
build(title, feature_files, output_path)
click to toggle source
Build Html Flavored Gherkin
# File lib/flavored_gherkin/html_flavour.rb, line 12 def build(title, feature_files, output_path) gherkins = get_gherkins feature_files raise "Error:: No valid gherkin feature file found #{feature_files}" if gherkins.empty? File.open("#{output_path}.html", 'w') do |file| file.write get('html_flavour').result(binding).gsub(' ', '').gsub("\n\n", '') end end
Private Instance Methods
get(template)
click to toggle source
# File lib/flavored_gherkin/html_flavour.rb, line 22 def get(template) @erb ||= {} @erb[template] ||= ERB.new(File.read(File.dirname(__FILE__) + '/../../template/' + template + '.erb'), nil, nil, '_' + template) end