class Boring::Ci::GithubAction::InstallGenerator

Constants

DEFAULT_NODE_VERSION
DEFAULT_REPOSITORY_NAME
DEFAULT_RUBY_VERSION
RUBY_VERSION_FILE

Public Instance Methods

add_github_actions_configuration() click to toggle source
# File lib/generators/boring/ci/github_action/install/install_generator.rb, line 23
        def add_github_actions_configuration
          @ruby_version = options[:ruby_version] ? options[:ruby_version] : DEFAULT_RUBY_VERSION
          @node_version = options[:node_version] ? options[:node_version] : DEFAULT_NODE_VERSION
          @repository_name = options[:repository_name] ? options[:repository_name] : DEFAULT_REPOSITORY_NAME

          template("ci.yml", ".github/workflows/ci.yml")

          if @ruby_version == DEFAULT_RUBY_VERSION && !ruby_version_file_exists?
            say <<~WARNING, :red
              WARNING: The action was configured to use the ruby version specified in the .ruby-version
              file, but no such file was present. Either create an appropriate .ruby-version file, or
              update .github/workflows/ci.yml to use an explicit ruby version.
            WARNING
          end
        end
ruby_version_file_exists?() click to toggle source
# File lib/generators/boring/ci/github_action/install/install_generator.rb, line 39
def ruby_version_file_exists?
  Pathname.new(destination_root).join(RUBY_VERSION_FILE).exist?
end