Sha256: 51a6469a5bf2b2a4a8ae4988651dda65accb24ba7af76578df625e43c8d94317

Contents?: true

Size: 695 Bytes

Versions: 4

Compression:

Stored size: 695 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

4 entries across 4 versions & 2 rubygems

Version Path
panjiva-oauth-plugin-0.4.1 lib/generators/oauth_consumer/oauth_consumer_generator.rb
oauth-plugin-0.5.0 lib/generators/oauth_consumer/oauth_consumer_generator.rb
oauth-plugin-0.4.1 lib/generators/oauth_consumer/oauth_consumer_generator.rb
oauth-plugin-0.4.0 lib/generators/oauth_consumer/oauth_consumer_generator.rb