okay 9.0.0 → 10.0.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: 771620de5d44a7098a96b5e95672a07582327108f8ebe18a0c7aadbfcaa6272e
4
- data.tar.gz: 448f409cce2467dc0ecd9f3e940590c1620c69528fe011305848e3b63fe83c8f
3
+ metadata.gz: 3abf8b39842bc201721061189ca61e036198780c60e1d01a1c6b5434b8c6796c
4
+ data.tar.gz: effbb2d734973d1c0c0c33e59f027246212d3f79fd734c524274a5454a27e14b
5
5
  SHA512:
6
- metadata.gz: '0678fc09142e31bf1fcee8199fad6121fad65d55f3d6d09cc89e46e6be10f35beaa539534e8ef5be709ae89576825686922d455818f1cd19f2a33f5acf949c38'
7
- data.tar.gz: e2c75f5898ffbb543a63bc407df09ccadd7e98ea7dc7dfe29f25f72bf0159ac7df5b54c07a60223ffbd11d2fd5c32491d4fc3fd28abbd537b93e5641b55d736c
6
+ metadata.gz: faf52f42bc463b31b73e4b8ccaa680d971c1a4b874cb27321248ee4e337da88e0b73ae330693c64ee740ea23229e22a36ed833f412a7bee77e1bf2aaa3823a4c
7
+ data.tar.gz: c43961b19116e262ce15cd514a2f4e8212031fe2aa9d8454e68327ecf40e2b9c9dfe775b2159889478a40932d89ce1b11a04376da694643615e1dcd759107a9d
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "optparse"
4
+
5
+ ##
6
+ # An OptionParser wrapper providing a few convenience functions.
7
+ class SimpleOpts < OptionParser
8
+ def initialize(*args, defaults: nil)
9
+ super(*args)
10
+ @okay_options = defaults || {}
11
+ end
12
+
13
+ # simple(..., :a)
14
+ # simple(..., :b)
15
+ # ==
16
+ # options = {}
17
+ # on(...) { |val| options[:a] = val }
18
+ # on(...) { |val| options[:b] = val }
19
+ def simple(*args)
20
+ key = args.pop
21
+ on(*args) { |*x| @okay_options[key] = x[0] }
22
+ end
23
+
24
+ def parse(args)
25
+ parse!(args.dup)
26
+ @okay_options
27
+ end
28
+ end
data/lib/okay/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Okay
4
- VERSION = "9.0.0"
4
+ VERSION = "10.0.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: okay
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.0.0
4
+ version: 10.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ellen Marie Dash
@@ -120,6 +120,7 @@ files:
120
120
  - lib/okay/default.rb
121
121
  - lib/okay/graphql.rb
122
122
  - lib/okay/http.rb
123
+ - lib/okay/simple_opts.rb
123
124
  - lib/okay/template.rb
124
125
  - lib/okay/version.rb
125
126
  - lib/okay/warning_helpers.rb