Sha256: 244136269a1d84dfbe1076ce1d987c0a95e76063568ee3ce27ff8ef76213e6cb

Contents?: true

Size: 1.36 KB

Versions: 9

Compression:

Stored size: 1.36 KB

Contents

require 'rails/generators'

module Symphonia
  class SetupGenerator < Rails::Generators::Base
    # include Rails::Generators::Migration

    source_root File.expand_path('templates', __dir__)

    def create_settings
      copy_file 'settings.rb', 'config/initializers/settings.rb'
    end

    def copy_static
      copy_file '404.html', 'public/404.html'
      copy_file '500.html', 'public/500.html'
    end

    def copy_assets
      template 'app/assets/javascripts/application.js'
      append_to_file 'app/assets/config/manifest.js', '//= link symphonia_manifest.js'
      copy_file 'design.scss', 'app/assets/stylesheets/general.scss'
    end

    def copy_rspec
      copy_file 'spec_helper.rb', 'spec/spec_helper.rb'

      create_file '.rspec' do
        '--require spec_helper'
        '--format documentation'
      end
    end

    def copy_setup_file

      copy_file 'base_layout.html.erb', 'app/views/layouts/application.html.erb'

      append_to_file 'db/seeds.rb', 'Symphonia::Engine.load_seed'
      append_to_file '.gitignore', 'public/system'

      inject_into_file 'config/routes.rb', after: "Rails.application.routes.draw do\n" do
        "  mount Symphonia::Engine => '/'"
      end

    end

    # def setup_gemfile
    #   append_to_file 'Gemfile' do
    #     File.read(File.join(File.dirname(__FILE__), 'templates/Gemfile'))
    #   end
    #
    # end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
symphonia-3.4.0 lib/generators/symphonia/setup/setup_generator.rb
symphonia-3.3.4 lib/generators/symphonia/setup/setup_generator.rb
symphonia-3.3.3 lib/generators/symphonia/setup/setup_generator.rb
symphonia-3.3.2 lib/generators/symphonia/setup/setup_generator.rb
symphonia-3.3.0 lib/generators/symphonia/setup/setup_generator.rb
symphonia-3.2.4 lib/generators/symphonia/setup/setup_generator.rb
symphonia-3.2.3 lib/generators/symphonia/setup/setup_generator.rb
symphonia-3.2.2 lib/generators/symphonia/setup/setup_generator.rb
symphonia-3.2.1 lib/generators/symphonia/setup/setup_generator.rb