raketary 0.2.3 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d4573e3e34e7bf212e7c2bda52a0f88f2d393e1efba08beaec5b831f4ffd59c
4
- data.tar.gz: ab800104a012721b77ede7d4e8d40de46cf849bec9e9d774110cf1454910679c
3
+ metadata.gz: 6400837d87deb1533f7474f155c523af7ebc198daa3e6b9c5f11743d56dae729
4
+ data.tar.gz: c11640fe5fe84e66f31a5472454118e4154c4879529ae4df9a6694160882acbf
5
5
  SHA512:
6
- metadata.gz: 5a4f795a68dd99adb678188fc4d6c94bb2f3cbe81e0789a323978661160fd58d4277aa4c5eeb6346f255b2f18a078785777d314b97c444e38d01f432393d2456
7
- data.tar.gz: 1932038ca0fbf435d0deae6158a8877480eca006425303f2ff3f855905fd1db4429239728d8089fa93168b4f7f315298e1ae3c1edbe16d46c4de42bc1afdcdd8
6
+ metadata.gz: c276366d2333e73b26c8f71571768d6df1a12e64d139e59f3a7c01d990a5823b21ca2563bb623785b0be97d7adb5478ea5a67b0e0a030496ca37df5f09936b7c
7
+ data.tar.gz: 47a84e176161692ced250f1906570c778dc965aeba5da23e36d2cb408ec83cce6cff552cc37d17a4d72233666a31138589078d8b5ba36ce51026e1abfb0eef92
data/CHANGELOG.md CHANGED
@@ -1,83 +1,66 @@
1
1
  # Changelog | Raketary
2
2
 
3
- All notable changes to this project will be documented in this file.
3
+ - [Keep a Changelog](https://keepachangelog.com/en/1.1.0),
4
+ - [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
4
5
 
5
- Format is based on [Keep a Changelog v1.0.0](https://keepachangelog.com/en/1.0.0),
6
- and this project adheres to [Semantic Versioning v2.0.0](https://semver.org/spec/v2.0.0.html).
6
+ ## [[Unreleased]](https://github.com/esotericpig/raketary/compare/v0.2.5...HEAD)
7
7
 
8
- ## [[Unreleased]](https://github.com/esotericpig/raketary/compare/v0.2.3...HEAD)
9
- -
8
+ ## [0.2.5] - 2025-06-06
9
+ ### Fixed
10
+ - Fixed long opts with a dash not working (e.g., `--dry-run`).
10
11
 
12
+ ### Changed
13
+ - Updated Gems.
14
+ - Updated Readme.
15
+ - Applied new RuboCop suggestions.
16
+ - Renamed Git branch `master` to `main`.
11
17
 
12
- ## [v0.2.3] - 2021-06-18
18
+ ## [0.2.4] - 2021-06-22
13
19
  ### Changed
14
- - Updated raketeer gem.
20
+ - Updated raketeer Gem for `bump` command.
15
21
 
22
+ ## [0.2.3] - 2021-06-18
23
+ ### Changed
24
+ - Updated raketeer Gem.
16
25
 
17
- ## [v0.2.2] - 2021-06-16
26
+ ## [0.2.2] - 2021-06-16
18
27
  ### Changed
19
28
  - Formatted code with RuboCop.
20
29
  - Updated Gems.
21
30
 
22
-
23
- ## [v0.2.1] - 2020-03-04
31
+ ## [0.2.1] - 2020-03-04
24
32
  ### Fixed
25
- - Added back `irb` gem to Gemspec
26
-
33
+ - Added back `irb` gem to Gemspec.
27
34
 
28
- ## [v0.2.0] - 2020-03-04
35
+ ## [0.2.0] - 2020-03-04
29
36
  ### Added
30
- - Added `GHPSyncCmd` for syncing YARDoc to GitHub Pages
31
- - Calls `rsync` to sync `./doc/` to another local directory
32
- - File: `lib/raketary/ghp_sync_cmd.rb`
33
- - Sub cmd: `ghp_sync`
37
+ - Added `GHPSyncCmd` for syncing YARDoc to GitHub Pages.
38
+ - Calls `rsync` to sync `./doc/` to another local directory.
39
+ - File: `lib/raketary/ghp_sync_cmd.rb`.
40
+ - Sub cmd: `ghp_sync`.
34
41
 
35
42
  ### Changed
36
- - Renamed `App*` classes (`app_*.rb` files) to `*Cmd` (`*_cmd.rb`) since they extend `Cmd`, not `App`
43
+ - Renamed `App*` classes (`app_*.rb` files) to `*Cmd` (`*_cmd.rb`) since they extend `Cmd`, not `App`.
37
44
 
38
-
39
- ## [v0.1.3] - 2020-03-02
45
+ ## [0.1.3] - 2020-03-02
40
46
  ### Changed
41
- - Changed AppGitHubPkg logic to not check if username is nil (minor; not a bug)
42
-
47
+ - Changed AppGitHubPkg logic to not check if username is nil (minor; not a bug).
43
48
 
44
- ## [v0.1.2] - 2020-03-01
49
+ ## [0.1.2] - 2020-03-01
45
50
  ### Added
46
- - Added `github_pkg` sub command using AppGitHubPkg & Raketeer::GitHubPkgTask
47
- - This will publish/push your `pkg/*.gem` release(s) to GitHub Packages
51
+ - Added `github_pkg` sub command using AppGitHubPkg & Raketeer::GitHubPkgTask.
52
+ - This will publish/push your `pkg/*.gem` release(s) to GitHub Packages.
48
53
 
49
54
  ### Changed
50
- - Updated Gemfile.lock
55
+ - Updated Gemfile.lock.
51
56
 
52
57
  ### Fixed
53
- - Fixed AppBump (`bump` sub command) to bump the bundle after bumping all
54
- - Before this fix, it required you calling `bump` twice on the command line
55
-
58
+ - Fixed AppBump (`bump` sub command) to bump the bundle after bumping all.
59
+ - Before this fix, it required you calling `bump` twice on the command line.
56
60
 
57
- ## [v0.1.1] - 2019-12-18
61
+ ## [0.1.1] - 2019-12-18
58
62
  ### Changed
59
- - Added more info to CHANGELOG, README, TODO
63
+ - Added more info to CHANGELOG, README, TODO.
60
64
 
61
-
62
- ## [v0.1.0] - 2019-08-06
63
- ### Added
64
- - .gitignore
65
- - CHANGELOG.md
66
- - Gemfile
67
- - Gemfile.lock
68
- - LICENSE.txt
69
- - Rakefile
70
- - raketary.gemspec
71
- - README.md
72
- - TODO.md
73
- - bin/raketary
74
- - lib/raketary.rb
75
- - lib/raketary/app.rb
76
- - lib/raketary/app_bump.rb
77
- - lib/raketary/app_irb.rb
78
- - lib/raketary/app_nokogiri.rb
79
- - lib/raketary/app_run.rb
80
- - lib/raketary/cmd.rb
81
- - lib/raketary/errors.rb
82
- - lib/raketary/sub_cmd.rb
83
- - lib/raketary/version.rb
65
+ ## [0.1.0] - 2019-08-06
66
+ Initial release.
data/Gemfile CHANGED
@@ -1,7 +1,17 @@
1
1
  # encoding: UTF-8
2
2
  # frozen_string_literal: true
3
3
 
4
-
5
4
  source 'https://rubygems.org'
6
5
 
7
6
  gemspec
7
+
8
+ group :development,:test do
9
+ gem 'bundler' ,'~> 2.6'
10
+
11
+ gem 'rdoc' ,'~> 6.14' # For YARDoc RDoc (*.rb).
12
+ gem 'redcarpet','~> 3.6' # For YARDoc Markdown (*.md).
13
+ end
14
+
15
+ group :test do
16
+ # gem 'minitest','~> 5.25'
17
+ end
data/Gemfile.lock CHANGED
@@ -1,25 +1,41 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- raketary (0.2.3)
5
- irb (~> 1.3)
6
- rake (~> 13.0)
4
+ raketary (0.2.5)
5
+ irb (~> 1.15)
6
+ rake (~> 13.3)
7
7
  raketeer (~> 0.2)
8
+ yard (~> 0.9)
8
9
  yard_ghurt (~> 1.2)
9
10
 
10
11
  GEM
11
12
  remote: https://rubygems.org/
12
13
  specs:
13
- io-console (0.5.9)
14
- irb (1.3.5)
15
- reline (>= 0.1.5)
16
- rake (13.0.3)
17
- raketeer (0.2.12)
14
+ date (3.4.1)
15
+ erb (5.0.1)
16
+ io-console (0.8.0)
17
+ irb (1.15.2)
18
+ pp (>= 0.6.0)
19
+ rdoc (>= 4.0.0)
20
+ reline (>= 0.4.2)
21
+ pp (0.6.2)
22
+ prettyprint
23
+ prettyprint (0.2.0)
24
+ psych (5.2.6)
25
+ date
26
+ stringio
27
+ rake (13.3.0)
28
+ raketeer (0.2.14)
18
29
  rake
19
- reline (0.2.5)
30
+ rdoc (6.14.0)
31
+ erb
32
+ psych (>= 4.0.0)
33
+ redcarpet (3.6.1)
34
+ reline (0.6.1)
20
35
  io-console (~> 0.5)
21
- yard (0.9.26)
22
- yard_ghurt (1.2.1)
36
+ stringio (3.1.7)
37
+ yard (0.9.37)
38
+ yard_ghurt (1.2.2)
23
39
  rake
24
40
  yard
25
41
 
@@ -27,9 +43,10 @@ PLATFORMS
27
43
  ruby
28
44
 
29
45
  DEPENDENCIES
30
- bundler (~> 2.2)
46
+ bundler (~> 2.6)
31
47
  raketary!
32
- yard (~> 0.9)
48
+ rdoc (~> 6.14)
49
+ redcarpet (~> 3.6)
33
50
 
34
51
  BUNDLED WITH
35
- 2.2.20
52
+ 2.6.9
data/README.md CHANGED
@@ -1,10 +1,9 @@
1
1
  # Raketary
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/raketary.svg)](https://badge.fury.io/rb/raketary)
4
-
5
- [![Source Code](https://img.shields.io/badge/source-github-%23A0522D.svg?style=for-the-badge)](https://github.com/esotericpig/raketary)
6
- [![Changelog](https://img.shields.io/badge/changelog-md-%23A0522D.svg?style=for-the-badge)](CHANGELOG.md)
7
- [![License](https://img.shields.io/github/license/esotericpig/raketary.svg?color=%23A0522D&style=for-the-badge)](LICENSE.txt)
4
+ [![Source Code](https://img.shields.io/badge/source-github-%23211F1F.svg)](https://github.com/esotericpig/raketary)
5
+ [![Changelog](https://img.shields.io/badge/changelog-md-%23A0522D.svg)](CHANGELOG.md)
6
+ [![License](https://img.shields.io/github/license/esotericpig/raketary.svg)](LICENSE.txt)
8
7
 
9
8
  CLI app for commonly-used Rake tasks.
10
9
 
@@ -13,35 +12,40 @@ Includes:
13
12
  - [Raketeer](https://github.com/esotericpig/raketeer)
14
13
  - [YardGhurt](https://github.com/esotericpig/yard_ghurt)
15
14
 
16
- ![Demo of Raketary on the command line](https://github.com/esotericpig/esotericpig.github.io/blob/master/pics/raketary_demo.gif)
15
+ ![Demo of Raketary on the command line](https://github.com/esotericpig/esotericpig.github.io/blob/main/pics/raketary_demo.gif?raw=true)
17
16
 
18
- ## Contents
17
+ ## // Contents
19
18
 
20
- - [Installing](#installing)
21
- - [Using](#using)
22
- - [Hacking](#hacking)
23
- - [License](#license)
19
+ - [Installing](#-installing)
20
+ - [Using](#-using)
21
+ - [Bump](#-bump)
22
+ - [GitHub Pkg](#-github-pkg)
23
+ - [GitHub Pages Sync](#-github-pages-sync)
24
+ - [Hacking](#-hacking)
25
+ - [License](#-license)
24
26
 
25
- ## [Installing](#contents)
27
+ ## [//](#-contents) Installing
26
28
 
27
29
  Pick your poison...
28
30
 
29
31
  With the RubyGems CLI package manager:
30
32
 
31
- `$ gem install raketary`
33
+ ```bash
34
+ gem install raketary
35
+ ```
32
36
 
33
- Manually:
37
+ From source:
34
38
 
35
- ```
36
- $ git clone 'https://github.com/esotericpig/raketary.git'
37
- $ cd raketary
38
- $ bundle install
39
- $ bundle exec rake install:local
39
+ ```bash
40
+ git clone --depth 1 'https://github.com/esotericpig/raketary.git'
41
+ cd raketary
42
+ bundle install
43
+ bundle exec rake install:local
40
44
  ```
41
45
 
42
- ## [Using](#contents)
46
+ ## [//](#-contents) Using
43
47
 
44
- ```
48
+ ```bash
45
49
  $ raketary
46
50
  Usage: raketary [options] [command] [options]...
47
51
 
@@ -58,11 +62,10 @@ Options:
58
62
  -v, --version show the version of raketary
59
63
  ```
60
64
 
61
- **Bump**
65
+ ### [//](#-contents) Bump
62
66
 
63
- ```
67
+ ```bash
64
68
  $ raketary bump
65
- ...
66
69
  [bump] Options:
67
70
  -n, --dry-run do a dry run (do NOT write to files)
68
71
  -s, --strict enforce semantic versioning (i.e., \d+\.\d+\.\d+.*)
@@ -79,7 +82,7 @@ $ raketary bump
79
82
  -x, --example show some examples
80
83
  ```
81
84
 
82
- ```
85
+ ```bash
83
86
  $ raketary bump -x
84
87
  raketary bump -v # Show the current version
85
88
  raketary bump -n # Do a dry run for any task (will NOT write to files)
@@ -106,21 +109,19 @@ raketary bump -b 'beta.5' # Set the build metadata
106
109
  raketary bump -u # Bump the Gemfile.lock version
107
110
  ```
108
111
 
109
- **GitHub Pkg**
112
+ ### [//](#-contents) GitHub Pkg
110
113
 
111
- ```
114
+ ```bash
112
115
  $ raketary github_pkg -h
113
- ...
114
116
  [github_pkg] Options:
115
117
  -u, --user [STR] set the GitHub username
116
118
  -h, --help show this help
117
119
  ```
118
120
 
119
- **GitHub Pages Sync**
121
+ ### [//](#-contents) GitHub Pages Sync
120
122
 
121
- ```
123
+ ```bash
122
124
  $ raketary ghp_sync -h
123
- ...
124
125
  [ghp_sync] Options:
125
126
  -g, --ghp-dir STR the destination (GitHub Pages) directory to sync "doc/" to
126
127
 
@@ -130,21 +131,21 @@ $ raketary ghp_sync -h
130
131
  -h, --help show this help
131
132
  ```
132
133
 
133
- ## [Hacking](#contents)
134
+ ## [//](#-contents) Hacking
134
135
 
135
- ```
136
- $ git clone 'https://github.com/esotericpig/raketary.git'
137
- $ cd raketary
138
- $ bundle install
139
- $ bundle exec rake -T
136
+ ```bash
137
+ git clone 'https://github.com/esotericpig/raketary.git'
138
+ cd raketary
139
+ bundle install
140
+ bundle exec rake -T
140
141
  ```
141
142
 
142
- ## [License](#contents)
143
+ ## [//](#-contents) License
143
144
 
144
145
  [GNU LGPL v3+](LICENSE.txt)
145
146
 
146
147
  > Raketary (<https://github.com/esotericpig/raketary>)
147
- > Copyright (c) 2019-2021 Jonathan Bradley Whited
148
+ > Copyright (c) 2019-2025 Bradley Whited
148
149
  >
149
150
  > Raketary is free software: you can redistribute it and/or modify
150
151
  > it under the terms of the GNU Lesser General Public License as published by
data/Rakefile CHANGED
@@ -1,28 +1,13 @@
1
1
  # encoding: UTF-8
2
2
  # frozen_string_literal: true
3
3
 
4
-
5
4
  require 'bundler/gem_tasks'
6
5
 
7
6
  require 'rake/clean'
8
7
  require 'raketary/version'
9
8
  require 'raketeer/run'
10
- require 'yard'
11
-
12
9
 
13
10
  task default: [:run]
14
11
 
15
- CLEAN.exclude('.git/','stock/')
12
+ CLEAN.exclude('.git/','.github/','.idea/','stock/')
16
13
  CLOBBER.include('doc/')
17
-
18
-
19
- YARD::Rake::YardocTask.new do |task|
20
- task.files = [File.join('lib','**','*.rb')]
21
-
22
- task.options += ['--files','CHANGELOG.md,LICENSE.txt']
23
- task.options += ['--readme','README.md']
24
-
25
- task.options << '--protected' # Show protected methods
26
- #task.options += ['--template-path',File.join('yard','templates')]
27
- task.options += ['--title',"Raketary v#{Raketary::VERSION} Doc"]
28
- end
data/bin/raketary CHANGED
@@ -4,14 +4,12 @@
4
4
 
5
5
  #--
6
6
  # This file is part of Raketary.
7
- # Copyright (c) 2019-2021 Jonathan Bradley Whited
7
+ # Copyright (c) 2019 Bradley Whited
8
8
  #
9
9
  # SPDX-License-Identifier: LGPL-3.0-or-later
10
10
  #++
11
11
 
12
-
13
12
  require 'raketary'
14
13
 
15
14
  app = Raketary::App.new
16
-
17
15
  app.run
data/lib/raketary/app.rb CHANGED
@@ -3,12 +3,11 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Raketary.
6
- # Copyright (c) 2019-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2019 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  require 'raketary/bump_cmd'
13
12
  require 'raketary/cmd'
14
13
  require 'raketary/ghp_sync_cmd'
@@ -19,12 +18,7 @@ require 'raketary/run_cmd'
19
18
  require 'raketary/sub_cmd'
20
19
  require 'raketary/version'
21
20
 
22
-
23
21
  module Raketary
24
- ###
25
- # @author Jonathan Bradley Whited
26
- # @since 0.1.0
27
- ###
28
22
  class App < Cmd
29
23
  attr_reader :args
30
24
  attr_reader :options
@@ -35,7 +29,7 @@ module Raketary
35
29
 
36
30
  alias_method :ran_cmd?,:ran_cmd
37
31
 
38
- def initialize(args=ARGV)
32
+ def initialize(args = ARGV)
39
33
  super(self,'raketary')
40
34
 
41
35
  @args = args
@@ -51,7 +45,7 @@ module Raketary
51
45
  'github_pkg' => SubCmd.new("Publish your project's gem(s) to GitHub Packages",GitHubPkgCmd),
52
46
  'irb' => SubCmd.new('Open an irb session loaded with your library',IRBCmd),
53
47
  'nokogiri' => SubCmd.new('Install Nokogiri libs',NokogiriCmd),
54
- 'run' => SubCmd.new("Run your project's main file: #{@name} run -- --version",RunCmd)
48
+ 'run' => SubCmd.new("Run your project's main file: #{@name} run -- --version",RunCmd),
55
49
  }
56
50
 
57
51
  parse!(true) do |op|
@@ -3,21 +3,15 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Raketary.
6
- # Copyright (c) 2019-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2019 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  require 'raketary/cmd'
13
12
  require 'raketeer/bump_task'
14
13
 
15
-
16
14
  module Raketary
17
- ###
18
- # @author Jonathan Bradley Whited
19
- # @since 0.1.0
20
- ###
21
15
  class BumpCmd < Cmd
22
16
  def initialize(*)
23
17
  super
@@ -28,10 +22,10 @@ module Raketary
28
22
  op.on('-n','--dry-run','do a dry run (do NOT write to files)')
29
23
  op.on('-s','--strict','enforce semantic versioning (i.e., \\d+\\.\\d+\\.\\d+.*)')
30
24
 
31
- op.separator op.summary_indent
25
+ op.separator(op.summary_indent)
32
26
 
33
- op.on('-v','--ver [STR]',"show/set the version (e.g.: '1.2.3-alpha.4+beta.5')" \
34
- ' (default: show)') do |ver|
27
+ op.on('-v','--ver [STR]',"show/set the version (e.g.: '1.2.3-alpha.4+beta.5') " \
28
+ '(default: show)') do |ver|
35
29
  @run_cmd = true
36
30
  ver
37
31
  end
@@ -47,13 +41,13 @@ module Raketary
47
41
  @run_cmd = true
48
42
  patch.nil? ? '+1' : patch
49
43
  end
50
- op.on('-r','--pre [STR]',"set/erase the pre-release extension (e.g.: 'alpha.4')" \
51
- ' (default: erase)') do |pre|
44
+ op.on('-r','--pre [STR]',"set/erase the pre-release extension (e.g.: 'alpha.4') " \
45
+ '(default: erase)') do |pre|
52
46
  @run_cmd = true
53
47
  pre.nil? ? '' : pre
54
48
  end
55
- op.on('-b','--build [STR]',"set/erase the the build metadata (e.g.: 'beta.5')" \
56
- ' (default: erase)') do |build|
49
+ op.on('-b','--build [STR]',"set/erase the the build metadata (e.g.: 'beta.5') " \
50
+ '(default: erase)') do |build|
57
51
  @run_cmd = true
58
52
  build.nil? ? '' : build
59
53
  end
@@ -62,7 +56,7 @@ module Raketary
62
56
  true
63
57
  end
64
58
 
65
- op.separator op.summary_indent
59
+ op.separator(op.summary_indent)
66
60
 
67
61
  op.on_tail('-x','--example','show some examples') do
68
62
  puts <<~EXAMPLES
@@ -96,7 +90,7 @@ module Raketary
96
90
  end
97
91
 
98
92
  def run
99
- super()
93
+ super
100
94
  return unless @run_cmd
101
95
 
102
96
  bump_task = Raketeer::BumpTask.new do |task|
@@ -113,7 +107,7 @@ module Raketary
113
107
  minor: app.options[:minor],
114
108
  patch: app.options[:patch],
115
109
  prerelease: app.options[:pre],
116
- build_meta: app.options[:build]
110
+ build_meta: app.options[:build],
117
111
  ))
118
112
 
119
113
  bump_task.bump_bundle_file if app.options[:bundle]
data/lib/raketary/cmd.rb CHANGED
@@ -3,57 +3,46 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Raketary.
6
- # Copyright (c) 2019-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2019 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  require 'optparse'
13
12
  require 'raketary/errors'
14
13
 
15
-
16
14
  module Raketary
17
- ###
18
- # @author Jonathan Bradley Whited
19
- # @since 0.1.0
20
- ###
21
15
  class Cmd
22
16
  attr_reader :app
23
- attr_reader :leftover_args
24
17
  attr_reader :name
25
18
  attr_reader :sub_cmds
19
+ attr_reader :leftover_args
26
20
 
27
21
  def initialize(app,name)
28
22
  @app = app
29
- @leftover_args = []
30
23
  @name = name
31
24
  @sub_cmds = {}
25
+ @leftover_args = []
32
26
  end
33
27
 
34
- def parse!(is_app=false)
28
+ def parse!(is_app = false)
35
29
  parser = OptionParser.new do |op|
36
30
  op.program_name = app.name
37
31
  op.version = app.version
38
32
 
39
33
  op.banner = ''
40
- op.separator '' if is_app
34
+ op.separator('') if is_app
41
35
 
42
36
  if !@sub_cmds.empty?
43
- op.separator is_app ? 'Commands:' : "[#{@name}] Commands:"
37
+ op.separator(is_app ? 'Commands:' : "[#{@name}] Commands:")
44
38
 
45
39
  @sub_cmds.each do |name,sub_cmd|
46
- name_desc = ''.dup
47
- name_desc << op.summary_indent
48
- name_desc << ("%-#{op.summary_width}s #{sub_cmd.desc}" % [name])
49
-
50
- op.separator name_desc
40
+ op.separator("#{op.summary_indent}#{format("%-#{op.summary_width}s #{sub_cmd.desc}",name)}")
51
41
  end
52
- op.separator ''
42
+ op.separator('')
53
43
  end
54
44
 
55
- op.separator is_app ? 'Options:' : "[#{@name}] Options:"
56
-
45
+ op.separator(is_app ? 'Options:' : "[#{@name}] Options:")
57
46
  op.on_tail('-h','--help','show this help')
58
47
 
59
48
  yield op
@@ -62,9 +51,10 @@ module Raketary
62
51
  options = {}
63
52
  @leftover_args = parser.order!(app.args,into: options).dup
64
53
 
65
- options.each_key do |key|
54
+ # NOTE: Can't use each_key(), since we modify the hash in the loop.
55
+ options.keys.each do |key|
66
56
  if (key_s = key.to_s).include?('-')
67
- options[key_s.gsub('-','_').to_sym] = options[key]
57
+ options[key_s.tr('-','_').to_sym] = options[key]
68
58
  options.delete(key)
69
59
  end
70
60
  end
@@ -72,13 +62,13 @@ module Raketary
72
62
 
73
63
  app.parsers << parser
74
64
 
75
- if !app.args.nil? && !(sub_cmd_name = app.args.shift).nil?
76
- if !(sub_cmd = @sub_cmds[sub_cmd_name]).nil?
77
- begin
78
- sub_cmd.cmd_class.new(app,sub_cmd_name).run
79
- rescue DoNotRunCmdError => e
80
- app.soft_error = e.soft_msg
81
- end
65
+ if !app.args.nil? &&
66
+ !(sub_cmd_name = app.args.shift).nil? &&
67
+ !(sub_cmd = @sub_cmds[sub_cmd_name]).nil?
68
+ begin
69
+ sub_cmd.cmd_class.new(app,sub_cmd_name).run
70
+ rescue DoNotRunCmdError => e
71
+ app.soft_error = e.soft_msg
82
72
  end
83
73
  end
84
74
 
@@ -3,22 +3,17 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Raketary.
6
- # Copyright (c) 2019-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2019 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  module Raketary
13
- ###
14
- # @author Jonathan Bradley Whited
15
- # @since 0.1.0
16
- ###
17
12
  class DoNotRunCmdError < StandardError
18
13
  attr_accessor :soft_msg
19
14
 
20
- def initialize(msg=nil)
21
- super(msg)
15
+ def initialize(msg = nil)
16
+ super
22
17
 
23
18
  @soft_msg = msg
24
19
  end
@@ -3,23 +3,17 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Raketary.
6
- # Copyright (c) 2020-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2020 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  require 'rake'
13
12
  require 'raketary/cmd'
14
13
  require 'shellwords'
15
14
  require 'yard_ghurt/ghp_sync_task'
16
15
 
17
-
18
16
  module Raketary
19
- ###
20
- # @author Jonathan Bradley Whited
21
- # @since 0.2.0
22
- ###
23
17
  class GHPSyncCmd < Cmd
24
18
  def initialize(*)
25
19
  super
@@ -28,8 +22,8 @@ module Raketary
28
22
  app.args.each_with_index do |arg,i|
29
23
  arg = arg.strip
30
24
 
31
- if arg == '-s' || arg.downcase == '--sync-args'
32
- sync_args = app.args[i + 1] # If out of bounds, nil
25
+ if arg == '-s' || arg.casecmp?('--sync-args')
26
+ sync_args = app.args[i + 1] # If out of bounds, nil.
33
27
 
34
28
  if !sync_args.nil?
35
29
  sync_args = Shellwords.split(sync_args)
@@ -38,8 +32,9 @@ module Raketary
38
32
  app.options[:sync_args] = sync_args
39
33
  end
40
34
 
35
+ # NOTE: This is safe only because we break immediately after.
41
36
  app.args.delete_at(i)
42
- app.args.delete_at(i) # If out of bounds, no error
37
+ app.args.delete_at(i) # If out of bounds, no error.
43
38
 
44
39
  break
45
40
  end
@@ -48,19 +43,19 @@ module Raketary
48
43
  parse! do |op|
49
44
  op.on('-g','--ghp-dir STR','the destination (GitHub Pages) directory to sync "doc/" to')
50
45
 
51
- op.separator op.summary_indent
46
+ op.separator(op.summary_indent)
52
47
 
53
48
  op.on('-d','--deploy',"actually deploy (don't just do a dry-run)")
54
- op.on('-s','--sync-args STR','additional args to pass to the sync command') do |sync_args|
49
+ op.on('-s','--sync-args STR','additional args to pass to the sync command') do |_sync_args|
55
50
  app.options[:sync_args] # Already processed above
56
51
  end
57
52
 
58
- op.separator op.summary_indent
53
+ op.separator(op.summary_indent)
59
54
  end
60
55
  end
61
56
 
62
57
  def run
63
- super()
58
+ super
64
59
 
65
60
  ghp_dir = app.options[:ghp_dir]
66
61
 
@@ -3,23 +3,17 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Raketary.
6
- # Copyright (c) 2020-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2020 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  require 'bundler/gem_tasks'
13
12
  require 'rake'
14
13
  require 'raketary/cmd'
15
14
  require 'raketeer/github_pkg_task'
16
15
 
17
-
18
16
  module Raketary
19
- ###
20
- # @author Jonathan Bradley Whited
21
- # @since 0.1.2
22
- ###
23
17
  class GitHubPkgCmd < Cmd
24
18
  def initialize(*)
25
19
  super
@@ -27,17 +21,16 @@ module Raketary
27
21
  parse! do |op|
28
22
  op.on('-u','--user STR','set the GitHub username')
29
23
 
30
- op.separator op.summary_indent
24
+ op.separator(op.summary_indent)
31
25
  end
32
26
  end
33
27
 
34
28
  def run
35
- super()
29
+ super
36
30
 
37
31
  ghpkg_task = Raketeer::GitHubPkgTask.new do |task|
38
32
  task.username = app.options[:user]
39
33
  end
40
-
41
34
  ghpkg_task = Rake::Task[ghpkg_task.name]
42
35
 
43
36
  ghpkg_task.reenable
@@ -3,33 +3,27 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Raketary.
6
- # Copyright (c) 2019-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2019 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  require 'rake'
13
12
  require 'raketary/cmd'
14
13
  require 'raketeer/irb_task'
15
14
 
16
-
17
15
  module Raketary
18
- ###
19
- # @author Jonathan Bradley Whited
20
- # @since 0.1.0
21
- ###
22
16
  class IRBCmd < Cmd
23
17
  def initialize(*)
24
18
  super
25
19
 
26
- parse! do |op|
27
- #op.separator op.summary_indent
20
+ parse! do |_op|
21
+ # op.separator(op.summary_indent)
28
22
  end
29
23
  end
30
24
 
31
25
  def run
32
- super()
26
+ super
33
27
 
34
28
  irb_task = Raketeer::IRBTask.new
35
29
  irb_task = Rake::Task[irb_task.name]
@@ -3,22 +3,16 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Raketary.
6
- # Copyright (c) 2019-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2019 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  require 'raketary/cmd'
13
12
  require 'raketary/errors'
14
13
  require 'raketeer/nokogiri_install_tasks'
15
14
 
16
-
17
15
  module Raketary
18
- ###
19
- # @author Jonathan Bradley Whited
20
- # @since 0.1.0
21
- ###
22
16
  class NokogiriCmd < Cmd
23
17
  def initialize(*)
24
18
  super
@@ -38,12 +32,12 @@ module Raketary
38
32
  @main_opts += 1
39
33
  true
40
34
  end
41
- op.separator op.summary_indent
35
+ op.separator(op.summary_indent)
42
36
  end
43
37
  end
44
38
 
45
39
  def run
46
- super()
40
+ super
47
41
  return if @main_opts <= 0
48
42
 
49
43
  if @main_opts >= 2
@@ -3,38 +3,32 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Raketary.
6
- # Copyright (c) 2019-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2019 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  require 'rake'
13
12
  require 'raketary/cmd'
14
13
  require 'raketeer/run_task'
15
14
 
16
-
17
15
  module Raketary
18
- ###
19
- # @author Jonathan Bradley Whited
20
- # @since 0.1.0
21
- ###
22
16
  class RunCmd < Cmd
23
17
  def initialize(*)
24
18
  super
25
19
 
26
- parse! do |op|
27
- #op.separator op.summary_indent
20
+ parse! do |_op|
21
+ # op.separator(op.summary_indent)
28
22
  end
29
23
  end
30
24
 
31
25
  def run
32
- super()
26
+ super
33
27
 
34
28
  run_task = Raketeer::RunTask.new
35
29
 
36
30
  ARGV << run_task.name.to_s
37
- ARGV.push(*@leftover_args)
31
+ ARGV.concat(@leftover_args)
38
32
 
39
33
  run_task = Rake::Task[run_task.name]
40
34
 
@@ -3,24 +3,19 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Raketary.
6
- # Copyright (c) 2019-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2019 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  module Raketary
13
- ###
14
- # @author Jonathan Bradley Whited
15
- # @since 0.1.0
16
- ###
17
12
  class SubCmd
18
- attr_reader :cmd_class
19
13
  attr_reader :desc
14
+ attr_reader :cmd_class
20
15
 
21
16
  def initialize(desc,cmd_class)
22
- @cmd_class = cmd_class
23
17
  @desc = desc
18
+ @cmd_class = cmd_class
24
19
  end
25
20
  end
26
21
  end
@@ -3,12 +3,11 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Raketary.
6
- # Copyright (c) 2019-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2019 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
-
12
11
  module Raketary
13
- VERSION = '0.2.3'
12
+ VERSION = '0.2.5'
14
13
  end
data/lib/raketary.rb CHANGED
@@ -3,15 +3,16 @@
3
3
 
4
4
  #--
5
5
  # This file is part of Raketary.
6
- # Copyright (c) 2019-2021 Jonathan Bradley Whited
6
+ # Copyright (c) 2019 Bradley Whited
7
7
  #
8
8
  # SPDX-License-Identifier: LGPL-3.0-or-later
9
9
  #++
10
10
 
11
+ module Raketary
12
+ IS_TEST = ($PROGRAM_NAME == __FILE__)
13
+ end
11
14
 
12
- TESTING_RAKETARY = ($PROGRAM_NAME == __FILE__)
13
-
14
- if TESTING_RAKETARY
15
+ if Raketary::IS_TEST
15
16
  require 'rubygems'
16
17
  require 'bundler/setup'
17
18
  end
@@ -28,12 +29,7 @@ require 'raketary/run_cmd'
28
29
  require 'raketary/sub_cmd'
29
30
  require 'raketary/version'
30
31
 
31
-
32
- ###
33
- # @author Jonathan Bradley Whited
34
- # @since 0.1.0
35
- ###
36
32
  module Raketary
37
33
  end
38
34
 
39
- Raketary::App.new.run if TESTING_RAKETARY
35
+ Raketary::App.new.run if Raketary::IS_TEST
data/raketary.gemspec CHANGED
@@ -1,17 +1,12 @@
1
1
  # encoding: UTF-8
2
2
  # frozen_string_literal: true
3
3
 
4
-
5
- lib = File.expand_path(File.join('..','lib'),__FILE__)
6
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
7
-
8
- require 'raketary/version'
9
-
4
+ require_relative 'lib/raketary/version'
10
5
 
11
6
  Gem::Specification.new do |spec|
12
7
  spec.name = 'raketary'
13
8
  spec.version = Raketary::VERSION
14
- spec.authors = ['Jonathan Bradley Whited']
9
+ spec.authors = ['Bradley Whited']
15
10
  spec.email = ['code@esotericpig.com']
16
11
  spec.licenses = ['LGPL-3.0-or-later']
17
12
  spec.homepage = 'https://github.com/esotericpig/raketary'
@@ -19,31 +14,35 @@ Gem::Specification.new do |spec|
19
14
  spec.description = spec.summary
20
15
 
21
16
  spec.metadata = {
22
- 'bug_tracker_uri' => 'https://github.com/esotericpig/raketary/issues',
23
- 'changelog_uri' => 'https://github.com/esotericpig/raketary/blob/master/CHANGELOG.md',
24
- 'homepage_uri' => 'https://github.com/esotericpig/raketary',
25
- 'source_code_uri' => 'https://github.com/esotericpig/raketary'
17
+ 'rubygems_mfa_required' => 'true',
18
+ 'homepage_uri' => spec.homepage,
19
+ 'changelog_uri' => 'https://github.com/esotericpig/raketary/blob/main/CHANGELOG.md',
20
+ 'source_code_uri' => 'https://github.com/esotericpig/raketary',
21
+ 'bug_tracker_uri' => 'https://github.com/esotericpig/raketary/issues',
26
22
  }
27
23
 
28
- spec.require_paths = ['lib']
29
- spec.bindir = 'bin'
30
- spec.executables = [spec.name]
24
+ spec.required_ruby_version = '>= 2.4'
25
+ spec.require_paths = ['lib']
26
+ spec.bindir = 'bin'
27
+ spec.executables = [spec.name]
31
28
 
32
- spec.files = Dir.glob(File.join("{#{spec.require_paths.join(',')}}",'**','*.{erb,rb}')) +
33
- Dir.glob(File.join(spec.bindir,'*')) +
34
- Dir.glob(File.join('{test,yard}','**','*.{erb,rb}')) +
35
- %W[ Gemfile Gemfile.lock #{spec.name}.gemspec Rakefile ] +
36
- %w[ CHANGELOG.md LICENSE.txt README.md ]
29
+ spec.files = [
30
+ Dir.glob("{#{spec.require_paths.join(',')}}/**/*.{erb,rb}"),
31
+ Dir.glob("#{spec.bindir}/*"),
32
+ Dir.glob('{spec,test,yard}/**/*.{erb,rb}'),
33
+ %W[Gemfile Gemfile.lock #{spec.name}.gemspec Rakefile],
34
+ %w[CHANGELOG.md LICENSE.txt README.md],
35
+ ].flatten
37
36
 
38
- spec.required_ruby_version = '>= 2.4'
37
+ spec.add_dependency 'rake' ,'~> 13.3' # For using the Rake tasks.
39
38
 
40
- spec.add_runtime_dependency 'irb' ,'~> 1.3' # For Raketeer::IRBTask
41
- spec.add_runtime_dependency 'rake' ,'~> 13.0' # For using custom Rake tasks
42
- spec.add_runtime_dependency 'raketeer' ,'~> 0.2' # For general Rake tasks
43
- spec.add_runtime_dependency 'yard_ghurt','~> 1.2' # For YARDoc Rake tasks
39
+ # For the general Rake tasks.
40
+ spec.add_dependency 'raketeer' ,'~> 0.2'
41
+ spec.add_dependency 'irb' ,'~> 1.15' # For Raketeer::IRBTask.
44
42
 
45
- spec.add_development_dependency 'bundler','~> 2.2'
46
- spec.add_development_dependency 'yard' ,'~> 0.9' # For documentation
43
+ # For the YARDoc Rake tasks.
44
+ spec.add_dependency 'yard_ghurt','~> 1.2'
45
+ spec.add_dependency 'yard' ,'~> 0.9'
47
46
 
48
- spec.post_install_message = "You can now use [#{spec.executables.join(', ')}] on the command line."
47
+ spec.post_install_message = "=> You can now use `#{spec.name}` on the command line."
49
48
  end
metadata CHANGED
@@ -1,43 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raketary
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
- - Jonathan Bradley Whited
8
- autorequire:
7
+ - Bradley Whited
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-18 00:00:00.000000000 Z
11
+ date: 2025-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: irb
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.3'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '1.3'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: rake
29
15
  requirement: !ruby/object:Gem::Requirement
30
16
  requirements:
31
17
  - - "~>"
32
18
  - !ruby/object:Gem::Version
33
- version: '13.0'
19
+ version: '13.3'
34
20
  type: :runtime
35
21
  prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
24
  - - "~>"
39
25
  - !ruby/object:Gem::Version
40
- version: '13.0'
26
+ version: '13.3'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: raketeer
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -53,33 +39,33 @@ dependencies:
53
39
  - !ruby/object:Gem::Version
54
40
  version: '0.2'
55
41
  - !ruby/object:Gem::Dependency
56
- name: yard_ghurt
42
+ name: irb
57
43
  requirement: !ruby/object:Gem::Requirement
58
44
  requirements:
59
45
  - - "~>"
60
46
  - !ruby/object:Gem::Version
61
- version: '1.2'
47
+ version: '1.15'
62
48
  type: :runtime
63
49
  prerelease: false
64
50
  version_requirements: !ruby/object:Gem::Requirement
65
51
  requirements:
66
52
  - - "~>"
67
53
  - !ruby/object:Gem::Version
68
- version: '1.2'
54
+ version: '1.15'
69
55
  - !ruby/object:Gem::Dependency
70
- name: bundler
56
+ name: yard_ghurt
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
59
  - - "~>"
74
60
  - !ruby/object:Gem::Version
75
- version: '2.2'
76
- type: :development
61
+ version: '1.2'
62
+ type: :runtime
77
63
  prerelease: false
78
64
  version_requirements: !ruby/object:Gem::Requirement
79
65
  requirements:
80
66
  - - "~>"
81
67
  - !ruby/object:Gem::Version
82
- version: '2.2'
68
+ version: '1.2'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: yard
85
71
  requirement: !ruby/object:Gem::Requirement
@@ -87,7 +73,7 @@ dependencies:
87
73
  - - "~>"
88
74
  - !ruby/object:Gem::Version
89
75
  version: '0.9'
90
- type: :development
76
+ type: :runtime
91
77
  prerelease: false
92
78
  version_requirements: !ruby/object:Gem::Requirement
93
79
  requirements:
@@ -126,11 +112,12 @@ homepage: https://github.com/esotericpig/raketary
126
112
  licenses:
127
113
  - LGPL-3.0-or-later
128
114
  metadata:
129
- bug_tracker_uri: https://github.com/esotericpig/raketary/issues
130
- changelog_uri: https://github.com/esotericpig/raketary/blob/master/CHANGELOG.md
115
+ rubygems_mfa_required: 'true'
131
116
  homepage_uri: https://github.com/esotericpig/raketary
117
+ changelog_uri: https://github.com/esotericpig/raketary/blob/main/CHANGELOG.md
132
118
  source_code_uri: https://github.com/esotericpig/raketary
133
- post_install_message: You can now use [raketary] on the command line.
119
+ bug_tracker_uri: https://github.com/esotericpig/raketary/issues
120
+ post_install_message: "=> You can now use `raketary` on the command line."
134
121
  rdoc_options: []
135
122
  require_paths:
136
123
  - lib
@@ -145,8 +132,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
132
  - !ruby/object:Gem::Version
146
133
  version: '0'
147
134
  requirements: []
148
- rubygems_version: 3.2.15
149
- signing_key:
135
+ rubygems_version: 3.5.21
136
+ signing_key:
150
137
  specification_version: 4
151
138
  summary: CLI app for commonly-used Rake tasks.
152
139
  test_files: []