command_line_boss 0.1.0 → 0.2.0

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: 373be7eee0c1d18087389f4974b750d91f619a3148532a820b642a96a93d554f
4
- data.tar.gz: a77b6ed4529989587eac6b0e46f293a509691366b6741cd776ddde85e605674b
3
+ metadata.gz: c18c2eeeebeba00361af947c2349049dcdb7d861358189e4b44be3f257a29d02
4
+ data.tar.gz: a52b032947e2aed16266af4374101236df602f9e2422d2aec2522a2dcee22d6f
5
5
  SHA512:
6
- metadata.gz: daa1c02db1176dc01fa4aa447a82cf5b0b54e65434d88e28777686bf78b0451c50ccf0c58549618b1590c11b9741d16eca6efb19dc5cde9e54e64525d5229be5
7
- data.tar.gz: bd779c0e865f70485e193bbe05c0a6d55095959227f88c958f971f63d2eb3754013570bc9daef2ff249bf62ba919da4d0e66ec14a2436cf32349a147e633fb08
6
+ metadata.gz: 0e57a7351d88aeac40f243fc3f7c595345562afca8a0a43ac989e8b166bed5113a6f38560a8267ee80941ec3a450395a3e0ebf8f30ab2534e7a7d4053fca1c2f
7
+ data.tar.gz: 3d4173cc96ce04aec95367795c36e2a3949e6ef2e542bb17f130c18d5912bfdd4ba5666a1a6ff5a77556a1d23077dbabd97546fd0856d69dcf953cfb078bd83f
data/.commitlintrc.yml ADDED
@@ -0,0 +1,16 @@
1
+ ---
2
+ extends: '@commitlint/config-conventional'
3
+
4
+ rules:
5
+ # See: https://commitlint.js.org/reference/rules.html
6
+ #
7
+ # Rules are made up by a name and a configuration array. The configuration array contains:
8
+ #
9
+ # * Severity [0..2]: 0 disable rule, 1 warning if violated, or 2 error if violated
10
+ # * Applicability [always|never]: never inverts the rule
11
+ # * Value: value to use for this rule
12
+ #
13
+ # Run `npx commitlint --print-config` to see the current setting for all rules.
14
+ #
15
+ body-leading-blank: [2, 'always']
16
+ footer-leading-blank: [2, 'always']
data/.husky/commit-msg ADDED
@@ -0,0 +1 @@
1
+ npx --no-install commitlint --edit "$1"
data/.markdownlint.yml ADDED
@@ -0,0 +1,25 @@
1
+ default: true
2
+
3
+ # Unordered list indentation
4
+ MD007: { indent: 2 }
5
+
6
+ # Line length
7
+ MD013: { line_length: 90, tables: false, code_blocks: false }
8
+
9
+ # Heading duplication is allowed for non-sibling headings
10
+ MD024: { siblings_only: true }
11
+
12
+ # Do not allow the specified trailing punctuation in a header
13
+ MD026: { punctuation: '.,;:' }
14
+
15
+ # Order list items must have a prefix that increases in numerical order
16
+ MD029: { style: 'ordered' }
17
+
18
+ # Lists do not need to be surrounded by blank lines
19
+ MD032: false
20
+
21
+ # Allow raw HTML in Markdown
22
+ MD033: false
23
+
24
+ # Allow emphasis to be used instead of a heading
25
+ MD036: false
data/.rubocop.yml CHANGED
@@ -1,34 +1,7 @@
1
- AllCops:
2
- NewCops: enable
3
- SuggestExtensions: false
4
- DefaultFormatter: fuubar
5
-
6
- # Output extra information for each offense to make it easier to diagnose:
7
- DisplayCopNames: true
8
- DisplayStyleGuide: true
9
- ExtraDetails: true
1
+ inherit_gem:
2
+ main_branch_shared_rubocop_config: config/rubocop.yml
10
3
 
11
- # RuboCop enforces rules depending on the oldest version of Ruby which
12
- # your project supports:
4
+ AllCops:
5
+ # Pin this project to Ruby 3.1 in case the shared config above is upgraded to 3.2
6
+ # or later.
13
7
  TargetRubyVersion: 3.1
14
-
15
- Gemspec/DevelopmentDependencies:
16
- Enabled: false
17
-
18
- Layout/LineLength:
19
- Max: 120
20
-
21
- # The DSL for RSpec and the gemspec file make it very hard to limit block length
22
- Metrics/BlockLength:
23
- Exclude:
24
- - '**/*_spec.rb'
25
- - '*.gemspec'
26
-
27
- Metrics/ModuleLength:
28
- CountAsOne: ['hash']
29
-
30
- Metrics/ClassLength:
31
- CountAsOne: ['hash']
32
-
33
- Style/AsciiComments:
34
- Enabled: false
data/.yardopts CHANGED
@@ -1 +1,8 @@
1
- --exclude examples/**
1
+ --no-private
2
+ --hide-void-return
3
+ --markup-provider=redcarpet
4
+ --markup markdown
5
+ - CHANGELOG.md
6
+ - CONTRIBUTING.md
7
+ - RELEASING.md
8
+ - LICENSE.txt
data/CHANGELOG.md CHANGED
@@ -5,6 +5,28 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## v0.2.0 (2024-10-10)
9
+
10
+ [Full Changelog](https://github.com/main-branch/command_line_boss/compare/v0.1.0..v0.2.0)
11
+
12
+ Changes since v0.1.0:
13
+
14
+ * 4a6ace7 build: remove semver pr label check
15
+ * 05918a3 build: enforce conventional commit message formatting
16
+ * e5f91d1 Clarify purpose of the gem in the README
17
+ * ca16af0 Fix TargetRubyVersion Comment
18
+ * 30eef5d Use shared Rubocop config
19
+ * bbe9fe2 Update links in gemspec
20
+ * c167adc Add Slack badge for this project in README
21
+ * c442a80 Update yardopts with new standard options
22
+ * f9be39f Standardize YARD and Markdown Lint configurations
23
+ * bc7b9ae Update CODEOWNERS file
24
+ * 3879f0a Set JRuby —debug option when running tests in GitHub Actions workflows
25
+ * af10f27 Integrate simplecov-rspec into the project
26
+ * 22b1364 Update continuous integration and experimental ruby builds
27
+ * 2e2fa87 Enforce the use of semver tags on PRs
28
+ * 4464e2c Fix CHANGELOG.md
29
+
8
30
  ## v0.1.0 (2024-07-03)
9
31
 
10
32
  [Full Changelog](https://github.com/main-branch/command_line_boss/compare/6cafbd0..v0.1.0)
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # CommandLineBoss
1
+ # The `command_line_boss` gem
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/command_line_boss.svg)](https://badge.fury.io/rb/command_line_boss)
4
4
  [![Documentation](https://img.shields.io/badge/Documentation-Latest-green)](https://rubydoc.info/gems/command_line_boss/)
@@ -6,14 +6,21 @@
6
6
  [![Build Status](https://github.com/main-branch/command_line_boss/actions/workflows/continuous_integration.yml/badge.svg)](https://github.com/main-branch/command_line_boss/actions/workflows/continuous_integration.yml)
7
7
  [![Maintainability](https://api.codeclimate.com/v1/badges/513b4d8d95a5e3a77ec6/maintainability)](https://codeclimate.com/github/main-branch/command_line_boss/maintainability)
8
8
  [![Test Coverage](https://api.codeclimate.com/v1/badges/513b4d8d95a5e3a77ec6/test_coverage)](https://codeclimate.com/github/main-branch/command_line_boss/test_coverage)
9
+ [![Conventional
10
+ Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)
11
+ [![Slack](https://img.shields.io/badge/slack-main--branch/command__line__boss-yellow.svg?logo=slack)](https://main-branch.slack.com/archives/C07MQC0LNKF)
9
12
 
10
- CommandLineBoss is built on top of `OptionParser` to make more complex uses of OptionParser easier to manage and test.
13
+ `command_line_boss` makes it easy to build, test, and maintain complex command line
14
+ interfaces. It is built on top of Ruby's `OptionParser` class and works best for
15
+ traditional options-based command-line interfaces that you would build with
16
+ `OptionParser`.
11
17
 
12
- You are expected to already know how to define options with `OptionParser` in order to use this gem.
18
+ To use `command_line_boss` you are expected to already know how to define options
19
+ with `OptionParser`.
13
20
 
14
- This gem should be used for traditional options-based command-line interfaces that you would build with `OptionParser`.
15
-
16
- For defining complex command-line interfaces with multiple commands and subcommands (aka a git-like interface), we recommend using a gem like thor. Other good alternatives also exist.
21
+ For defining command-line interfaces with multiple commands and subcommands (aka a
22
+ git-like interface), we recommend using a gem like [thor](http://whatisthor.com).
23
+ Other good alternatives also exist.
17
24
 
18
25
  * [Installation](#installation)
19
26
  * [Usage](#usage)
@@ -22,23 +29,36 @@ For defining complex command-line interfaces with multiple commands and subcomma
22
29
  * [Start your command line parser class](#start-your-command-line-parser-class)
23
30
  * [Define options](#define-options)
24
31
  * [Define additional validations](#define-additional-validations)
25
- * [Process with any remaining non-option arguments](#process-with-any-remaining-non-option-arguments)
32
+ * [Process any remaining non-option arguments](#process-any-remaining-non-option-arguments)
26
33
  * [Optional: define help output](#optional-define-help-output)
27
34
  * [Use the parser](#use-the-parser)
28
35
  * [Run the command line](#run-the-command-line)
29
36
  * [Development](#development)
30
37
  * [Contributing](#contributing)
38
+ * [Commit message guidelines](#commit-message-guidelines)
39
+ * [Pull request guidelines](#pull-request-guidelines)
31
40
  * [License](#license)
32
41
  * [Code of Conduct](#code-of-conduct)
33
42
 
34
43
  ## Installation
35
44
 
36
- Install the gem and add to the application's Gemfile by executing:
45
+ To install this gem, add to the following line to your application's gemspec OR
46
+ Gemfile:
37
47
 
38
- ```shell
39
- bundle add command_line_boss
48
+ gemspec:
49
+
50
+ ```ruby
51
+ spec.add_development_dependency "command_line_boss", '~> 0.1'
52
+ ```
53
+
54
+ Gemfile:
55
+
56
+ ```ruby
57
+ gem "command_line_boss", "~> 0.1", groups: [:development, :test]
40
58
  ```
41
59
 
60
+ and then run `bundle install`.
61
+
42
62
  If bundler is not being used to manage dependencies, install the gem by executing:
43
63
 
44
64
  ```shell
@@ -75,10 +95,11 @@ Make sure you have the `command_line_boss` gem installed.
75
95
 
76
96
  ### Design your command line
77
97
 
78
- Design the command line following the
79
- [Google developer documentation style guide for command line syntax](https://developers.google.com/style/code-syntax).
98
+ Design the command line following the [Google developer documentation style guide for
99
+ command line syntax](https://developers.google.com/style/code-syntax).
80
100
 
81
- Here is what a simple example might look like that creates a spreadsheet with named sheets:
101
+ Here is what a simple example might look like that creates a spreadsheet with named
102
+ sheets:
82
103
 
83
104
  ```Text
84
105
  Usage:
@@ -165,7 +186,7 @@ class CreateSpreadsheetCli < CommandLineBoss
165
186
  end
166
187
  ```
167
188
 
168
- ### Process with any remaining non-option arguments
189
+ ### Process any remaining non-option arguments
169
190
 
170
191
  Implement `parse_arguments` to deal the remaining non-option arguments from the
171
192
  command line. Within this method, the `args` method returns the remaining
@@ -323,18 +344,52 @@ $
323
344
 
324
345
  ## Development
325
346
 
326
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
347
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake
348
+ spec` to run the tests. You can also run `bin/console` for an interactive prompt that
349
+ will allow you to experiment.
327
350
 
328
351
  To install this gem onto your local machine, run `bundle exec rake install`.
329
352
 
330
353
  ## Contributing
331
354
 
332
- Bug reports and pull requests are welcome on GitHub at https://github.com/main_branch/command_line_boss. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/main_branch/command_line_boss/blob/main/CODE_OF_CONDUCT.md).
355
+ Bug reports and pull requests are welcome on GitHub at
356
+ https://github.com/main_branch/command_line_boss. This project is intended to be a
357
+ safe, welcoming space for collaboration, and contributors are expected to adhere to
358
+ the [code of
359
+ conduct](https://github.com/main_branch/command_line_boss/blob/main/CODE_OF_CONDUCT.md).
360
+
361
+ ### Commit message guidelines
362
+
363
+ All commit messages must follow the [Conventional Commits
364
+ standard](https://www.conventionalcommits.org/en/v1.0.0/). This helps us maintain a
365
+ clear and structured commit history, automate versioning, and generate changelogs
366
+ effectively.
367
+
368
+ To ensure compliance, this project includes:
369
+
370
+ * A git commit-msg hook that validates your commit messages before they are accepted.
371
+
372
+ To activate the hook, you must have node installed and run `npm install`.
373
+
374
+ * A GitHub Actions workflow that will enforce the Conventional Commit standard as
375
+ part of the continuous integration pipeline.
376
+
377
+ Any commit message that does not conform to the Conventional Commits standard will
378
+ cause the workflow to fail and not allow the PR to be merged.
379
+
380
+ ### Pull request guidelines
381
+
382
+ All pull requests must be merged using rebase merges. This ensures that commit
383
+ messages from the feature branch are preserved in the release branch, keeping the
384
+ history clean and meaningful.
333
385
 
334
386
  ## License
335
387
 
336
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
388
+ The gem is available as open source under the terms of the [MIT
389
+ License](https://opensource.org/licenses/MIT).
337
390
 
338
391
  ## Code of Conduct
339
392
 
340
- Everyone interacting in the CommandLineBoss project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/command_line_boss/blob/main/CODE_OF_CONDUCT.md).
393
+ Everyone interacting in the CommandLineBoss project's codebases, issue trackers, chat
394
+ rooms and mailing lists is expected to follow the [code of
395
+ conduct](https://github.com/[USERNAME]/command_line_boss/blob/main/CODE_OF_CONDUCT.md).
data/Rakefile CHANGED
@@ -44,16 +44,9 @@ CLEAN << 'rspec-report.xml'
44
44
 
45
45
  require 'rubocop/rake_task'
46
46
 
47
- RuboCop::RakeTask.new do |t|
48
- t.options = %w[
49
- --format fuubar
50
- --format json --out rubocop-report.json
51
- --display-cop-names
52
- --config .rubocop.yml
53
- ]
54
- end
47
+ RuboCop::RakeTask.new
55
48
 
56
- CLEAN << 'rubocop-report.json'
49
+ # YARD
57
50
 
58
51
  unless RUBY_PLATFORM == 'java'
59
52
  # yard:build
@@ -38,13 +38,4 @@ CLOBBER << 'Gemfile.lock'
38
38
 
39
39
  require 'rubocop/rake_task'
40
40
 
41
- RuboCop::RakeTask.new do |t|
42
- t.options = %w[
43
- --format fuubar
44
- --format json --out rubocop-report.json
45
- --display-cop-names
46
- --config .rubocop.yml
47
- ]
48
- end
49
-
50
- CLEAN << 'rubocop-report.json'
41
+ RuboCop::RakeTask.new
@@ -2,5 +2,5 @@
2
2
 
3
3
  class CommandLineBoss
4
4
  # Gem version
5
- VERSION = '0.1.0'
5
+ VERSION = '0.2.0'
6
6
  end
data/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "devDependencies": {
3
+ "@commitlint/cli": "^19.5.0",
4
+ "@commitlint/config-conventional": "^19.5.0",
5
+ "husky": "^9.1.0"
6
+ },
7
+ "scripts": {
8
+ "postinstall": "husky",
9
+ "prepare": "husky"
10
+ }
11
+ }
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: command_line_boss
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Couball
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-03 00:00:00.000000000 Z
11
+ date: 2024-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: logger
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.6'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: bundler-audit
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -30,14 +44,14 @@ dependencies:
30
44
  requirements:
31
45
  - - "~>"
32
46
  - !ruby/object:Gem::Version
33
- version: '1.4'
47
+ version: '2.1'
34
48
  type: :development
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
52
  - - "~>"
39
53
  - !ruby/object:Gem::Version
40
- version: '1.4'
54
+ version: '2.1'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: csv
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +80,20 @@ dependencies:
66
80
  - - "~>"
67
81
  - !ruby/object:Gem::Version
68
82
  version: '2.5'
83
+ - !ruby/object:Gem::Dependency
84
+ name: main_branch_shared_rubocop_config
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '0.1'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '0.1'
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: rake
71
99
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +128,14 @@ dependencies:
100
128
  requirements:
101
129
  - - "~>"
102
130
  - !ruby/object:Gem::Version
103
- version: '1.64'
131
+ version: '1.66'
104
132
  type: :development
105
133
  prerelease: false
106
134
  version_requirements: !ruby/object:Gem::Requirement
107
135
  requirements:
108
136
  - - "~>"
109
137
  - !ruby/object:Gem::Version
110
- version: '1.64'
138
+ version: '1.66'
111
139
  - !ruby/object:Gem::Dependency
112
140
  name: simplecov
113
141
  requirement: !ruby/object:Gem::Requirement
@@ -136,6 +164,20 @@ dependencies:
136
164
  - - "~>"
137
165
  - !ruby/object:Gem::Version
138
166
  version: '0.8'
167
+ - !ruby/object:Gem::Dependency
168
+ name: simplecov-rspec
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '0.3'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '0.3'
139
181
  - !ruby/object:Gem::Dependency
140
182
  name: turnip
141
183
  requirement: !ruby/object:Gem::Requirement
@@ -208,6 +250,9 @@ executables: []
208
250
  extensions: []
209
251
  extra_rdoc_files: []
210
252
  files:
253
+ - ".commitlintrc.yml"
254
+ - ".husky/commit-msg"
255
+ - ".markdownlint.yml"
211
256
  - ".rspec"
212
257
  - ".rubocop.yml"
213
258
  - ".yardopts"
@@ -234,6 +279,7 @@ files:
234
279
  - lib/command_line_boss/help_option.rb
235
280
  - lib/command_line_boss/logger_options.rb
236
281
  - lib/command_line_boss/version.rb
282
+ - package.json
237
283
  homepage: https://github.com/main-branch/command_line_boss
238
284
  licenses:
239
285
  - MIT
@@ -241,8 +287,8 @@ metadata:
241
287
  allowed_push_host: https://rubygems.org
242
288
  homepage_uri: https://github.com/main-branch/command_line_boss
243
289
  source_code_uri: https://github.com/main-branch/command_line_boss
244
- changelog_uri: https://rubydoc.info/gems/command_line_boss/0.1.0/file/CHANGELOG.md
245
- documentation_uri: https://rubydoc.info/gems/command_line_boss/0.1.0
290
+ documentation_uri: https://rubydoc.info/gems/command_line_boss/0.2.0
291
+ changelog_uri: https://rubydoc.info/gems/command_line_boss/0.2.0/file/CHANGELOG.md
246
292
  rubygems_mfa_required: 'true'
247
293
  post_install_message:
248
294
  rdoc_options: []
@@ -258,8 +304,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
258
304
  - - ">="
259
305
  - !ruby/object:Gem::Version
260
306
  version: '0'
261
- requirements: []
262
- rubygems_version: 3.5.11
307
+ requirements:
308
+ - 'Platform: Mac, Linux, or Windows'
309
+ - 'Ruby: MRI 3.1 or later, TruffleRuby 24 or later, or JRuby 9.4 or later'
310
+ rubygems_version: 3.5.16
263
311
  signing_key:
264
312
  specification_version: 4
265
313
  summary: Command Line Boss is a convenience layer over OptionsParser