maestrano-connector-rails 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +1 -0
  3. data/DEVELOPER.md +10 -0
  4. data/Gemfile +18 -0
  5. data/Gemfile.lock +222 -0
  6. data/LICENSE +21 -0
  7. data/README.md +138 -0
  8. data/Rakefile +37 -0
  9. data/VERSION +1 -0
  10. data/app/controllers/maestrano/account/group_users_controller.rb +20 -0
  11. data/app/controllers/maestrano/account/groups_controller.rb +22 -0
  12. data/app/controllers/maestrano/application_controller.rb +7 -0
  13. data/app/controllers/maestrano/auth/saml_controller.rb +31 -0
  14. data/app/controllers/maestrano/sessions_controller.rb +15 -0
  15. data/app/helpers/maestrano/connector/rails/session_helper.rb +17 -0
  16. data/app/jobs/maestrano/connector/rails/synchronization_job.rb +49 -0
  17. data/app/models/maestrano/connector/rails/complex_entity.rb +175 -0
  18. data/app/models/maestrano/connector/rails/concerns/entity.rb +231 -0
  19. data/app/models/maestrano/connector/rails/concerns/external.rb +13 -0
  20. data/app/models/maestrano/connector/rails/connector_logger.rb +9 -0
  21. data/app/models/maestrano/connector/rails/entity.rb +5 -0
  22. data/app/models/maestrano/connector/rails/external.rb +5 -0
  23. data/app/models/maestrano/connector/rails/id_map.rb +6 -0
  24. data/app/models/maestrano/connector/rails/organization.rb +60 -0
  25. data/app/models/maestrano/connector/rails/sub_entity_base.rb +32 -0
  26. data/app/models/maestrano/connector/rails/synchronization.rb +38 -0
  27. data/app/models/maestrano/connector/rails/user.rb +25 -0
  28. data/app/models/maestrano/connector/rails/user_organization_rel.rb +9 -0
  29. data/bin/rails +12 -0
  30. data/config/routes.rb +28 -0
  31. data/db/migrate/20151122162100_create_maestrano_connector_rails_users.rb +16 -0
  32. data/db/migrate/20151122162414_create_maestrano_connector_rails_organizations.rb +21 -0
  33. data/db/migrate/20151122162613_create_maestrano_connector_rails_user_organization_rels.rb +12 -0
  34. data/db/migrate/20151122163325_create_maestrano_connector_rails_synchronizations.rb +13 -0
  35. data/db/migrate/20151122163449_create_maestrano_connector_rails_id_maps.rb +18 -0
  36. data/lib/generators/connector/USAGE +2 -0
  37. data/lib/generators/connector/complex_entity_generator.rb +19 -0
  38. data/lib/generators/connector/install_generator.rb +70 -0
  39. data/lib/generators/connector/templates/admin_controller.rb +48 -0
  40. data/lib/generators/connector/templates/admin_index.html.erb +51 -0
  41. data/lib/generators/connector/templates/complex_entity_example/contact.rb +22 -0
  42. data/lib/generators/connector/templates/complex_entity_example/contact_and_lead.rb +56 -0
  43. data/lib/generators/connector/templates/complex_entity_example/contact_mapper.rb +17 -0
  44. data/lib/generators/connector/templates/complex_entity_example/lead.rb +22 -0
  45. data/lib/generators/connector/templates/complex_entity_example/lead_mapper.rb +15 -0
  46. data/lib/generators/connector/templates/complex_entity_example/person.rb +23 -0
  47. data/lib/generators/connector/templates/contact_and_lead.rb +55 -0
  48. data/lib/generators/connector/templates/entity.rb +48 -0
  49. data/lib/generators/connector/templates/example_entity.rb +26 -0
  50. data/lib/generators/connector/templates/external.rb +19 -0
  51. data/lib/generators/connector/templates/home_controller.rb +17 -0
  52. data/lib/generators/connector/templates/home_index.html.erb +42 -0
  53. data/lib/generators/connector/templates/oauth_controller.rb +45 -0
  54. data/lib/maestrano-connector-rails.rb +1 -0
  55. data/lib/maestrano/connector/rails.rb +13 -0
  56. data/maestrano-connector-rails.gemspec +197 -0
  57. data/maestrano.png +0 -0
  58. data/spec/dummy/README.md +1 -0
  59. data/spec/dummy/Rakefile +6 -0
  60. data/spec/dummy/app/assets/images/.keep +0 -0
  61. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  62. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  63. data/spec/dummy/app/controllers/admin_controller.rb +48 -0
  64. data/spec/dummy/app/controllers/application_controller.rb +8 -0
  65. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  66. data/spec/dummy/app/controllers/home_controller.rb +17 -0
  67. data/spec/dummy/app/controllers/oauth_controller.rb +45 -0
  68. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  69. data/spec/dummy/app/mailers/.keep +0 -0
  70. data/spec/dummy/app/models/.keep +0 -0
  71. data/spec/dummy/app/models/concerns/.keep +0 -0
  72. data/spec/dummy/app/models/entities/example_entitiy.rb +26 -0
  73. data/spec/dummy/app/models/maestrano/connector/rails/entity.rb +10 -0
  74. data/spec/dummy/app/models/maestrano/connector/rails/external.rb +11 -0
  75. data/spec/dummy/app/views/admin/index.html.erb +51 -0
  76. data/spec/dummy/app/views/home/index.html.erb +36 -0
  77. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  78. data/spec/dummy/bin/bundle +3 -0
  79. data/spec/dummy/bin/rails +4 -0
  80. data/spec/dummy/bin/rake +4 -0
  81. data/spec/dummy/bin/setup +29 -0
  82. data/spec/dummy/config.ru +4 -0
  83. data/spec/dummy/config/application.rb +26 -0
  84. data/spec/dummy/config/boot.rb +5 -0
  85. data/spec/dummy/config/database.yml +25 -0
  86. data/spec/dummy/config/environment.rb +5 -0
  87. data/spec/dummy/config/environments/development.rb +41 -0
  88. data/spec/dummy/config/environments/production.rb +79 -0
  89. data/spec/dummy/config/environments/test.rb +42 -0
  90. data/spec/dummy/config/initializers/assets.rb +11 -0
  91. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  92. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  93. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  94. data/spec/dummy/config/initializers/inflections.rb +16 -0
  95. data/spec/dummy/config/initializers/maestrano.rb +135 -0
  96. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  97. data/spec/dummy/config/initializers/session_store.rb +3 -0
  98. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  99. data/spec/dummy/config/locales/en.yml +23 -0
  100. data/spec/dummy/config/routes.rb +9 -0
  101. data/spec/dummy/config/secrets.yml +22 -0
  102. data/spec/dummy/db/development.sqlite3 +0 -0
  103. data/spec/dummy/db/migrate/20151209134445_create_maestrano_connector_rails_users.maestrano_connector_rails.rb +17 -0
  104. data/spec/dummy/db/migrate/20151209134446_create_maestrano_connector_rails_organizations.maestrano_connector_rails.rb +22 -0
  105. data/spec/dummy/db/migrate/20151209134447_create_maestrano_connector_rails_user_organization_rels.maestrano_connector_rails.rb +13 -0
  106. data/spec/dummy/db/migrate/20151209134448_create_maestrano_connector_rails_synchronizations.maestrano_connector_rails.rb +14 -0
  107. data/spec/dummy/db/migrate/20151209134449_create_maestrano_connector_rails_id_maps.maestrano_connector_rails.rb +19 -0
  108. data/spec/dummy/db/schema.rb +83 -0
  109. data/spec/dummy/lib/assets/.keep +0 -0
  110. data/spec/dummy/log/.keep +0 -0
  111. data/spec/dummy/public/404.html +67 -0
  112. data/spec/dummy/public/422.html +67 -0
  113. data/spec/dummy/public/500.html +66 -0
  114. data/spec/dummy/public/favicon.ico +0 -0
  115. data/spec/factories.rb +33 -0
  116. data/spec/jobs/syncrhonization_job_spec.rb +53 -0
  117. data/spec/models/complex_entity_spec.rb +353 -0
  118. data/spec/models/connector_logger_spec.rb +21 -0
  119. data/spec/models/entity_spec.rb +457 -0
  120. data/spec/models/external_spec.rb +15 -0
  121. data/spec/models/id_map_spec.rb +12 -0
  122. data/spec/models/organizaztion_spec.rb +105 -0
  123. data/spec/models/sub_entity_base_spec.rb +51 -0
  124. data/spec/models/synchronization_spec.rb +75 -0
  125. data/spec/models/user_organization_rel_spec.rb +14 -0
  126. data/spec/models/user_spec.rb +15 -0
  127. data/spec/spec_helper.rb +19 -0
  128. metadata +327 -0
@@ -0,0 +1,13 @@
1
+ module Maestrano::Connector::Rails::Concerns::External
2
+ extend ActiveSupport::Concern
3
+
4
+ module ClassMethods
5
+ def get_client(organization)
6
+ raise 'Not implemented'
7
+ end
8
+
9
+ def external_name
10
+ raise 'Not implemented'
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,9 @@
1
+ module Maestrano::Connector::Rails
2
+ class ConnectorLogger
3
+
4
+ def self.log(level, organization, msg)
5
+ Rails.logger.method(level).call("org: #{organization.uid} (#{organization.tenant}). Msg: #{msg}")
6
+ end
7
+
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ module Maestrano::Connector::Rails
2
+ class Entity
3
+ include Maestrano::Connector::Rails::Concerns::Entity
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module Maestrano::Connector::Rails
2
+ class External
3
+ include Maestrano::Connector::Rails::Concerns::External
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ module Maestrano::Connector::Rails
2
+ class IdMap < ActiveRecord::Base
3
+
4
+ belongs_to :organization
5
+ end
6
+ end
@@ -0,0 +1,60 @@
1
+ module Maestrano::Connector::Rails
2
+ class Organization < ActiveRecord::Base
3
+ # Enable Maestrano for this group
4
+ maestrano_group_via :provider, :uid, :tenant do |group, maestrano|
5
+ group.name = (maestrano.name.blank? ? "Default Group name" : maestrano.name)
6
+ group.tenant = 'default' # To be set from SSO parameter
7
+ #group.country_alpha2 = maestrano.country
8
+ #group.free_trial_end_at = maestrano.free_trial_end_at
9
+ #group.some_required_field = 'some-appropriate-default-value'
10
+ end
11
+
12
+ def initialize
13
+ super
14
+ self.synchronized_entities = {}
15
+ Entity.entities_list.each do |entity|
16
+ self.synchronized_entities[entity.to_sym] = true
17
+ end
18
+ end
19
+
20
+ #===================================
21
+ # Associations
22
+ #===================================
23
+ has_many :user_organization_rels
24
+ has_many :users, through: :user_organization_rels
25
+
26
+ #===================================
27
+ # Validation
28
+ #===================================
29
+ validates :name, presence: true
30
+ validates :tenant, presence: true
31
+
32
+ #===================================
33
+ # Serialized field
34
+ #===================================
35
+ serialize :synchronized_entities
36
+
37
+ def add_member(user)
38
+ if self.tenant == user.tenant && !self.member?(user)
39
+ self.user_organization_rels.create(user:user)
40
+ end
41
+ end
42
+
43
+ def member?(user)
44
+ self.user_organization_rels.where(user_id:user.id).count > 0
45
+ end
46
+
47
+ def remove_member(user)
48
+ self.user_organization_rels.where(user_id:user.id).delete_all
49
+ end
50
+
51
+ def from_omniauth(auth)
52
+ self.oauth_provider = auth.provider
53
+ self.oauth_uid = auth.uid
54
+ self.oauth_token = auth.credentials.token
55
+ self.refresh_token = auth.credentials.refresh_token
56
+ self.instance_url = auth.credentials.instance_url
57
+ self.save!
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,32 @@
1
+ module Maestrano::Connector::Rails
2
+ class SubEntityBase < Entity
3
+
4
+ def external?
5
+ raise "Not implemented"
6
+ end
7
+
8
+ def entity_name
9
+ raise "Not implemented"
10
+ end
11
+
12
+ def map_to(name, entity, organization)
13
+ raise "Not implemented"
14
+ end
15
+
16
+ def external_entity_name
17
+ if self.external?
18
+ self.entity_name
19
+ else
20
+ raise "Forbidden call"
21
+ end
22
+ end
23
+
24
+ def connec_entity_name
25
+ if self.external?
26
+ raise "Forbidden call"
27
+ else
28
+ self.entity_name
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,38 @@
1
+ module Maestrano::Connector::Rails
2
+ class Synchronization < ActiveRecord::Base
3
+ #===================================
4
+ # Associations
5
+ #===================================
6
+ belongs_to :organization
7
+
8
+ validates :status, presence: true
9
+
10
+ def is_running?
11
+ self.status == 'RUNNING'
12
+ end
13
+
14
+ def is_error?
15
+ self.status == 'ERROR'
16
+ end
17
+
18
+ def is_success?
19
+ self.status == 'SUCCESS'
20
+ end
21
+
22
+ def self.create_running(organization)
23
+ Synchronization.create(organization_id: organization.id, status: 'RUNNING')
24
+ end
25
+
26
+ def set_success
27
+ self.update_attributes(status: 'SUCCESS')
28
+ end
29
+
30
+ def set_error(msg)
31
+ self.update_attributes(status: 'ERROR', message: msg)
32
+ end
33
+
34
+ def set_partial
35
+ self.update_attributes(partial: true)
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,25 @@
1
+ module Maestrano::Connector::Rails
2
+ class User < ActiveRecord::Base
3
+ # Enable Maestrano for this user
4
+ maestrano_user_via :provider, :uid, :tenant do |user, maestrano|
5
+ user.uid = maestrano.uid
6
+ user.provider = maestrano.provider
7
+ user.first_name = maestrano.first_name
8
+ user.last_name = maestrano.last_name
9
+ user.email = maestrano.email
10
+ user.tenant = 'default' # To be set from SSO parameter
11
+ end
12
+
13
+ #===================================
14
+ # Associations
15
+ #===================================
16
+ has_many :user_organization_rels
17
+ has_many :organizations, through: :user_organization_rels
18
+
19
+ #===================================
20
+ # Validation
21
+ #===================================
22
+ validates :email, presence: true
23
+ validates :tenant, presence: true
24
+ end
25
+ end
@@ -0,0 +1,9 @@
1
+ module Maestrano::Connector::Rails
2
+ class UserOrganizationRel < ActiveRecord::Base
3
+ #===================================
4
+ # Associations
5
+ #===================================
6
+ belongs_to :user
7
+ belongs_to :organization
8
+ end
9
+ end
data/bin/rails ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.
3
+
4
+ ENGINE_ROOT = File.expand_path('../..', __FILE__)
5
+ ENGINE_PATH = File.expand_path('../../lib/maestrano/connector/rails.rb', __FILE__)
6
+
7
+ # Set up gems listed in the Gemfile.
8
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
9
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
10
+
11
+ require 'rails/all'
12
+ require 'rails/engine/commands'
data/config/routes.rb ADDED
@@ -0,0 +1,28 @@
1
+ Maestrano::Connector::Rails::Engine.routes.draw do
2
+ maestrano_routes
3
+
4
+ #--------------------------------------------------------------------
5
+ # Maintainability issue
6
+ # Should use maestrano_routes but it creates a scoping error with the metadata routes
7
+ # get '/maestrano/metadata', to: '/maestrano/rails/metadata#index'
8
+ # get '/maestrano/metadata/:tenant', to: '/maestrano/rails/metadata#index', as: 'tenant'
9
+
10
+ # namespace :maestrano do
11
+ # namespace :auth do
12
+ # resources :saml, only:[] do
13
+ # get 'init', on: :collection
14
+ # get 'init/:tenant', on: :collection, to: 'saml#init', as: 'tenant'
15
+ # post 'consume', on: :collection
16
+ # end
17
+ # end
18
+
19
+ # namespace :account do
20
+ # resources :groups, only: [:destroy] do
21
+ # resources :users, only: [:destroy], controller: 'group_users'
22
+ # end
23
+ # end
24
+ # end
25
+ #--------------------------------------------------------------------
26
+
27
+ match 'signout', to: 'sessions#destroy', as: 'signout', via: [:get, :post]
28
+ end
@@ -0,0 +1,16 @@
1
+ class CreateMaestranoConnectorRailsUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table :maestrano_connector_rails_users do |t|
4
+ t.string :provider
5
+ t.string :uid
6
+ t.string :first_name
7
+ t.string :last_name
8
+ t.string :email
9
+ t.string :tenant
10
+
11
+ t.timestamps null: false
12
+ end
13
+
14
+ add_index :maestrano_connector_rails_users, [:uid, :tenant], name: 'user_uid_index'
15
+ end
16
+ end
@@ -0,0 +1,21 @@
1
+ class CreateMaestranoConnectorRailsOrganizations < ActiveRecord::Migration
2
+ def change
3
+ create_table :maestrano_connector_rails_organizations do |t|
4
+ t.string :provider
5
+ t.string :uid
6
+ t.string :name
7
+ t.string :tenant
8
+
9
+ t.string :oauth_provider
10
+ t.string :oauth_uid
11
+ t.string :oauth_token
12
+ t.string :refresh_token
13
+ t.string :instance_url
14
+
15
+ t.string :synchronized_entities
16
+
17
+ t.timestamps null: false
18
+ end
19
+ add_index :maestrano_connector_rails_organizations, [:uid, :tenant], name: 'orga_uid_index'
20
+ end
21
+ end
@@ -0,0 +1,12 @@
1
+ class CreateMaestranoConnectorRailsUserOrganizationRels < ActiveRecord::Migration
2
+ def change
3
+ create_table :maestrano_connector_rails_user_organization_rels do |t|
4
+ t.integer :user_id
5
+ t.integer :organization_id
6
+
7
+ t.timestamps
8
+ end
9
+ add_index :maestrano_connector_rails_user_organization_rels, :organization_id, name: 'rels_orga_index'
10
+ add_index :maestrano_connector_rails_user_organization_rels, :user_id, name: 'rels_user_index'
11
+ end
12
+ end
@@ -0,0 +1,13 @@
1
+ class CreateMaestranoConnectorRailsSynchronizations < ActiveRecord::Migration
2
+ def change
3
+ create_table :maestrano_connector_rails_synchronizations do |t|
4
+ t.integer :organization_id
5
+ t.string :status
6
+ t.text :message
7
+ t.boolean :partial, default: false
8
+
9
+ t.timestamps null: false
10
+ end
11
+ add_index :maestrano_connector_rails_synchronizations, :organization_id, name: 'synchronization_orga_id_index'
12
+ end
13
+ end
@@ -0,0 +1,18 @@
1
+ class CreateMaestranoConnectorRailsIdMaps < ActiveRecord::Migration
2
+ def change
3
+ create_table :maestrano_connector_rails_id_maps do |t|
4
+ t.string :connec_id
5
+ t.string :connec_entity
6
+ t.string :external_id
7
+ t.string :external_entity
8
+ t.integer :organization_id
9
+ t.datetime :last_push_to_connec
10
+ t.datetime :last_push_to_external
11
+
12
+ t.timestamps null: false
13
+ end
14
+ add_index :maestrano_connector_rails_id_maps, [:connec_id, :connec_entity, :organization_id], name: 'idmap_connec_index'
15
+ add_index :maestrano_connector_rails_id_maps, [:external_id, :external_entity, :organization_id], name: 'idmap_external_index'
16
+ add_index :maestrano_connector_rails_id_maps, :organization_id, name: 'idmap_organization_index'
17
+ end
18
+ end
@@ -0,0 +1,2 @@
1
+ Description:
2
+ Generates all files required to get your rails connector setup
@@ -0,0 +1,19 @@
1
+ module Connector
2
+ module Generators
3
+ class ComplexEntityGenerator < ::Rails::Generators::Base
4
+ source_root File.expand_path("../templates", __FILE__)
5
+
6
+ def copy_example_files
7
+ copy_file 'complex_entity_example/contact_and_lead.rb', 'app/models/entities/example_contact_and_lead.rb'
8
+
9
+ copy_file 'complex_entity_example/contact.rb', 'app/models/entities/sub_entities/example_contact.rb'
10
+ copy_file 'complex_entity_example/contact_mapper.rb', 'app/models/entities/sub_entities/example_contact_mapper.rb'
11
+
12
+ copy_file 'complex_entity_example/lead.rb', 'app/models/entities/sub_entities/example_lead.rb'
13
+ copy_file 'complex_entity_example/lead_mapper.rb', 'app/models/entities/sub_entities/example_lead_mapper.rb'
14
+
15
+ copy_file 'complex_entity_example/person.rb', 'app/models/entities/sub_entities/example_person.rb'
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,70 @@
1
+ module Connector
2
+ module Generators
3
+ class InstallGenerator < ::Rails::Generators::Base
4
+ source_root File.expand_path("../templates", __FILE__)
5
+
6
+ def maestrano_generator
7
+ #Temporary
8
+ # generate 'maestrano:initializer'
9
+ end
10
+
11
+ def include_helpers
12
+ sentinel = 'class ApplicationController < ActionController::Base'
13
+ code_lines = [
14
+ "helper Maestrano::Connector::Rails::Engine.helpers",
15
+ "include Maestrano::Connector::Rails::SessionHelper"
16
+ ]
17
+
18
+ in_root do
19
+ gsub_file 'app/controllers/application_controller.rb', /(#{Regexp.escape(sentinel)})/mi do |match|
20
+ "#{match}\n #{code_lines.join("\n ")}\n"
21
+ end
22
+ end
23
+ end
24
+
25
+ def include_routes
26
+ sentinel = 'Rails.application.routes.draw do'
27
+ code_lines = [
28
+ "mount Maestrano::Connector::Rails::Engine, at: '/'\n",
29
+ "root 'home#index'",
30
+ "get 'home/index' => 'home#index'",
31
+ "get 'admin/index' => 'admin#index'",
32
+ "put 'admin/update' => 'admin#update'",
33
+ "post 'admin/synchronize' => 'admin#synchronize'"
34
+ ]
35
+
36
+ in_root do
37
+ gsub_file 'config/routes.rb', /(#{Regexp.escape(sentinel)})/mi do |match|
38
+ "#{match}\n #{code_lines.join("\n ")}\n"
39
+ end
40
+ end
41
+ end
42
+
43
+ def copy_entity
44
+ copy_file 'entity.rb', 'app/models/maestrano/connector/rails/entity.rb'
45
+ end
46
+
47
+ def copy_external
48
+ copy_file 'external.rb', 'app/models/maestrano/connector/rails/external.rb'
49
+ end
50
+
51
+ def copy_example_entity
52
+ copy_file 'example_entity.rb', 'app/models/entities/example_entitiy.rb'
53
+ end
54
+
55
+ def copy_home
56
+ copy_file 'home_controller.rb', 'app/controllers/home_controller.rb'
57
+ copy_file 'home_index.html.erb', 'app/views/home/index.html.erb'
58
+ end
59
+
60
+ def copy_admin_view
61
+ copy_file 'admin_controller.rb', 'app/controllers/admin_controller.rb'
62
+ copy_file 'admin_index.html.erb', 'app/views/admin/index.html.erb'
63
+ end
64
+
65
+ def copy_oauth_controller
66
+ copy_file 'oauth_controller.rb', 'app/controllers/oauth_controller.rb'
67
+ end
68
+ end
69
+ end
70
+ end