optparse 0.5.0 → 0.6.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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog +5 -271
  3. data/README.md +1 -1
  4. data/lib/optparse.rb +10 -8
  5. metadata +6 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a5a9ef5004e5838005ad874fc163ebd1e6266d3319d08be502a8fb2d6b6b48a2
4
- data.tar.gz: 94fb689cea59f667e4bc4788a6713a50cd829b4e552097994e7b9833f5f35432
3
+ metadata.gz: 7133ed3cb8069a5f9e30dc050bdf3f593c0c6c1cdb438662846922cb36efb6ca
4
+ data.tar.gz: 2f831a85adf7093e20bfb5894a28864475fa0fac996c1076d9746cf2466d3587
5
5
  SHA512:
6
- metadata.gz: 5d0d3a7e51d10a3636e337dfdbe6562ae32e5e4ee18ef61926460f964900f5341f75ae3dd308901e2c1bdf8d5e1c1bd4434d8fe1e2fc77b366bf68690fa9ec85
7
- data.tar.gz: e494246dfe20878a07d79d3489918b9383a2ade4076023a4fd1ec5f973c2f8111066b85fa8e49b69303ff8ff7301adc4ad5c7d3cccde5650ef93afa9b7819030
6
+ metadata.gz: 7696cd28fc5ea95a88bdb9815d67e916787ba891baf526e4c966bbf28c8893ad63c6835967f5907f7ff3b0932e8e07e058cc0028a13a5e8fb6f4433d245026b0
7
+ data.tar.gz: 71b51296c92eaeb0ec443a5d502f81fda00884e6cf8b77c8cfff8e5cbe60d5a27d6b170c3107235028136c0c6953e6ba60d08a2744ea890d96d213ba2e31b5b5
data/ChangeLog CHANGED
@@ -1,275 +1,9 @@
1
1
  -*- coding: utf-8 -*-
2
2
 
3
- commit 979bd76281d28044b3def3eadba233a87e62415a
4
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
5
- AuthorDate: 2024-04-15 18:42:47 +0900
6
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
7
- CommitDate: 2024-04-15 18:42:47 +0900
8
-
9
- [DOC] Split fetching commits and building package
10
-
11
- commit ca883bd3a1ac13957774fcb93e8bccd80b74c9d1
12
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
13
- AuthorDate: 2024-04-15 18:21:31 +0900
14
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
15
- CommitDate: 2024-04-15 18:21:31 +0900
16
-
17
- [DOC] git on Github Actions is old
18
-
19
- It does not support `--unshallow-exclude` option.
20
-
21
- commit 7f79bc820ff0e04a05204ec63c5fc3e9c85e14ad
22
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
23
- AuthorDate: 2024-04-15 18:08:57 +0900
24
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
25
- CommitDate: 2024-04-15 18:08:57 +0900
26
-
27
- [DOC] Fix error when no tag found
28
-
29
- commit add085df63d79d878a8901c42f2cfc3eec56307f
30
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
31
- AuthorDate: 2024-04-15 15:57:09 +0900
32
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
33
- CommitDate: 2024-04-15 15:58:54 +0900
34
-
35
- Fetch upto the previous tag for changelogs
36
-
37
- commit 436a5c516b67f8aec900f2361567c6fc163ade05
38
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
39
- AuthorDate: 2024-04-15 15:08:19 +0900
40
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
41
- CommitDate: 2024-04-15 15:08:19 +0900
42
-
43
- [DOC] Make timestamps in a ISO 8601-like format
44
-
45
- commit 3a2dcd72d1fdabf63218cd13c8c7953cb3c28f6b
46
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
47
- AuthorDate: 2024-04-15 14:55:14 +0900
48
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
49
- CommitDate: 2024-04-15 14:55:14 +0900
50
-
51
- [DOC] Make ChangeLog non-empty
52
-
53
- When the latest version is tagged at the head, there is no commit
54
- between the tag and the head. Make from the previous tag.
55
-
56
- commit b7382c02f1092f2c0ef0f4096d3b8428e2adf3fa
57
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
58
- AuthorDate: 2024-04-15 14:49:59 +0900
59
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
60
- CommitDate: 2024-04-15 14:49:59 +0900
61
-
62
- [DOC] Exclude CI-skipped commits from changelogs
63
-
64
- commit b49cb996afdd68e4eb373ba602c95b52c963d160
65
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
66
- AuthorDate: 2024-04-15 14:24:19 +0900
67
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
68
- CommitDate: 2024-04-15 14:24:19 +0900
69
-
70
- [DOC] Package files for RDoc
71
-
72
- commit f5018a8b1ce82f7ac7458d00d099a454c3c03ea1
73
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
74
- AuthorDate: 2024-04-15 14:05:43 +0900
75
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
76
- CommitDate: 2024-04-15 14:05:43 +0900
77
-
78
- bump up to 0.5.0
79
-
80
- commit ece4bb2673c7fa9f53133ba91bbffd423ebadc90
81
- Author: Koichi Sasada <ko1@atdot.net>
82
- AuthorDate: 2024-03-27 07:29:38 +0900
83
- Commit: Koichi Sasada <ko1@atdot.net>
84
- CommitDate: 2024-04-15 12:08:07 +0900
85
-
86
- show warning for unused block
87
-
88
- With verbopse mode (-w), the interpreter shows a warning if
89
- a block is passed to a method which does not use the given block.
90
-
91
- Warning on:
92
-
93
- * the invoked method is not written in C
94
- * the invoked method is not `initialize`
95
- * not invoked with `super`
96
- * the first time on the call-site with the invoked method
97
- (`obj.foo{}` will be warned once if `foo` is same method)
98
-
99
- [Feature #15554]
100
-
101
- `Primitive.attr! :use_block` is introduced to declare that primitive
102
- functions (written in C) will use passed block.
103
-
104
- For minitest, test needs some tweak, so use
105
- https://github.com/minitest/minitest/commit/ea9caafc0754b1d6236a490d59e624b53209734a
106
- for `test-bundled-gems`.
107
-
108
- ruby/ruby@9180e33ca3a5886fec3f9e0a2f48072b55914e65
109
-
110
- commit 77dccce37cb9fd1b8fbc52160d4103d1c4579669
111
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
112
- AuthorDate: 2024-03-01 01:24:05 +0900
113
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
114
- CommitDate: 2024-03-01 01:24:05 +0900
115
-
116
- Invoke pager for `--help`
117
-
118
- commit 59b9fd7ddca3e795c235aa397655b51de2e4c949
119
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
120
- AuthorDate: 2024-02-23 21:49:57 +0900
121
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
122
- CommitDate: 2024-02-23 21:49:57 +0900
123
-
124
- [DOC] About return value of OptionParser#new
125
-
126
- commit 07e83673a8e99b5b7985608a69f713abde3344f6
127
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
128
- AuthorDate: 2024-02-21 13:42:11 +0900
129
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
130
- CommitDate: 2024-02-23 21:13:51 +0900
131
-
132
- Add `exact:` keyword argument
133
-
134
- commit bbec64d0c7f198429b62468b64b27692efa18dc2
135
- Author: Yusuke Endoh <mame@ruby-lang.org>
136
- AuthorDate: 2024-01-19 16:03:38 +0900
3
+ commit 080360ffd4578aceb9f711eef8f16ee520cd3f00
4
+ Author: Hiroshi SHIBATA <hsbt@ruby-lang.org>
5
+ AuthorDate: 2024-11-08 13:22:26 +0900
137
6
  Commit: Hiroshi SHIBATA <hsbt@ruby-lang.org>
138
- CommitDate: 2024-02-16 10:47:36 +0900
139
-
140
- Do not include a backtick in error messages and backtraces
141
-
142
- [Feature #16495]
143
-
144
- commit 451dea51a0e5d062fb4cb75b1073a2c2b8609bef
145
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
146
- AuthorDate: 2024-02-12 01:30:58 +0900
147
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
148
- CommitDate: 2024-02-12 01:30:58 +0900
149
-
150
- [DOC] Add description of OptionParser#define_by_keywords
151
-
152
- commit 33956ce93f56320978cedfcebb8b6cf18bf96c53
153
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
154
- AuthorDate: 2024-02-12 01:07:05 +0900
155
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
156
- CommitDate: 2024-02-12 01:07:05 +0900
157
-
158
- [DOC] Add missing documents
159
-
160
- commit 78afdab30751e1b7cf80bb57d6696b10879f90fe
161
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
162
- AuthorDate: 2024-02-10 22:56:32 +0900
163
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
164
- CommitDate: 2024-02-10 22:56:32 +0900
165
-
166
- Search exactly when `require_exact`
167
-
168
- To work with options defined as `--[no]-something`.
169
-
170
- Fix https://bugs.ruby-lang.org/issues/20252
171
- Fix #60
172
-
173
- commit 213cb03b5978ddacfbcc8f71ec837d9a6fd4c56d
174
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
175
- AuthorDate: 2024-02-09 19:03:20 +0900
176
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
177
- CommitDate: 2024-02-09 19:03:20 +0900
178
-
179
- Adjust arguments for lambda-callbacks
180
-
181
- Rake uses [lambda] as callbacks.
182
- Calling it without omitted argument raises an `ArgumentError`.
183
-
184
- lambda: https://github.com/ruby/rake/blob/master/lib/rake/application.rb#L543
185
-
186
- commit 9d53e74aa4421e0c4e2a805a0074ece5aae3773f
187
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
188
- AuthorDate: 2024-02-09 12:59:43 +0900
189
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
190
- CommitDate: 2024-02-09 12:59:43 +0900
191
-
192
- Respect default values in block parameters
193
-
194
- Fix #55
195
-
196
- commit 4e346ad337f400dbff855798e859f17455698c2a
197
- Author: fatkodima <fatkodima123@gmail.com>
198
- AuthorDate: 2023-10-14 21:52:01 +0300
199
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
200
- CommitDate: 2024-02-09 12:31:08 +0900
201
-
202
- Fix `require_exact` to work with options defined as `--[no]-something`
203
-
204
- commit b14c2c644d18cce226e49ccde8a23b5b991ea8cf
205
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
206
- AuthorDate: 2024-02-09 12:17:31 +0900
207
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
208
- CommitDate: 2024-02-09 12:17:31 +0900
209
-
210
- Escape backslashes
211
-
212
- commit 434e92fc62ff9571124335a2eedff56df83dae48
213
- Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
214
- AuthorDate: 2023-12-18 03:43:27 +0000
215
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
216
- CommitDate: 2024-02-09 12:14:30 +0900
217
-
218
- Bump actions/upload-artifact from 3 to 4
219
-
220
- Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
221
- - [Release notes](https://github.com/actions/upload-artifact/releases)
222
- - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)
223
-
224
- ---
225
- updated-dependencies:
226
- - dependency-name: actions/upload-artifact
227
- dependency-type: direct:production
228
- update-type: version-update:semver-major
229
- ...
230
-
231
- Signed-off-by: dependabot[bot] <support@github.com>
232
-
233
- commit 48385d3eaf37cd10140274453eeadc4496581fc2
234
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
235
- AuthorDate: 2024-02-09 12:01:44 +0900
236
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
237
- CommitDate: 2024-02-09 12:06:40 +0900
238
-
239
- Create codeql.yml
240
-
241
- commit 294c6e1ed4b170a8a34ab95c84453829c170223c
242
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
243
- AuthorDate: 2023-12-25 15:08:05 +0900
244
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
245
- CommitDate: 2023-12-25 15:08:05 +0900
246
-
247
- Build packages only on the latest release
248
-
249
- commit 324ff21f042769444cde41949fc0321f6c6ccf63
250
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
251
- AuthorDate: 2023-12-18 12:45:44 +0900
252
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
253
- CommitDate: 2023-12-18 12:45:44 +0900
254
-
255
- [DOC] Add missing documents
256
-
257
- commit 667ab35f593f81b7850009385453d20ca8023bba
258
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
259
- AuthorDate: 2023-12-18 12:24:46 +0900
260
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
261
- CommitDate: 2023-12-18 12:24:46 +0900
262
-
263
- [DOC] Add missing secition
264
-
265
- Fixes #51
266
-
267
- commit 1c895efc39ed2290c185dcb80523fee381dfe74e
268
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
269
- AuthorDate: 2023-12-18 12:15:31 +0900
270
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
271
- CommitDate: 2023-12-18 12:15:31 +0900
272
-
273
- [DOC] Fix tutorial link
7
+ CommitDate: 2024-11-08 13:22:26 +0900
274
8
 
275
- Fixes #51
9
+ Bump up v0.6.0
data/README.md CHANGED
@@ -50,7 +50,7 @@ p ARGV
50
50
 
51
51
  ## Development
52
52
 
53
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
53
+ After checking out the repo, run `bundle install` to install dependencies. Then, run `rake test` to run the tests.
54
54
 
55
55
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
56
56
 
data/lib/optparse.rb CHANGED
@@ -425,7 +425,7 @@
425
425
  #
426
426
  class OptionParser
427
427
  # The version string
428
- OptionParser::Version = "0.5.0"
428
+ OptionParser::Version = "0.6.0"
429
429
 
430
430
  # :stopdoc:
431
431
  NoArgument = [NO_ARGUMENT = :NONE, nil].freeze
@@ -1115,7 +1115,7 @@ XXX
1115
1115
  Switch::OptionalArgument.new do |pkg|
1116
1116
  if pkg
1117
1117
  begin
1118
- require 'optparse/version'
1118
+ require_relative 'optparse/version'
1119
1119
  rescue LoadError
1120
1120
  else
1121
1121
  show_version(*pkg.split(/,/)) or
@@ -1729,9 +1729,9 @@ XXX
1729
1729
  end
1730
1730
  end
1731
1731
  begin
1732
- opt, cb, *val = sw.parse(rest, argv) {|*exc| raise(*exc)}
1733
- val = callback!(cb, 1, *val) if cb
1734
- callback!(setter, 2, sw.switch_name, *val) if setter
1732
+ opt, cb, val = sw.parse(rest, argv) {|*exc| raise(*exc)}
1733
+ val = callback!(cb, 1, val) if cb
1734
+ callback!(setter, 2, sw.switch_name, val) if setter
1735
1735
  rescue ParseError
1736
1736
  raise $!.set_option(arg, rest)
1737
1737
  end
@@ -1761,7 +1761,7 @@ XXX
1761
1761
  raise $!.set_option(arg, true)
1762
1762
  end
1763
1763
  begin
1764
- opt, cb, *val = sw.parse(val, argv) {|*exc| raise(*exc) if eq}
1764
+ opt, cb, val = sw.parse(val, argv) {|*exc| raise(*exc) if eq}
1765
1765
  rescue ParseError
1766
1766
  raise $!.set_option(arg, arg.length > 2)
1767
1767
  else
@@ -1769,8 +1769,8 @@ XXX
1769
1769
  end
1770
1770
  begin
1771
1771
  argv.unshift(opt) if opt and (!rest or (opt = opt.sub(/\A-*/, '-')) != '-')
1772
- val = callback!(cb, 1, *val) if cb
1773
- callback!(setter, 2, sw.switch_name, *val) if setter
1772
+ val = callback!(cb, 1, val) if cb
1773
+ callback!(setter, 2, sw.switch_name, val) if setter
1774
1774
  rescue ParseError
1775
1775
  raise $!.set_option(arg, arg.length > 2)
1776
1776
  end
@@ -1798,6 +1798,8 @@ XXX
1798
1798
 
1799
1799
  # Calls callback with _val_.
1800
1800
  def callback!(cb, max_arity, *args) # :nodoc:
1801
+ args.compact!
1802
+
1801
1803
  if (size = args.size) < max_arity and cb.to_proc.lambda?
1802
1804
  (arity = cb.arity) < 0 and arity = (1-arity)
1803
1805
  arity = max_arity if arity > max_arity
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: optparse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nobu Nakada
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-15 00:00:00.000000000 Z
11
+ date: 2024-11-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: OptionParser is a class for command-line option analysis.
14
14
  email:
@@ -101,7 +101,7 @@ licenses:
101
101
  metadata:
102
102
  homepage_uri: https://github.com/ruby/optparse
103
103
  source_code_uri: https://github.com/ruby/optparse
104
- post_install_message:
104
+ post_install_message:
105
105
  rdoc_options:
106
106
  - "--main=README.md"
107
107
  - "--op=rdoc"
@@ -119,8 +119,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  - !ruby/object:Gem::Version
120
120
  version: '0'
121
121
  requirements: []
122
- rubygems_version: 3.5.3
123
- signing_key:
122
+ rubygems_version: 3.5.11
123
+ signing_key:
124
124
  specification_version: 4
125
125
  summary: OptionParser is a class for command-line option analysis.
126
126
  test_files: []