optsparser_generator 1.0 → 1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/optsparser_generator.rb +7 -8
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 56bfa952a4074ab23314b8199f7c72eb2ea046e0
4
- data.tar.gz: dd5d69342938fa3c306661300acabab7c303f132
3
+ metadata.gz: dcbe1e73825ba5ba097c4bd260424f2eaf0fe286
4
+ data.tar.gz: b8595c9abc7ad0f13fa0c41c04f0845308a0262d
5
5
  SHA512:
6
- metadata.gz: f82fc7b445605277439b553f939129097422563e8c6c232be0abb0d2ef8374658e93b25ce76487120b87053a128f9f450afdbc4beafe1c73c14a8febd2b34e01
7
- data.tar.gz: d017102908c5ddc89ac0627040fa1dbedbd47db2417f5ddfa807a611f2177d945cf8d401d0228e5477b94d434f4a7825d974784f108a573c87a34ab4fa0bdf3d
6
+ metadata.gz: 08e11abeebc8b5ffd471488fee1ea592b52b3f11552f36b398d1f45b0e59127751d1dd3be74bc611baab2c755e39537616dc501dcecfd48aaad1c3646e003669
7
+ data.tar.gz: 14871d9b25637519b5e629ee8268cf52dc58994e336c1e5104a5a9a0747cceb2064ae16553daafcb34473ac605b073f63816e7c0d7ec9be5498d234d9192f856
@@ -1,6 +1,5 @@
1
1
  require 'ostruct'
2
2
  require 'optparse'
3
- require 'pp'
4
3
 
5
4
  class OptParseGenerator
6
5
  def initialize(ostruct)
@@ -58,16 +57,13 @@ class OptParseGenerator
58
57
  end
59
58
  end
60
59
 
61
- def self.respond_to?(method_sym, include_private = false)
62
- if respond_to?(method_sym, include_private)
63
- respond_to?(method_sym, include_private)
64
- else
65
- @optparser.respond_to?(method_sym, include_private)
66
- end
60
+ def respond_to?(method_sym, include_private = false)
61
+ @optparser.respond_to?(method_sym, include_private) || super
67
62
  end
68
63
  end
69
64
 
70
65
  # tests
66
+ # require 'optsparser_generator'
71
67
  # options = OpenStruct.new
72
68
  # options.no_filter = false
73
69
  # options.no_filter__help = 'bla bla helP!'
@@ -80,7 +76,10 @@ end
80
76
  # options.fix_method_names_with_known_ones = true
81
77
 
82
78
  # optparser = OptParseGenerator.new(options)
79
+ # raise 'broken' unless optparser.respond_to? :to_s
80
+ # raise 'broken' if optparser.respond_to? :notthere
81
+
83
82
  # puts optparser.parse!(['--no-filter']).inspect
84
83
  # puts optparser.parse!(['--log=other/path']).inspect
85
84
  # optparser.parse!(['--help'])
86
- # puts 'Error: --help did not quit'
85
+ # raise 'Error: --help did not quit'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: optsparser_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.0'
4
+ version: '1.1'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marvin Zerulla