rationalist 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +13 -6
- data/CHANGELOG.md +4 -0
- data/README.md +7 -5
- data/lib/rationalist.rb +5 -3
- data/rationalist.gemspec +5 -5
- metadata +8 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: dc8fa49c5877e7dfe5cd3265a65b01910bf50e0c42cea49fd9b4b96da5fced83
|
4
|
+
data.tar.gz: e731bb4228790f76a7989f856353e64cf2e180d0fafae93dfe8474782afbe39a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc94305ff94c5722b67d81b7549d0d9b90062fd177f683b2722e093a7b99120786064aa6a314a8b11725c3082152c1d60f3a1a921cd3357f482e74975d67c90d
|
7
|
+
data.tar.gz: 178bd9b22dba5e38c1afe3b88617c76bbb254116f14fdc64930deb9bff10a4ae0e6670f6fc19dd36d5bc1871bfbb19e9f645461ebae290677fe503c7af4242e2
|
data/.travis.yml
CHANGED
@@ -2,12 +2,19 @@ sudo: false
|
|
2
2
|
language: ruby
|
3
3
|
|
4
4
|
rvm:
|
5
|
-
- 2.
|
5
|
+
- 2.7
|
6
|
+
- 2.6
|
7
|
+
- 2.5
|
8
|
+
- 2.4
|
9
|
+
- 2.3
|
6
10
|
- ruby-head
|
7
|
-
- jruby-
|
11
|
+
- jruby-9.2.9.0
|
12
|
+
- truffleruby
|
8
13
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
14
|
+
matrix:
|
15
|
+
allow_failures:
|
16
|
+
- rvm: 2.3
|
17
|
+
- rvm: ruby-head
|
18
|
+
- rvm: jruby-2.9.2.0
|
19
|
+
- rvm: truffleruby
|
13
20
|
# fast_finish: true
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
-
# rationalist [![[version]](https://badge.fury.io/rb/
|
1
|
+
# rationalist [![[version]](https://badge.fury.io/rb/rationalist.svg)](https://badge.fury.io/rb/rationalist) [![[travis]](https://travis-ci.org/janlelis/rationalist.png)](https://travis-ci.org/janlelis/rationalist)
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
*With __rationalist__, the options are just a hash!*
|
4
|
+
|
5
|
+
Strongly influenced by substack's
|
6
|
+
[minimist](https://github.com/substack/minimist) nodejs module.
|
5
7
|
|
6
8
|
## setup
|
7
9
|
|
@@ -23,7 +25,7 @@ fanciful decoration.
|
|
23
25
|
# example
|
24
26
|
|
25
27
|
```ruby
|
26
|
-
require '
|
28
|
+
require 'rationalist'
|
27
29
|
argv = Rationalist.parse(ARGV)
|
28
30
|
p argv
|
29
31
|
```
|
@@ -102,4 +104,4 @@ gem install rationalist
|
|
102
104
|
|
103
105
|
MIT
|
104
106
|
|
105
|
-
**rationalist** was written by Jan Lelis and [minimist](https://github.com/substack/minimist) was written by James Halliday.
|
107
|
+
**rationalist** was written by Jan Lelis and [minimist](https://github.com/substack/minimist) was written by James Halliday.
|
data/lib/rationalist.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Rationalist
|
2
|
-
VERSION = '2.0.
|
2
|
+
VERSION = '2.0.1'
|
3
3
|
|
4
4
|
def self.parse(args = ARGV, **options, &unknown_block)
|
5
5
|
Argv.new(args, options, unknown_block).argv
|
@@ -232,8 +232,10 @@ module Rationalist
|
|
232
232
|
|
233
233
|
def numeric?(value)
|
234
234
|
value.is_a?(Numeric) ||
|
235
|
-
|
236
|
-
|
235
|
+
value.is_a?(String) && (
|
236
|
+
!(value !~ /\A0x[0-9a-f]+\z/) ||
|
237
|
+
!(value !~ /\A[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?\z/)
|
238
|
+
)
|
237
239
|
end
|
238
240
|
|
239
241
|
def Numeric(value)
|
data/rationalist.gemspec
CHANGED
@@ -5,11 +5,11 @@ require File.dirname(__FILE__) + "/lib/rationalist"
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = "rationalist"
|
7
7
|
gem.version = Rationalist::VERSION
|
8
|
-
gem.summary = "parse argument options"
|
9
|
-
gem.description = "
|
8
|
+
gem.summary = "parse argument options. a ruby fork of minimist."
|
9
|
+
gem.description = "Command-line arguments to hash"
|
10
10
|
gem.authors = ["Jan Lelis"]
|
11
|
-
gem.email = ["
|
12
|
-
gem.homepage = "https://github.com/janlelis/
|
11
|
+
gem.email = ["hi@ruby.consulting"]
|
12
|
+
gem.homepage = "https://github.com/janlelis/rationalist"
|
13
13
|
gem.license = "MIT"
|
14
14
|
|
15
15
|
gem.files = Dir["{**/}{.*,*}"].select{ |path| File.file?(path) && path !~ /^pkg/ }
|
@@ -17,5 +17,5 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.test_files = gem.files.grep(%r{^spec/})
|
18
18
|
gem.require_paths = ["lib"]
|
19
19
|
|
20
|
-
gem.required_ruby_version = "
|
20
|
+
gem.required_ruby_version = ">= 2.0"
|
21
21
|
end
|
metadata
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rationalist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Lelis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description:
|
13
|
+
description: Command-line arguments to hash
|
14
14
|
email:
|
15
|
-
-
|
15
|
+
- hi@ruby.consulting
|
16
16
|
executables: []
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
@@ -41,7 +41,7 @@ files:
|
|
41
41
|
- spec/stop_early_spec.rb
|
42
42
|
- spec/unknown_spec.rb
|
43
43
|
- spec/whitespace_spec.rb
|
44
|
-
homepage: https://github.com/janlelis/
|
44
|
+
homepage: https://github.com/janlelis/rationalist
|
45
45
|
licenses:
|
46
46
|
- MIT
|
47
47
|
metadata: {}
|
@@ -51,7 +51,7 @@ require_paths:
|
|
51
51
|
- lib
|
52
52
|
required_ruby_version: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- - "
|
54
|
+
- - ">="
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: '2.0'
|
57
57
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
@@ -60,11 +60,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
requirements: []
|
63
|
-
|
64
|
-
rubygems_version: 2.4.6
|
63
|
+
rubygems_version: 3.1.2
|
65
64
|
signing_key:
|
66
65
|
specification_version: 4
|
67
|
-
summary: parse argument options
|
66
|
+
summary: parse argument options. a ruby fork of minimist.
|
68
67
|
test_files:
|
69
68
|
- spec/all_bools_spec.rb
|
70
69
|
- spec/bool_spec.rb
|
@@ -79,4 +78,3 @@ test_files:
|
|
79
78
|
- spec/stop_early_spec.rb
|
80
79
|
- spec/unknown_spec.rb
|
81
80
|
- spec/whitespace_spec.rb
|
82
|
-
has_rdoc:
|