Sha256: 845508e6bcec38a1d078c54b694ca71397727ed9cef3f4186f333635904d2833

Contents?: true

Size: 1.03 KB

Versions: 16

Compression:

Stored size: 1.03 KB

Contents

class EnjuCirculation::SetupGenerator < Rails::Generators::Base
  source_root File.expand_path('../templates', __FILE__)
  argument :file, :type => :string, :default => "all"

  def copy_setup_files
    directory("db/fixtures", "db/fixtures/enju_circulation")
    return if file == 'fixture'
    rake("enju_circulation_engine:install:migrations")
    rake("enju_event_engine:install:migrations")
    rake("enju_message_engine:install:migrations")
    generate("enju_event:setup")
    generate("enju_message:setup")
    inject_into_file 'app/controllers/application_controller.rb',
      "  enju_circulation\n", :after => "enju_library\n"
    inject_into_file 'app/models/user.rb',
      "  enju_circulation_user_model\n", :after => "enju_leaf_user_model\n"
    append_to_file("config/schedule.rb", File.open(File.expand_path('../templates', __FILE__) + '/config/schedule.rb').read)
    append_to_file 'config/initializers/inflections.rb',  <<EOS
ActiveSupport::Inflector.inflections do |inflect|
  inflect.irregular 'reserve', 'reserves'
end
EOS
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
enju_circulation-0.1.2 lib/generators/enju_circulation/setup/setup_generator.rb
enju_circulation-0.1.1 lib/generators/enju_circulation/setup/setup_generator.rb
enju_circulation-0.1.0 lib/generators/enju_circulation/setup/setup_generator.rb
enju_circulation-0.1.0.pre49 lib/generators/enju_circulation/setup/setup_generator.rb
enju_circulation-0.1.0.pre48 lib/generators/enju_circulation/setup/setup_generator.rb
enju_circulation-0.1.0.pre47 lib/generators/enju_circulation/setup/setup_generator.rb
enju_circulation-0.1.0.pre46 lib/generators/enju_circulation/setup/setup_generator.rb
enju_circulation-0.1.0.pre45 lib/generators/enju_circulation/setup/setup_generator.rb
enju_circulation-0.1.0.pre44 lib/generators/enju_circulation/setup/setup_generator.rb
enju_circulation-0.1.0.pre43 lib/generators/enju_circulation/setup/setup_generator.rb
enju_circulation-0.1.0.pre42 lib/generators/enju_circulation/setup/setup_generator.rb
enju_circulation-0.1.0.pre41 lib/generators/enju_circulation/setup/setup_generator.rb
enju_circulation-0.1.0.pre40 lib/generators/enju_circulation/setup/setup_generator.rb
enju_circulation-0.1.0.pre39 lib/generators/enju_circulation/setup/setup_generator.rb
enju_circulation-0.1.0.pre38 lib/generators/enju_circulation/setup/setup_generator.rb
enju_circulation-0.1.0.pre37 lib/generators/enju_circulation/setup/setup_generator.rb