Class: SocialStream::Events::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#create_migration_fileObject



6
7
8
9
10
11
# File 'lib/generators/social_stream/events/install_generator.rb', line 6

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

#require_javascriptsObject



13
14
15
16
17
# File 'lib/generators/social_stream/events/install_generator.rb', line 13

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

#require_stylesheetsObject



19
20
21
22
23
# File 'lib/generators/social_stream/events/install_generator.rb', line 19

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