Class: SocialStream::Base::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/social_stream/base/install_generator.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#create_config_relations_fileObject



28
29
30
# File 'lib/generators/social_stream/base/install_generator.rb', line 28

def create_config_relations_file
  copy_file 'relations.yml', 'config/relations.yml'
end

#create_config_sphinx_fileObject



32
33
34
# File 'lib/generators/social_stream/base/install_generator.rb', line 32

def create_config_sphinx_file
  copy_file 'sphinx.yml', 'config/sphinx.yml'
end

#create_devise_routeObject



20
21
22
# File 'lib/generators/social_stream/base/install_generator.rb', line 20

def create_devise_route
  route "devise_for :users, :controllers => {:omniauth_callbacks => 'omniauth_callbacks'}"
end

#create_initializer_fileObject



24
25
26
# File 'lib/generators/social_stream/base/install_generator.rb', line 24

def create_initializer_file
  copy_file 'initializer.rb', 'config/initializers/social_stream.rb'
end

#create_migration_fileObject



60
61
62
63
64
65
# File 'lib/generators/social_stream/base/install_generator.rb', line 60

def create_migration_file
  require 'rake'
  Rails.application.load_tasks
  Rake::Task['railties:install:migrations'].reenable
  Rake::Task['social_stream_base_engine:install:migrations'].invoke
end

#create_navigation_configObject



44
45
46
# File 'lib/generators/social_stream/base/install_generator.rb', line 44

def create_navigation_config
  copy_file 'navigation.rb', 'config/navigation.rb'
end

#devise_initializer_configObject



10
11
12
13
14
15
16
17
18
# File 'lib/generators/social_stream/base/install_generator.rb', line 10

def devise_initializer_config
  inject_into_file "config/initializers/devise.rb",
                   "\n  config.omniauth :linked_in, \"ekxfXU8nueVSMQ9fc5KJAryBkyztUlCBYMW3DoQPzbE79WhivvzhQloRNHCHgPeB\", \"WYiHFT-KKFgjd45W3-pEAficmXRHmN6_6DGwj1C_ZILJlSO1gBvv6VNYXU9tybGY\"
                    \n  config.omniauth :facebook, \"129571360447856\",\"eef39dce5e20e76f77495c59623bdb38\"
                    \n  #config.omniauth :twitter, \"wgTxO0fTpjTeSnjKC9ZHA\",\"JepulVWwLcuAnGfWjwCu47yEP0TcJJfKtvISPBsilI\"
                    \n  config.token_authentication_key = :auth_token
                    \n  config.stateless_token = true",
                    :after => "  # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'"
end

#remove_application_layoutObject



40
41
42
# File 'lib/generators/social_stream/base/install_generator.rb', line 40

def remove_application_layout
  remove_file 'app/views/layouts/application.html.erb'
end

#remove_public_indexObject



36
37
38
# File 'lib/generators/social_stream/base/install_generator.rb', line 36

def remove_public_index
  remove_file 'public/index.html'
end

#require_javascriptsObject



48
49
50
51
52
# File 'lib/generators/social_stream/base/install_generator.rb', line 48

def require_javascripts
  inject_into_file 'app/assets/javascripts/application.js',
                   "//= require social_stream-base\n",
                   :before => '//= require_tree .'
end

#require_stylesheetsObject



54
55
56
57
58
# File 'lib/generators/social_stream/base/install_generator.rb', line 54

def require_stylesheets
  inject_into_file 'app/assets/stylesheets/application.css',
                   " *= require social_stream-base\n",
                   :before => ' *= require_tree .'
end