/raketeer

💎🍂🗡️ Extra Ruby Rake Tasks.

Primary LanguageRubyGNU Lesser General Public License v3.0LGPL-3.0

Raketeer

Gem Version

Source Code Changelog License

Extra Ruby Rake Tasks.

A CLI app is also available that uses these tasks, which is useful for tasks like bump (which bumps the version for your RubyGem project) so that you don't have to include this Gem as a development dependency for every project.

Contents

Pick your poison...

With the RubyGems CLI package manager:

$ gem install raketeer

In your Gemspec (<project>.gemspec):

spec.add_development_dependency 'raketeer', '~> 0.2'

In your Gemfile:

gem 'raketeer', '~> 0.2', group: [:development, :test]

# or...
gem 'raketeer', git: 'https://github.com/esotericpig/raketeer.git',
                tag: 'v0.2.10', group: [:development, :test]

Manually:

$ git clone 'https://github.com/esotericpig/raketeer.git'
$ cd raketeer
$ bundle install
$ bundle exec rake install:local

Rakefile

In your Rakefile, you can either include all tasks...

require 'raketeer/all'

Or, include the specific tasks that you need:

require 'raketeer/bump'
require 'raketeer/github_pkg'
require 'raketeer/irb'
require 'raketeer/nokogiri_installs'
require 'raketeer/run'

If you have conflicting tasks and/or you want to see what tasks have been included, you can put them in a namespace:

namespace :rt do
  require 'raketeer/all'
end

Included Tasks

rake bump[version]      # Show/Set/Bump the version
rake bump:build[build]  # Set/Erase the build metadata
rake bump:bundle        # Bump the Gemfile.lock version
rake bump:help          # Show the help/usage for bump tasks
rake bump:major[major]  # Bump/Set the major version
rake bump:minor[minor]  # Bump/Set the minor version
rake bump:patch[patch]  # Bump/Set the patch version
rake bump:pre[pre]      # Set/Erase the pre-release version
rake github_pkg         # Publish this project's gem(s) to GitHub Packages
rake irb                # Open an irb session loaded with this library
rake nokogiri_apt       # Install Nokogiri libs for Ubuntu/Debian
rake nokogiri_dnf       # Install Nokogiri libs for Fedora/CentOS/Red Hat
rake nokogiri_other     # Install Nokogiri libs for other OSes
rake run                # Run this project's main file: "rake run -- --version"

bump:help

$ rake bump:help
rake bump  # Print the current version

# You can run a dry run for any task (will not write to files)
rake bump dryrun=true

rake bump[1.2.3-alpha.4-beta.5]       # Set the version manually
rake bump major=1 minor=2 patch=3     # Set the version numbers
rake bump pre=alpha.4 build=beta.5    # Set the version extensions
rake bump major=+1 minor=+1 patch=+1  # Bump the version numbers by 1
rake bump major=+2 minor=+3 patch=+4  # Bump the version numbers by X

rake bump:major          # Bump the major version by 1
rake bump:major[1]       # Set the major version to 1
rake bump:major[+2]      # Bump the major version by 2
rake bump:minor          # Bump the minor version by 1
rake bump:minor[2]       # Set the minor version to 2
rake bump:minor[+3]      # Bump the minor version by 3
rake bump:patch          # Bump the patch version by 1
rake bump:patch[3]       # Set the patch version to 3
rake bump:patch[+4]      # Bump the patch version by 4
rake bump:pre            # Erase the pre-release version
rake bump:pre[alpha.4]   # Set the pre-release version
rake bump:build          # Erase the build metadata
rake bump:build[beta.5]  # Set the build metadata
rake bump:bundle         # Bump the Gemfile.lock version

Modifying Tasks

If you need more control, for now, please look at the accessors of each task (better documentation is planned for v1.0.0):

For example, in your Rakefile:

require 'raketeer/bump_task'

Raketeer::BumpTask.new() do |task|
  task.strict = true
end
require 'raketeer/github_pkg_task'

Raketeer::GitHubPkgTask.new() do |task|
  task.deps << 'test'
  task.username = 'esotericpig'
end
$ git clone 'https://github.com/esotericpig/raketeer.git'
$ cd raketeer
$ bundle install
$ bundle exec rake -T

GNU LGPL v3+

Raketeer (https://github.com/esotericpig/raketeer)
Copyright (c) 2019-2021 Jonathan Bradley Whited

Raketeer is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Raketeer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with Raketeer. If not, see https://www.gnu.org/licenses/.