Class: SocialStream::Documents::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#create_migration_fileObject



6
7
8
9
10
11
# File 'lib/generators/social_stream/documents/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_documents_engine:install:migrations'].invoke
end

#require_javascriptsObject



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

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

#require_stylesheetsObject



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

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