Class: PigGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/pig/pig_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



29
30
31
# File 'lib/generators/pig/pig_generator.rb', line 29

def self.source_root
  File.join(File.dirname(__FILE__), 'templates')
end

Instance Method Details

#install_pigObject



20
21
22
23
24
25
26
27
# File 'lib/generators/pig/pig_generator.rb', line 20

def install_pig
  if options[:skip_routes]
    puts 'Nothing to do'
  else
    format = options[:html] ? ':html' : ':plain'
    route("match '#{formatted_revision_path}', :to => Pig.new({:format => #{format}})")
  end
end