Sha256: 2e6b6d4ad44b68bb49ae112abffbf7258dde4779437c76e4748584dede269a51

Contents?: true

Size: 1.44 KB

Versions: 19

Compression:

Stored size: 1.44 KB

Contents

require 'rails/generators'

module Lines
  class InstallGenerator < Rails::Generators::Base
    source_root File.expand_path('..', __FILE__)

    def install_migrations
      rake "lines:install:migrations"
    end

    def add_routes
      route 'mount Lines::Engine => "/blog"'
    end

    def copy_stylesheets
      FileUtils.mkdir_p "app/assets/stylesheets/lines"
      directory('../../../app/assets/stylesheets/lines/', 'app/assets/stylesheets/lines/', {:exclude_pattern => /admin/} )
    end

    def copy_views
      directory('../../../app/views/lines', 'app/views/lines/', {:exclude_pattern => /admin|sessions/})
      directory('../../../app/views/kaminari', 'app/views/kaminari/')
      copy_file('../../../app/views/layouts/lines/application.html.erb', 'app/views/layouts/lines/application.html.erb')
      copy_file('../../../app/views/layouts/lines/preview.html.erb', 'app/views/layouts/lines/preview.html.erb')
    end

    def copy_config
      copy_file "../../../config/lines_config.yml", 'config/lines_config.yml'
    end

    def copy_locales
      directory "../../../config/locales/", 'config/locales/'
    end


    def load_seeds
      FileUtils.mkdir_p "vendor/screenshots"
      copy_file './templates/octorel.png', 'vendor/screenshots/octorel.png'
    end

    def add_user
      if yes?("Would you like to create an admin user? (y/N):")
        rake 'lines:add_user'
      end
    end

    def display_readme
      readme 'README'
    end

  end
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
jeygeethanmedia-inkpen-1.2.6.2 lib/generators/lines/install_generator.rb
jeygeethanmedia-inkpen-1.2.6.1 lib/generators/lines/install_generator.rb
lines-engine-1.2.6.1 lib/generators/lines/install_generator.rb
lines-engine-1.2.6 lib/generators/lines/install_generator.rb
lines-engine-1.2.5 lib/generators/lines/install_generator.rb
lines-engine-1.2.3 lib/generators/lines/install_generator.rb
lines-engine-1.2.2 lib/generators/lines/install_generator.rb
lines-engine-1.2.1.1 lib/generators/lines/install_generator.rb
lines-engine-1.2.1 lib/generators/lines/install_generator.rb
lines-engine-1.2 lib/generators/lines/install_generator.rb
lines-engine-1.1.5.3 lib/generators/lines/install_generator.rb
lines-engine-1.1.5.2 lib/generators/lines/install_generator.rb
lines-engine-1.1.5.1 lib/generators/lines/install_generator.rb
lines-engine-1.1.5 lib/generators/lines/install_generator.rb
lines-engine-1.1.4 lib/generators/lines/install_generator.rb
lines-engine-1.1.3 lib/generators/lines/install_generator.rb
lines-engine-1.1.2 lib/generators/lines/install_generator.rb
lines-engine-1.1.1 lib/generators/lines/install_generator.rb
lines-engine-1.1.0 lib/generators/lines/install_generator.rb