optparse 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog +13 -265
  3. data/lib/optparse.rb +17 -4
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 418e5857a7b44f43280185c3b47044dfeeae912cdfbb1732e1d449959d2f7ea6
4
- data.tar.gz: 7bc504678e83873db67b7a70cbf70a9795e6d5c8910ad7829ecc0f161eb09e91
3
+ metadata.gz: 3726480fe0a25a9efd1cec645f993256cda45ac050411f046dfb6fa35117414a
4
+ data.tar.gz: ace5491689e1e277cd9b0a37b7ff070be46e46b6cb1b3b21f19c02d4d2d792a1
5
5
  SHA512:
6
- metadata.gz: 5145d4416caf4eb5a64cf415548d56ae7b533089d29b83bd16876fdbde1c644f4b260e1aa3a68010d92107e065f9197c2e0e8691997d80261c5542bbc95ff6ef
7
- data.tar.gz: 37cb54b326baa9239ed1366ff2ad465352b8de03a32360f2a4d49e9214a1d6bb01916ebff354787ec378b7d7deb50b2444a1e45eac215fa335b21156ba594818
6
+ metadata.gz: af882a7ff3c55fc882fbbc1259d104a55dd15049b64b3022459e868c4a00ba989ac651b5f7c16a260a97c8f4992b07adc3b03ca23ad231adf46cae62be6ae8b6
7
+ data.tar.gz: 42d6f1e638d8fdbb43953e0ecda55a00b9460d375a1cb8175bd14dcdbbc2fd94996fae031b0b7f31881d73dc6fa2815c75d146fc2fedc2ea9551797118be22e5
data/ChangeLog CHANGED
@@ -1,277 +1,25 @@
1
1
  -*- coding: utf-8 -*-
2
2
 
3
- commit c80dfb1ebd9e92142de4a0719f7fb91d753c35e5
3
+ commit 2a1e157ae134b07b8412182502755ec4eb3af499
4
4
  Author: Hiroshi SHIBATA <hsbt@ruby-lang.org>
5
- AuthorDate: 2022-12-05 16:17:01 +0900
5
+ AuthorDate: 2022-12-22 17:47:34 +0900
6
6
  Commit: Hiroshi SHIBATA <hsbt@ruby-lang.org>
7
- CommitDate: 2022-12-05 16:17:01 +0900
7
+ CommitDate: 2022-12-22 17:47:34 +0900
8
8
 
9
- Bump version to 0.3.0
9
+ Bump version to 0.3.1
10
10
 
11
- commit fee86ef7a443e602e951ac67143a890a22e8aa3a
12
- Author: Yusuke Endoh <mame@ruby-lang.org>
13
- AuthorDate: 2022-11-29 01:14:47 +0900
14
- Commit: Yusuke Endoh <mame@ruby-lang.org>
15
- CommitDate: 2022-11-29 01:14:47 +0900
16
-
17
- Fix the test failure i ruby/ruby
18
-
19
- ```
20
- $ make test-all TESTS=test/optparse/
21
- ...
22
-
23
- [148/178] TestOptionParserDidYouMean#test_raise_unknown = 0.00 s
24
- 1) Failure:
25
- TestOptionParserDidYouMean#test_raise_unknown [/home/mame/work/ruby/test/optparse/test_optparse.rb:106]:
26
- <["--bar"]> expected but was
27
- <[]>.
28
- ```
29
-
30
- In the old test/unit (bundled in ruby/ruby), when a test class inherits from
31
- another test class, the child class runs all the tests defined in the parent
32
- class.
33
- However, it looks like the new test/unit does not do so. This is because the
34
- test failure does not occur in ruby/optparse.
35
-
36
- As a tentative solution, this changes the option names in TestOptionParser to
37
- avoid the name conflict with TestOptionParserDidYouMean.
38
-
39
- commit 12529653cd35ed38cb0a00d22ec0fe6e0907ce89
40
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
41
- AuthorDate: 2022-10-30 00:36:19 +0900
42
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
43
- CommitDate: 2022-11-28 23:23:54 +0900
44
-
45
- Add `raise_unknown` flag (#38)
46
-
47
- commit ab5073e4d8928814a1e667bb93164d6998bf2558
48
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
49
- AuthorDate: 2022-11-21 18:28:33 +0900
50
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
51
- CommitDate: 2022-11-21 18:30:01 +0900
52
-
53
- Use class methods of `File` over `IO`
54
-
55
- commit 51f7e060ee6e2ccab6b052e7fb14532bc3485ce2
11
+ commit 766f567405a362d0e018d8411df15ce8d70573a6
56
12
  Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
57
- AuthorDate: 2022-10-29 22:25:42 +0900
58
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
59
- CommitDate: 2022-10-29 22:46:59 +0900
60
-
61
- Add tests for `load(into:)`
62
-
63
- commit 2ea626fcff72b68b5ae6e1381c28f5db94de7e94
64
- Author: Whyme Lyu <5longluna@gmail.com>
65
- AuthorDate: 2022-10-29 21:46:23 +0800
66
- Commit: GitHub <noreply@github.com>
67
- CommitDate: 2022-10-29 22:46:23 +0900
68
-
69
- #load() into hash (#42)
70
-
71
- OptionParser#load learns .load(into: Hash)
72
-
73
- Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
74
-
75
- commit fb34a1d3a36aa33a5d2a02d511fbd705887505b0
76
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
77
- AuthorDate: 2022-10-29 22:23:14 +0900
78
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
79
- CommitDate: 2022-10-29 22:40:11 +0900
80
-
81
- Add tests for `OptionParser#load`
82
-
83
- commit 078638ee6da875680ebcfd06efa50bb573fd1af2
84
- Author: Maciek Rząsa <maciejrzasa@gmail.com>
85
- AuthorDate: 2022-10-08 12:30:12 +0200
13
+ AuthorDate: 2022-12-21 14:07:54 +0900
86
14
  Commit: GitHub <noreply@github.com>
87
- CommitDate: 2022-10-08 19:30:12 +0900
15
+ CommitDate: 2022-12-21 14:07:54 +0900
88
16
 
89
- Don't treat empty string as an option description
17
+ The encoding argument of `Regexp.new` has been ignored since 1.9
90
18
 
91
- commit 3bcca8a81574aaef19a6ba09f91fc1e318aadfa4
92
- Author: Hiroshi SHIBATA <hsbt@ruby-lang.org>
93
- AuthorDate: 2022-06-17 18:35:47 +0900
94
- Commit: Hiroshi SHIBATA <hsbt@ruby-lang.org>
95
- CommitDate: 2022-06-17 18:41:16 +0900
96
-
97
- Update Ruby versions on GHA with ci_versions/all.json
98
-
99
- commit f2b8318631d3d265131a0b281ee730025eda9027
100
- Author: konsolebox <konsolebox@gmail.com>
101
- AuthorDate: 2022-06-09 19:43:24 +0800
102
- Commit: GitHub <noreply@github.com>
103
- CommitDate: 2022-06-09 20:43:24 +0900
104
-
105
- Also accept '-' as an optional argument (#35)
106
-
107
- commit e70e689deddb6c1d72e2073a5c4723b3fdfff68c
108
- Author: ydah <13041216+ydah@users.noreply.github.com>
109
- AuthorDate: 2022-05-21 06:24:41 +0900
110
- Commit: Hiroshi SHIBATA <hsbt@ruby-lang.org>
111
- CommitDate: 2022-05-21 08:47:36 +0900
112
-
113
- Fix typo in documentation
114
-
115
- - "hypnen" -> "hyphen"
116
- - "hadler" -> "handler"
117
-
118
- commit 4b47d9c24b3b143bc661c3ef5d0de9f71882b4ce
119
- Author: Jeremy Evans <code@jeremyevans.net>
120
- AuthorDate: 2022-04-22 13:01:43 -0700
19
+ commit 97a198673408d98686a4ec9c3457eef13088c981
20
+ Author: Junichi Sato <22004610+sato11@users.noreply.github.com>
21
+ AuthorDate: 2022-12-07 15:02:23 +0900
121
22
  Commit: Hiroshi SHIBATA <hsbt@ruby-lang.org>
122
- CommitDate: 2022-05-02 20:12:12 +0900
123
-
124
- Avoid defining the same test class in multiple files
125
-
126
- Should fix issues with parallel testing sometimes not running all
127
- tests.
128
-
129
- This should be viewed skipping whitespace changes.
130
-
131
- Fixes [Bug #18731]
132
-
133
- commit 2bea3b38c354c3a49b5705f9f560eef522b4b1e2
134
- Author: Peter Zhu <peter@peterzhu.ca>
135
- AuthorDate: 2022-04-14 11:15:57 -0400
136
- Commit: Hiroshi SHIBATA <hsbt@ruby-lang.org>
137
- CommitDate: 2022-04-15 14:21:13 +0900
138
-
139
- Fix broken links in docs
140
-
141
- commit 3653d5b909d876d3322546a4c2157ea5a94df1b9
142
- Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
143
- AuthorDate: 2022-04-11 03:21:22 +0000
144
- Commit: Hiroshi SHIBATA <hsbt@ruby-lang.org>
145
- CommitDate: 2022-04-11 12:39:39 +0900
146
-
147
- Bump actions/upload-artifact from 2 to 3
148
-
149
- Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3.
150
- - [Release notes](https://github.com/actions/upload-artifact/releases)
151
- - [Commits](https://github.com/actions/upload-artifact/compare/v2...v3)
152
-
153
- ---
154
- updated-dependencies:
155
- - dependency-name: actions/upload-artifact
156
- dependency-type: direct:production
157
- update-type: version-update:semver-major
158
- ...
159
-
160
- Signed-off-by: dependabot[bot] <support@github.com>
161
-
162
- commit a3f0ec21b19bd26111f1025fd8434e55beef309d
163
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
164
- AuthorDate: 2022-04-04 15:05:15 +0900
165
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
166
- CommitDate: 2022-04-04 15:05:15 +0900
167
-
168
- Define `inspect` and `pretty_inspect`
169
-
170
- commit 482a42668e7228485b3274cfb0523af87ab44e56
171
- Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
172
- AuthorDate: 2022-03-25 16:56:25 +0900
173
- Commit: GitHub <noreply@github.com>
174
- CommitDate: 2022-03-25 16:56:25 +0900
175
-
176
- Bump actions/checkout from 2 to 3 (#31)
177
-
178
- Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
179
- - [Release notes](https://github.com/actions/checkout/releases)
180
- - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
181
- - [Commits](https://github.com/actions/checkout/compare/v2...v3)
182
-
183
- ---
184
- updated-dependencies:
185
- - dependency-name: actions/checkout
186
- dependency-type: direct:production
187
- update-type: version-update:semver-major
188
- ...
189
-
190
- Signed-off-by: dependabot[bot] <support@github.com>
191
-
192
- Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
193
-
194
- commit 5bc8b13b8806bac75f8aa0adeaa75a6631b992ec
195
- Author: Hiroshi SHIBATA <hsbt@ruby-lang.org>
196
- AuthorDate: 2022-03-25 16:49:09 +0900
197
- Commit: GitHub <noreply@github.com>
198
- CommitDate: 2022-03-25 16:49:09 +0900
199
-
200
- Added dependabot (#30)
201
-
202
- commit 9e29d86c12819dc383e042cc0059224299a8fcd8
203
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
204
- AuthorDate: 2022-01-12 20:58:54 +0900
205
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
206
- CommitDate: 2022-01-12 20:58:54 +0900
207
-
208
- Fix for ruby 3.0 or earlier
209
-
210
- commit 0ac99576964657f7f44dadcca4c2546594076f88
211
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
212
- AuthorDate: 2022-01-12 19:37:33 +0900
213
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
214
- CommitDate: 2022-01-12 19:37:33 +0900
215
-
216
- DidYouMean::PlainFormatter is deprecated
217
-
218
- commit dab72c543db6c0c0f89a470006ae71390adf0c50
219
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
220
- AuthorDate: 2022-01-12 18:22:11 +0900
221
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
222
- CommitDate: 2022-01-12 18:22:11 +0900
223
-
224
- Fix links to the page directory files
225
-
226
- https://bugs.ruby-lang.org/issues/18468
227
-
228
- commit d182cd60b58eb6bc537f23b0309cde187309056b
229
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
230
- AuthorDate: 2022-01-12 18:17:22 +0900
231
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
232
- CommitDate: 2022-01-12 18:19:40 +0900
233
-
234
- Add rdoc options
235
-
236
- Specify the main page and the page directory. Also in Rakefile,
237
- extract and use the same options from the gemspec file.
238
-
239
- commit ed283559d492e917f1c28b0ece9ea9c3e1327016
240
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
241
- AuthorDate: 2022-01-12 18:16:30 +0900
242
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
243
- CommitDate: 2022-01-12 18:19:39 +0900
244
-
245
- Add .document files
246
-
247
- commit e4f26821283dbf7d7dba8973e332641cff3f119f
248
- Author: David Rodríguez <deivid.rodriguez@riseup.net>
249
- AuthorDate: 2022-01-04 08:32:45 +0100
250
- Commit: GitHub <noreply@github.com>
251
- CommitDate: 2022-01-04 16:32:45 +0900
252
-
253
- Use `require_relative` for internal requires (#28)
254
-
255
- commit faf8e5c8fba85ae2dda8d9d882de4c7016b31ec5
256
- Author: Takashi Kokubun <takashikkbn@gmail.com>
257
- AuthorDate: 2021-12-14 20:49:32 -0800
258
- Commit: GitHub <noreply@github.com>
259
- CommitDate: 2021-12-14 20:49:32 -0800
260
-
261
- s/RubyVM::JIT/RubyVM::MJIT/g (#29)
262
-
263
- commit 61df7522f80a04ce40fc7dea655d4b016f224c83
264
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
265
- AuthorDate: 2021-11-03 19:52:14 +0900
266
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
267
- CommitDate: 2021-11-03 19:52:14 +0900
268
-
269
- Remove the test for deprecated DidYouMean::VerboseFormatter
270
-
271
- commit 0aa18752cfcc2e9bd47afe57348ddc0fc966c981
272
- Author: Nobuyoshi Nakada <nobu@ruby-lang.org>
273
- AuthorDate: 2021-11-03 18:34:13 +0900
274
- Commit: Nobuyoshi Nakada <nobu@ruby-lang.org>
275
- CommitDate: 2021-11-03 18:34:13 +0900
23
+ CommitDate: 2022-12-08 12:11:51 +0900
276
24
 
277
- Fix typo [ci skip]
25
+ Use GITHUB_OUTPUT instead of deprecated set-output
data/lib/optparse.rb CHANGED
@@ -425,7 +425,7 @@
425
425
  # If you have any questions, file a ticket at http://bugs.ruby-lang.org.
426
426
  #
427
427
  class OptionParser
428
- OptionParser::Version = "0.3.0"
428
+ OptionParser::Version = "0.3.1"
429
429
 
430
430
  # :stopdoc:
431
431
  NoArgument = [NO_ARGUMENT = :NONE, nil].freeze
@@ -2084,10 +2084,23 @@ XXX
2084
2084
  f |= Regexp::IGNORECASE if /i/ =~ o
2085
2085
  f |= Regexp::MULTILINE if /m/ =~ o
2086
2086
  f |= Regexp::EXTENDED if /x/ =~ o
2087
- k = o.delete("imx")
2088
- k = nil if k.empty?
2087
+ case o = o.delete("imx")
2088
+ when ""
2089
+ when "u"
2090
+ s = s.encode(Encoding::UTF_8)
2091
+ when "e"
2092
+ s = s.encode(Encoding::EUC_JP)
2093
+ when "s"
2094
+ s = s.encode(Encoding::SJIS)
2095
+ when "n"
2096
+ f |= Regexp::NOENCODING
2097
+ else
2098
+ raise OptionParser::InvalidArgument, "unknown regexp option - #{o}"
2099
+ end
2100
+ else
2101
+ s ||= all
2089
2102
  end
2090
- Regexp.new(s || all, f, k)
2103
+ Regexp.new(s, f)
2091
2104
  end
2092
2105
 
2093
2106
  #
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.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nobu Nakada
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-12-05 00:00:00.000000000 Z
11
+ date: 2022-12-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: OptionParser is a class for command-line option analysis.
14
14
  email: