Class: ImportableAttachments::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Extended by:
ActiveRecord::Generators::Migration
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/importable_attachments/install_generator.rb

Overview

copies configuration file for configuration.gem

Instance Method Summary collapse

Instance Method Details

#augment_spec_helperObject



51
52
53
# File 'lib/generators/importable_attachments/install_generator.rb', line 51

def augment_spec_helper
  insert_into_file 'config/environments/production.rb', '  config.assets.precompile += %w(ie6.css ie7.css)', after: "# config.assets.precompile += %w( search.js )\n"
end

#generate_configuration_filesObject



44
45
46
47
# File 'lib/generators/importable_attachments/install_generator.rb', line 44

def generate_configuration_files
  template 'features/attachments.rb.erb', 'config/features/attachments.rb'
  copy_file 'initializers/paperclip.rb', 'config/initializers/paperclip.rb'
end

#generate_rspec_paper_trail_installObject



22
23
24
25
26
27
# File 'lib/generators/importable_attachments/install_generator.rb', line 22

def generate_rspec_paper_trail_install
  return if skip_migrations?
  cli_opts = options.select { |key, val| val }.map { |key, val| val ? "--#{key}" : val.join(",") }
  cmd = 'rspec:paper_trail:install ' + cli_opts.join(" ")
  generate cmd
end

#generate_smarter_dates_installObject



37
38
39
40
# File 'lib/generators/importable_attachments/install_generator.rb', line 37

def generate_smarter_dates_install
  cli_opts = options.select { |key, val| val }.map { |key, val| val ? "--#{key}" : val.join(",") }
  generate 'smarter_dates:install ' + cli_opts.join(" ")
end

#generate_updated_rspec_paper_trail_configObject



31
32
33
# File 'lib/generators/importable_attachments/install_generator.rb', line 31

def generate_updated_rspec_paper_trail_config
  template 'features/versioning.rb', 'config/features/versioning.rb'
end