Sha256: 006bc564f2c937dd7736a9a5d5e48bb95e6c1bcc615f04e32469d2c555d03e4f

Contents?: true

Size: 653 Bytes

Versions: 1

Compression:

Stored size: 653 Bytes

Contents

require 'rails/generators'

class DoubanGenerator < Rails::Generators::Base
  def install_douban
    copy_file('douban_controller.rb', 'app/controllers/douban_controller.rb')
    copy_file("douban_helper.rb", 'app/helpers/douban_helper.rb')
    copy_file("douban.yml", 'config/douban.yml')
    
    route %(# Routes for Douban OAuth
  scope "/douban" do
    match '/new' => 'douban#new',           :as => :douban_login
    match '/callback' => 'douban#callback', :as => :douban_callback
    match '/logout' => 'douban#destroy',    :as => :douban_logout
  end)
  end
  
  def self.source_root
    File.join(File.dirname(__FILE__), 'templates')
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
douban-0.1.0 lib/generators/douban/douban_generator.rb