opto 1.4.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/opto/option.rb +2 -2
- data/lib/opto/version.rb +1 -1
- data/opto.gemspec +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b14c43a8bb5fd247a9055fad5a034cdf105a105
|
4
|
+
data.tar.gz: 609d7736dd12d4122767c805a6a6f359ccdee237
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7252a233ceb798d1215494de81c07c8b578022126afc092273ee1f5a71fa22f3c1fdec8ed80d4f801194c308e62b1e6dd6e56c77425aece2230db952ab174d6a
|
7
|
+
data.tar.gz: c71d75fed79a2123c5848a742e77d108fe8d5287cc24516bd29680f40d75f5d83acb8d459ee4f763214012fb037ba00bf43f5d99786b76c86409e48c1e99dc99
|
data/lib/opto/option.rb
CHANGED
@@ -93,7 +93,7 @@ module Opto
|
|
93
93
|
@only_if = opts.delete(:only_if)
|
94
94
|
@skip_lambdas = normalize_ifs(@skip_if)
|
95
95
|
@only_lambdas = normalize_ifs(@only_if)
|
96
|
-
@from =
|
96
|
+
@from = normalize_from_to(opts.delete(:from))
|
97
97
|
@to = normalize_from_to(opts.delete(:to))
|
98
98
|
@type_options = opts
|
99
99
|
|
@@ -186,7 +186,7 @@ module Opto
|
|
186
186
|
# Accessor to defined resolvers for this option.
|
187
187
|
# @return [Array<Opto::Resolver>]
|
188
188
|
def resolvers
|
189
|
-
@resolvers ||= from.map { |origin, hint| Resolver.for(origin).new(hint, self) }
|
189
|
+
@resolvers ||= from.merge(default: self).map { |origin, hint| Resolver.for(origin).new(hint, self) }
|
190
190
|
end
|
191
191
|
|
192
192
|
def setters
|
data/lib/opto/version.rb
CHANGED
data/opto.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Kimmo Lehto"]
|
10
10
|
spec.email = ["info@kontena.io"]
|
11
11
|
|
12
|
-
spec.summary = "
|
13
|
-
spec.description = "Example: Opto.new(type: :string, name: '
|
12
|
+
spec.summary = "Option validator / resolver"
|
13
|
+
spec.description = "Create validatable and resolvable options from hashes or YAML. Example: Opto.new(type: :string, name: 'FOO', min_length: 20, from: :env).valid?"
|
14
14
|
spec.homepage = "https://github.com/kontena/opto"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kimmo Lehto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,8 +52,8 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
|
-
description: '
|
56
|
-
|
55
|
+
description: 'Create validatable and resolvable options from hashes or YAML. Example:
|
56
|
+
Opto.new(type: :string, name: ''FOO'', min_length: 20, from: :env).valid?'
|
57
57
|
email:
|
58
58
|
- info@kontena.io
|
59
59
|
executables:
|
@@ -115,5 +115,5 @@ rubyforge_project:
|
|
115
115
|
rubygems_version: 2.4.5
|
116
116
|
signing_key:
|
117
117
|
specification_version: 4
|
118
|
-
summary:
|
118
|
+
summary: Option validator / resolver
|
119
119
|
test_files: []
|