Module: Hoe::Halostatue

Includes:
Checklist, Gemspec, Git, Markdown
Defined in:
lib/hoe/halostatue.rb,
lib/hoe/halostatue/version.rb,
lib/hoe/halostatue/markdown/linkify.rb

Overview

This module is a Hoe plugin which applies extremely opinionated reconfiguration to Hoe. You can set its options in your Rakefile Hoe spec, like this:

Hoe.plugin :halostatue

Hoe.spec "myproj" do
  self.checklist = nil if ENV["rubygems_release_gem"] == "true"
  self.git_release_tag_prefix = "REL_"
  self.git_remotes << "myremote"
end

The :git plugin (built into Hoe since Hoe 4.5 or present in the hoe-git or hoe-git2 dependencies) should not be enabled as that implementation differs from what is included here.

Tasks

  • checklist: Show the list of checklist questions.
  • git:manifest: Update the manifest with Git's file list.
  • git:tag: Create and push a tag.

Options

  • checklist: An array of reminder questions that should be asked before a release, in the form "Did you... [question]?". The default questions are:

  • Bump the version?

  • Check everything in?

  • Review the manifest?

  • Update the README and docs?

  • Update the changelog?

  • Regenerate the gemspec?

If the checklist is nil or empty, or trusted publishing is on, the checklist will not be shown.

  • git_release_tag_prefix: What do you want at the front of your release tags? The default is "v".

  • git_remotes: Which remotes do you want to push tags, etc. to? The default is %w[origin].

  • git_tag_enabled: Whether a git tag should be created on release. The default is true.

  • reproducible_gemspec: Whether a fixed date should be used for reproducible gemspec values. This is ignored if $SOURCE_DATE_EPOCH is set. Acceptable values are:

  • :default or true: uses the RubyGems default source date epoch

  • :current: uses the date stored in the most recent gemspec file

  • false: sets the release date to the current date

  • An epoch value, either as an Integer or a String

The default is :default.

  • trusted_release: Indicates that this release is being run as part of a trusted release workflow.

Defined Under Namespace

Modules: Checklist, Gemspec, Git, Markdown, ParseUrls, StrictWarnings

Constant Summary collapse

VERSION =

:nodoc:

"3.0.1"

Instance Attribute Summary collapse

Attributes included from Markdown

#markdown_linkify_files, #markdown_linkify_style, #markdown_linkify_uri_prefixes

Attributes included from Git

#git_release_tag_prefix, #git_remotes, #git_tag_enabled

Attributes included from Gemspec

#reproducible_gemspec

Attributes included from Checklist

#checklist

Instance Method Summary collapse

Instance Attribute Details

#trusted_releaseObject

Indicates that this release is being run as part of a trusted release workflow. [default: false]



83
84
85
# File 'lib/hoe/halostatue.rb', line 83

def trusted_release
  @trusted_release
end

Instance Method Details

#define_halostatue_tasksObject

:nodoc:



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/hoe/halostatue.rb', line 94

def define_halostatue_tasks # :nodoc:
  if trusted_release
    task :trusted_release do
      vm = %r{^(?<version>\d+(?:\.\d+)+)(?:\.(?<pre>[a-z]\w+(?:\.\d+)+))?}
        .match(spec.version.to_s)

      ENV["VERSION"] = vm[:version]
      ENV["PRERELEASE"] = vm[:pre]
    end

    task release_sanity: :trusted_release
  end

  define_halostatue_checklist_tasks
  define_halostatue_gemspec_tasks
  define_halostatue_git_tasks
  define_halostatue_markdown_tasks
end

#initialize_halostatueObject

:nodoc:



85
86
87
88
89
90
91
92
# File 'lib/hoe/halostatue.rb', line 85

def initialize_halostatue # :nodoc:
  initialize_halostatue_checklist
  initialize_halostatue_gemspec
  initialize_halostatue_git
  initialize_halostatue_markdown

  self.trusted_release = false
end