Sha256: be22611d2c728b621b63ab465de56ef61f3817005f741f4ce5589ed299f9b688

Contents?: true

Size: 652 Bytes

Versions: 2

Compression:

Stored size: 652 Bytes

Contents

require 'rails/generators/migration'
require 'rails/generators/active_record'

class OauthConsumerGenerator < Rails::Generators::Base
  source_root File.expand_path("../templates", __FILE__)
  
  hook_for :orm
    
  def copy_models
    template 'oauth_config.rb',   File.join('config', 'initializers', 'oauth_consumers.rb')
  end
  
  def copy_controller
    template 'controller.rb', File.join('app', 'controllers', 'oauth_consumers_controller.rb')
  end
  
  hook_for :template_engine
  
  def add_route
    route <<-ROUTE.strip
resources :oauth_consumers do
    member do
      get :callback
      get :callback2
    end
  end
ROUTE
  end
    
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
insrc-oauth-plugin-0.4.0.pre6 lib/generators/oauth_consumer/oauth_consumer_generator.rb
insrc-oauth-plugin-0.4.0.pre5 lib/generators/oauth_consumer/oauth_consumer_generator.rb