cmd-optparse.rb 0.1.0 → 0.1.1

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: 35e41eb882f470b2af1fefe465395c4c453ed0fabcddc10c2beedc506895a353
4
- data.tar.gz: 241e687823cf2fea4f9f2def31f979925707aafdf35e5a97b8b8a31f7d36ebf1
3
+ metadata.gz: 604edf0badf7b3d053498dd0cdafaf516f31a0d6e300b444fc97a4c5a15e4fe1
4
+ data.tar.gz: efd52b19e71a60735369074178db092209e5b9a5944e1fce8e048002f8352d58
5
5
  SHA512:
6
- metadata.gz: acc0ce9ad24e69143ce0541fbc15a529c61282e1609cf5d250f899646b4bd2fb4bab700bf97c310f48a4ad9842a011ba4c14c311e5cd37f9d7ff84fc55847f18
7
- data.tar.gz: 7a3775b8b352e66a6b93d5e53364e721fcf713fa59a156be2131af767d926208e4a639a328f34e115ce59d8710584a7a6476f8acadd07ac0869310d1c240df6c
6
+ metadata.gz: 1e8cbd03e9c2de55ac9bd17a5fe89a24b6a4602dd612cf45565b0d459a2ec5b17325727b3a008ed3d5c39e1d50642fb5343c7b869804e79008718c60b2fa3fa9
7
+ data.tar.gz: b94fe059e594aaa8808891a850682e1c5ab13e29284e2bd0886ab57409784735556b2f5ae1103c0caf7863fb1c37f1de6ea76b3d1d667521a165e450d5a082ae
@@ -9,7 +9,7 @@ end
9
9
 
10
10
  Gem::Specification.new do |spec|
11
11
  spec.name = name
12
- spec.version = "0.1.0"
12
+ spec.version = "0.1.1"
13
13
  spec.authors = ["0x1eef", "Nobu Nakada"]
14
14
  spec.email = ["0x1eef@protonmail.com"]
15
15
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: false
2
- require_relative '../optparse'
2
+ require_relative 'option_parser'
3
3
 
4
4
  class OptionParser::AC < OptionParser
5
5
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: false
2
- require_relative '../optparse'
2
+ require_relative 'option_parser'
3
3
  require 'date'
4
4
 
5
5
  OptionParser.accept(DateTime) do |s,|
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
- require_relative '../optparse'
2
+ require_relative 'option_parser'
3
3
 
4
4
  class OptionParser
5
5
  # :call-seq:
6
6
  # define_by_keywords(options, method, **params)
7
7
  #
8
- # :include: ../../doc/optparse/creates_option.rdoc
8
+ # :include: ../..option_parserreates_option.rdoc
9
9
  #
10
10
  def define_by_keywords(options, meth, **opts)
11
11
  meth.parameters.each do |type, name|
@@ -73,7 +73,7 @@
73
73
  #
74
74
  # === Minimal example
75
75
  #
76
- # require 'optparse'
76
+ # require 'cmd-optparse'
77
77
  #
78
78
  # options = {}
79
79
  # OptionParser.new do |parser|
@@ -92,7 +92,7 @@
92
92
  # OptionParser can be used to automatically generate help for the commands you
93
93
  # write:
94
94
  #
95
- # require 'optparse'
95
+ # require 'cmd-optparse'
96
96
  #
97
97
  # Options = Struct.new(:name)
98
98
  #
@@ -130,7 +130,7 @@
130
130
  # option name in all caps. If an option is used without the required argument,
131
131
  # an exception will be raised.
132
132
  #
133
- # require 'optparse'
133
+ # require 'cmd-optparse'
134
134
  #
135
135
  # options = {}
136
136
  # OptionParser.new do |parser|
@@ -183,8 +183,8 @@
183
183
  # as a +Time+. If it succeeds, that time will be passed to the
184
184
  # handler block. Otherwise, an exception will be raised.
185
185
  #
186
- # require 'optparse'
187
- # require 'optparse/time'
186
+ # require 'cmd-optparse'
187
+ # require 'cmd-optparse/time'
188
188
  # OptionParser.new do |parser|
189
189
  # parser.on("-t", "--time [TIME]", Time, "Begin execution at given time") do |time|
190
190
  # p time
@@ -206,7 +206,7 @@
206
206
  # It specifies which conversion block to call whenever a class is specified.
207
207
  # The example below uses it to fetch a +User+ object before the +on+ handler receives it.
208
208
  #
209
- # require 'optparse'
209
+ # require 'cmd-optparse'
210
210
  #
211
211
  # User = Struct.new(:id, :name)
212
212
  #
@@ -242,7 +242,7 @@
242
242
  #
243
243
  # The +into+ option of +order+, +parse+ and so on methods stores command line options into a Hash.
244
244
  #
245
- # require 'optparse'
245
+ # require 'cmd-optparse'
246
246
  #
247
247
  # options = {}
248
248
  # OptionParser.new do |parser|
@@ -268,8 +268,8 @@
268
268
  # effect of specifying various options. This is probably the best way to learn
269
269
  # the features of +optparse+.
270
270
  #
271
- # require 'optparse'
272
- # require 'optparse/time'
271
+ # require 'cmd-optparse'
272
+ # require 'cmd-optparse/time'
273
273
  # require 'ostruct'
274
274
  # require 'pp'
275
275
  #
@@ -1406,7 +1406,7 @@ XXX
1406
1406
  # :call-seq:
1407
1407
  # make_switch(params, block = nil)
1408
1408
  #
1409
- # :include: ../doc/optparse/creates_option.rdoc
1409
+ # :include: ../d/option_parserreates_option.rdoc
1410
1410
  #
1411
1411
  def make_switch(opts, block = nil)
1412
1412
  short, long, nolong, style, pattern, conv, not_pattern, not_conv, not_style = [], [], []
@@ -1544,7 +1544,7 @@ XXX
1544
1544
  # :call-seq:
1545
1545
  # define(*params, &block)
1546
1546
  #
1547
- # :include: ../doc/optparse/creates_option.rdoc
1547
+ # :include: ../d/option_parserreates_option.rdoc
1548
1548
  #
1549
1549
  def define(*opts, &block)
1550
1550
  top.append(*(sw = make_switch(opts, block)))
@@ -1554,7 +1554,7 @@ XXX
1554
1554
  # :call-seq:
1555
1555
  # on(*params, &block)
1556
1556
  #
1557
- # :include: ../doc/optparse/creates_option.rdoc
1557
+ # :include: ../d/option_parserreates_option.rdoc
1558
1558
  #
1559
1559
  def on(*opts, &block)
1560
1560
  define(*opts, &block)
@@ -1565,7 +1565,7 @@ XXX
1565
1565
  # :call-seq:
1566
1566
  # define_head(*params, &block)
1567
1567
  #
1568
- # :include: ../doc/optparse/creates_option.rdoc
1568
+ # :include: ../d/option_parserreates_option.rdoc
1569
1569
  #
1570
1570
  def define_head(*opts, &block)
1571
1571
  top.prepend(*(sw = make_switch(opts, block)))
@@ -1575,7 +1575,7 @@ XXX
1575
1575
  # :call-seq:
1576
1576
  # on_head(*params, &block)
1577
1577
  #
1578
- # :include: ../doc/optparse/creates_option.rdoc
1578
+ # :include: ../d/option_parserreates_option.rdoc
1579
1579
  #
1580
1580
  # The new option is added at the head of the summary.
1581
1581
  #
@@ -1588,7 +1588,7 @@ XXX
1588
1588
  # :call-seq:
1589
1589
  # define_tail(*params, &block)
1590
1590
  #
1591
- # :include: ../doc/optparse/creates_option.rdoc
1591
+ # :include: ../d/option_parserreates_option.rdoc
1592
1592
  #
1593
1593
  def define_tail(*opts, &block)
1594
1594
  base.append(*(sw = make_switch(opts, block)))
@@ -1599,7 +1599,7 @@ XXX
1599
1599
  # :call-seq:
1600
1600
  # on_tail(*params, &block)
1601
1601
  #
1602
- # :include: ../doc/optparse/creates_option.rdoc
1602
+ # :include: ../d/option_parserreates_option.rdoc
1603
1603
  #
1604
1604
  # The new option is added at the tail of the summary.
1605
1605
  #
@@ -2,6 +2,6 @@
2
2
  # -*- ruby -*-
3
3
 
4
4
  require 'shellwords'
5
- require_relative '../optparse'
5
+ require_relative 'option_parser'
6
6
 
7
7
  OptionParser.accept(Shellwords) {|s,| Shellwords.shellwords(s)}
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: false
2
- require_relative '../optparse'
2
+ require_relative 'option_parser'
3
3
  require 'time'
4
4
 
5
5
  OptionParser.accept(Time) do |s,|
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
  # -*- ruby -*-
3
3
 
4
- require_relative '../optparse'
4
+ require_relative 'option_parser'
5
5
  require 'uri'
6
6
 
7
7
  OptionParser.accept(URI) {|s,| URI.parse(s) if s}
@@ -0,0 +1 @@
1
+ require_relative "cmd-optparse/option_parser"
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: false
2
2
  require 'test/unit'
3
- require 'optparse'
3
+ require 'cmd-optparse'
4
4
 
5
5
  class TestOptionParser < Test::Unit::TestCase
6
6
  def setup
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cmd-optparse.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - '0x1eef'
@@ -91,15 +91,15 @@ files:
91
91
  - doc/optparse/ruby/true_class.rb
92
92
  - doc/optparse/ruby/uri.rb
93
93
  - doc/optparse/tutorial.rdoc
94
- - lib/optionparser.rb
95
- - lib/optparse.rb
96
- - lib/optparse/ac.rb
97
- - lib/optparse/date.rb
98
- - lib/optparse/kwargs.rb
99
- - lib/optparse/shellwords.rb
100
- - lib/optparse/time.rb
101
- - lib/optparse/uri.rb
102
- - lib/optparse/version.rb
94
+ - lib/cmd-optparse.rb
95
+ - lib/cmd-optparse/ac.rb
96
+ - lib/cmd-optparse/date.rb
97
+ - lib/cmd-optparse/kwargs.rb
98
+ - lib/cmd-optparse/option_parser.rb
99
+ - lib/cmd-optparse/shellwords.rb
100
+ - lib/cmd-optparse/time.rb
101
+ - lib/cmd-optparse/uri.rb
102
+ - lib/cmd-optparse/version.rb
103
103
  - misc/rb_optparse.bash
104
104
  - misc/rb_optparse.zsh
105
105
  - rakelib/.document
data/lib/optionparser.rb DELETED
@@ -1,2 +0,0 @@
1
- # frozen_string_literal: false
2
- require_relative 'optparse'
File without changes