lib/hyla/commands/generate.rb in hyla-1.0.8 vs lib/hyla/commands/generate.rb in hyla-1.0.9.pre.1

- old
+ new

@@ -29,19 +29,29 @@ self.check_mandatory_option?('-s / --source', options[:source]) self.check_mandatory_option?('-d / --destination', options[:destination]) @destination = options[:destination] @source = options[:source] - + + # Find and append to the value of the copyright header with the BUILD TAG EN Var if it exists + attributes = options[:attributes] if options[:attributes] + attributes.each do | k, v | + if ((k.eql? "revealjs_footer_copyright") && (ENV['BUILD_TAG'])) + attributes[k] = attributes[k] + " - " + ENV['BUILD_TAG'] + end + end + # Check Style to be used + attributes.store('stylesheet',self.check_style(options[:style])) + + + # New options new_asciidoctor_option = { :template_dirs => [self.backend_dir(options[:backend])], - :attributes => { - 'stylesheet' => self.check_style(options[:style]) - } + :attributes => attributes } - + merged_options = Configuration[options].deep_merge(new_asciidoctor_option) extensions = 'adoc,ad,asciidoc' excludes = 'lab_assets|lab_assets_solution|code|snippets|templates|generated_content|generated_content_instructor|generated_content_snippet|generated_slideshow|generated_content_pdf|generated_content_students' @@ -53,14 +63,25 @@ self.check_mandatory_option?('-d / --destination', options[:destination]) @destination = options[:destination] @source = options[:source] + # Find and append to the value of the copyright header with the BUILD TAG EN Var if it exists + attributes = options[:attributes] if options[:attributes] + attributes.each do | k, v | + if ((k.eql? "revealjs_footer_copyright") && (ENV['BUILD_TAG'])) + attributes[k] = attributes[k] + " - " + ENV['BUILD_TAG'] + end + end + + # Check Style to be used + attributes.store('stylesheet',self.check_style(options[:style])) + + + # New options new_asciidoctor_option = { :template_dirs => [self.backend_dir(options[:backend])], - :attributes => { - 'stylesheet' => self.check_style(options[:style]) - } + :attributes => attributes } merged_options = Configuration[options].deep_merge(new_asciidoctor_option) #