Class: Dunlop::Install::SourceFilesGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Generators::GeneratorHelpers, Rails::Generators::Migration
Defined in:
lib/generators/dunlop/install/source_files/source_files_generator.rb

Instance Method Summary collapse

Methods included from Generators::GeneratorHelpers

#inject_before_last_end

Instance Method Details

#setup_source_files_with_other_nameObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/generators/dunlop/install/source_files/source_files_generator.rb', line 8

def setup_source_files_with_other_name
  copy_file "rspec/source_files_factory.rb", "spec/factories/source_files.rb"
  copy_file "models/source_file.rb", "app/models/source_file.rb"
  inject_into_file "config/application.rb", after: "class Application < Rails::Application\n" do <<-RUBY
  config.file_storage_path = Rails.root.join('files') # source file storage
  config.working_path = '/tmp' # source file processing directory

  RUBY
  end
  migration_template "migrations/create_source_files.rb", "db/migrate/create_source_files.rb"
  directory "locales", "config/locales"
end