Sha256: 673d27f4fc028183b12331f728ce1b5c0f94728fb9d2875a60d0e6ef089cf11a

Contents?: true

Size: 733 Bytes

Versions: 6

Compression:

Stored size: 733 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', :via => [:get, :post, :put, :delete]
    end
  end
ROUTE
  end

end

Version data entries

6 entries across 6 versions & 3 rubygems

Version Path
houston-oauth-plugin-0.5.1 lib/generators/oauth_consumer/oauth_consumer_generator.rb
oauth_consumer-0.1.3 lib/generators/oauth_consumer/oauth_consumer_generator.rb
oauth_consumer-0.1.2 lib/generators/oauth_consumer/oauth_consumer_generator.rb
oauth_consumer-0.1.1 lib/generators/oauth_consumer/oauth_consumer_generator.rb
oauth_consumer-0.1.0 lib/generators/oauth_consumer/oauth_consumer_generator.rb
oauth-plugin-0.5.1 lib/generators/oauth_consumer/oauth_consumer_generator.rb