class RiparianGenerator

Public Class Methods

source_root() click to toggle source
# File lib/generators/riparian_generator.rb, line 11
def self.source_root
   @source_root ||= File.join(File.dirname(__FILE__), 'templates')
end

Public Instance Methods

create_app_files() click to toggle source
# File lib/generators/riparian_generator.rb, line 39
def create_app_files
  unless options["skip-controller"]
    template 'flow_tasks_controller.rb', 'app/controllers/flow_tasks_controller.rb'
    unless options["skip-views"]
      template 'flow_tasks_helper.rb', 'app/helpers/flow_tasks_helper.rb'
      directory 'views/flow_tasks', 'app/views/flow_tasks'
    end
  end
end
create_migration_file() click to toggle source
# File lib/generators/riparian_generator.rb, line 49
def create_migration_file
  if defined?(ActiveRecord)
    migration_template 'migration.rb', 'db/migrate/create_riparian.rb'
  end
end
create_routes() click to toggle source
# File lib/generators/riparian_generator.rb, line 26
  def create_routes
    unless options["skip-controller"]
      route <<-EOT
  # Riparian routes
  resources :flow_tasks do
    member do
      get :run
    end
  end
      EOT
    end
  end