Sha256: c98258c114deaddefe306e5fda986d579f50a67f2734973a1a53de503a7cf7d9

Contents?: true

Size: 994 Bytes

Versions: 9

Compression:

Stored size: 994 Bytes

Contents

module Locomotive
  class InstallGenerator < Rails::Generators::Base

    source_root File.expand_path('../../../../../', __FILE__)

    def copy_initializers
      @source_paths = nil # reset it for the find_in_source_paths method

      Locomotive::InstallGenerator.source_root(File.expand_path('../templates', __FILE__))

      template 'locomotive.rb', 'config/initializers/locomotive.rb'

      template 'carrierwave.rb', 'config/initializers/carrierwave.rb'

      template 'dragonfly.rb', 'config/initializers/dragonfly.rb'

      template 'mongoid.yml', 'config/mongoid.yml'
    end

    def insert_engine_routes
      route %(
  mount Locomotive::Engine => '/locomotive', as: 'locomotive' # you can change the value of the path, by default set to "/locomotive"
      )
    end

    def remove_index_html
      remove_file 'public/index.html'
    end

    def show_readme
      readme 'README'
    end

    private

    def generate_secret
      SecureRandom.hex(32)
    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
locomotive_cms-2.5.5 lib/generators/locomotive/install/install_generator.rb
locomotive_cms-2.5.4 lib/generators/locomotive/install/install_generator.rb
locomotive_cms-2.5.3 lib/generators/locomotive/install/install_generator.rb
locomotive_cms-2.5.2 lib/generators/locomotive/install/install_generator.rb
locomotive_cms-2.5.1 lib/generators/locomotive/install/install_generator.rb
locomotive_cms-2.5.0 lib/generators/locomotive/install/install_generator.rb
locomotive_cms-2.5.0.rc3 lib/generators/locomotive/install/install_generator.rb
locomotive_cms-2.5.0.rc2 lib/generators/locomotive/install/install_generator.rb
locomotive_cms-2.5.0.rc1 lib/generators/locomotive/install/install_generator.rb