Sha256: 6ac92d350e33b9b6ded65fd90215d31ccc3b70e65c10f3566a3d99771ec7fa04

Contents?: true

Size: 653 Bytes

Versions: 13

Compression:

Stored size: 653 Bytes

Contents

require 'rails/generators'
require 'rails/generators/base'

module HouseStyle
  class InstallGenerator < Rails::Generators::Base
    def self.source_root
      @source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
    end

    def create_root_rubocop_yml
      template 'rubocop.yml', '.rubocop.yml'
    end

    def create_rspec_rubocop_yml
      template 'rspec-rubocop.yml', 'spec/.rubocop.yml'
    end

    def create_db_migrate_rubocop_yml
      template 'db_migrate_rubocop.yml', 'db/migrate/.rubocop.yml' if Dir.exist?(db_path)
    end

    private

    def db_path
      File.join(Rails.root, 'db')
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
house_style-2.1.0 lib/generators/house_style/install_generator.rb
house_style-2.0.2 lib/generators/house_style/install_generator.rb
house_style-2.0.1 lib/generators/house_style/install_generator.rb
house_style-2.0.0 lib/generators/house_style/install_generator.rb
house_style-1.6.0 lib/generators/house_style/install_generator.rb
house_style-1.5.1 lib/generators/house_style/install_generator.rb
house_style-1.5.0 lib/generators/house_style/install_generator.rb
house_style-1.4.0 lib/generators/house_style/install_generator.rb
house_style-1.3.1 lib/generators/house_style/install_generator.rb
house_style-1.3.0 lib/generators/house_style/install_generator.rb
house_style-1.2.0 lib/generators/house_style/install_generator.rb
house_style-1.1.1 lib/generators/house_style/install_generator.rb
house_style-1.1.0 lib/generators/house_style/install_generator.rb