lib/generators/pig/pig_generator.rb in pig-0.0.6 vs lib/generators/pig/pig_generator.rb in pig-0.0.7
- old
+ new
@@ -3,21 +3,27 @@
class PigGenerator < Rails::Generators::Base
class_option :revision_path,
:banner => '/path_to_revisions',
:default => '/revision',
- :desc => 'A root-relative path at which to display revision information.'
+ :desc => 'A root-relative path at which to display revision information'
class_option :skip_routes,
:type => :boolean,
:default => false,
- :desc => 'Do not generate routes.'
+ :desc => 'Do not generate routes'
+ class_option :html,
+ :type => :boolean,
+ :default => true,
+ :desc => 'HTML output'
+
def install_pig
if options[:skip_routes]
puts 'Nothing to do'
else
- route("match '#{formatted_revision_path}', :to => Pig.new")
+ format = options[:html] ? ':html' : ':plain'
+ route("match '#{formatted_revision_path}', :to => Pig.new({:format => #{format}})")
end
end
def self.source_root
File.join(File.dirname(__FILE__), 'templates')