Class: RailsEve::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/rails_eve/install/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#installObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/generators/rails_eve/install/install_generator.rb', line 7

def install
  gem 'omniauth-crest'
  gem 'devise'
  gem 'mongoid'
  gem 'ruby-esi'

  generate 'mongoid:config'

  copy_file 'characters_controller.rb', './app/controllers/character_controller.rb'
  copy_file 'rails-eve-base.html.slim', './app/views/layouts/rails-eve-base.html.slim'
  copy_file 'index.html.slim', './app/views/characters/index.html.slim'
  copy_file 'omniauth.rb', './config/initializers/omniauth.rb'
  copy_file 'mongoid_setup.rb', './app/lib/mongoid_setup.rb'
  copy_file 'esi_character_api.rb', './app/models/concerns/esi_character_api.rb'
  copy_file 'character.rb', './app/models/character.rb'
  copy_file 'alliance.rb', './app/models/alliance.rb'
  copy_file 'corporation.rb', './app/models/corporation.rb'
  copy_file 'devise.rb', './config/initializers/devise.rb', force: true
  copy_file 'user.rb', './app/models/user.rb', force: true
  copy_file 'omniauth_callbacks_controller.rb', './app/controllers/users/omniauth_callbacks_controller.rb'
  inject_into_file './config/routes.rb', after: "Rails.application.routes.draw do\n" do
    <<-'RUBY'
  devise_for :users, controllers: { omniauth_callbacks: 'users/omniauth_callbacks' }
    RUBY
  end
end