Sha256: e9f93ebdca6071be7ab93a4518d65f8352d42aafa310ebf5dfd5c39875e1e9ea

Contents?: true

Size: 711 Bytes

Versions: 5

Compression:

Stored size: 711 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
      match 'client/*endpoint' => 'oauth_consumers#client'
    end
  end
ROUTE
  end
    
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
oauth-plugin-0.4.0.rc2 lib/generators/oauth_consumer/oauth_consumer_generator.rb
oauth-plugin-0.4.0.rc1 lib/generators/oauth_consumer/oauth_consumer_generator.rb
oauth-plugin-0.4.0.pre7 lib/generators/oauth_consumer/oauth_consumer_generator.rb
oauth-plugin-0.4.0.pre6 lib/generators/oauth_consumer/oauth_consumer_generator.rb
oauth-plugin-0.4.0.pre5 lib/generators/oauth_consumer/oauth_consumer_generator.rb