Sha256: 0be04173ceda3790fb05c573a1d51504945de8ef5452371d2ece7747ec5025bc

Contents?: true

Size: 1.45 KB

Versions: 12

Compression:

Stored size: 1.45 KB

Contents

# frozen_string_literal: true

module Boring
  module Ci
    module Circleci
      class InstallGenerator < Rails::Generators::Base
        desc "Adds Circle CI to the application"
        source_root File.expand_path("templates", __dir__)

        DEFAULT_RUBY_VERSION = "2.7.1"
        DEFAULT_REPOSITORY_NAME = "boring_generators"

        class_option :ruby_version,     type: :string, aliases: "-v",
                                                       desc: "Tell us the ruby version to which you use for the application. Default to Ruby #{DEFAULT_RUBY_VERSION}"
        class_option :skip_node,        type: :boolean, aliases: "-sn",
                                                        desc: "Skips the node configuration required for webpacker based Rails application."
        class_option :repository_name,  type: :string, aliases: "-rn",
                                                       desc: "Tell us the repository name to be used as database name on circleci. Defaults to #{DEFAULT_REPOSITORY_NAME}"

        def add_circle_ci_configuration
          @skip_node = options[:skip_node]
          @ruby_version = options[:ruby_version] ? options[:ruby_version] : DEFAULT_RUBY_VERSION
          @repository_name = options[:repository_name] ? options[:repository_name] : DEFAULT_REPOSITORY_NAME

          template("config.psql.yml", ".circleci/config.yml")
          template("database.yml.ci", "config/database.yml.ci")
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
boring_generators-0.15.0 lib/generators/boring/ci/circleci/install/install_generator.rb
boring_generators-0.14.0 lib/generators/boring/ci/circleci/install/install_generator.rb
boring_generators-0.13.0 lib/generators/boring/ci/circleci/install/install_generator.rb
boring_generators-0.12.0 lib/generators/boring/ci/circleci/install/install_generator.rb
boring_generators-0.11.0 lib/generators/boring/ci/circleci/install/install_generator.rb
boring_generators-0.10.0 lib/generators/boring/ci/circleci/install/install_generator.rb
boring_generators-0.9.0 lib/generators/boring/ci/circleci/install/install_generator.rb
boring_generators-0.8.0 lib/generators/boring/ci/circleci/install/install_generator.rb
boring_generators-0.7.0 lib/generators/boring/ci/circleci/install/install_generator.rb
boring_generators-0.6.0 lib/generators/boring/ci/circleci/install/install_generator.rb
boring_generators-0.5.0 lib/generators/boring/ci/circleci/install/install_generator.rb
boring_generators-0.4.0 lib/generators/boring/ci/circleci/install/install_generator.rb