necromancer 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/necromancer/context.rb +1 -1
- data/lib/necromancer/conversion_target.rb +1 -1
- data/lib/necromancer/converters/array.rb +1 -1
- data/lib/necromancer/converters/numeric.rb +6 -6
- data/lib/necromancer/version.rb +1 -1
- data/necromancer.gemspec +8 -0
- data/spec/spec_helper.rb +2 -2
- data/spec/unit/register_spec.rb +1 -1
- metadata +9 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2c75ba263712a00a1285f1fd8ae475b707c399274e16ba0fba2cb3530d5e4fa
|
4
|
+
data.tar.gz: 81d2facadf014a876d53b723153d07ca6c71e2160b91de158f8932434a02c851
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1e756209c25b089ac91855e03f54d7ca455e429059eb9cce5ce1ffa5923701b49803bee61eaae79740aa1aee1d9dcdb7468c959cd17e5b146e054f7177b563c
|
7
|
+
data.tar.gz: ab17c590fc92c5206a0b961af955f48314cb7b7d5739cab04e8ec5a09e011f088f468c3b0ccc7a8e95673b0a978f1cedc034ed2d1f899077549bedf3c40051e8
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Change log
|
2
2
|
|
3
|
+
## [v0.5.1] - 2019-11-24
|
4
|
+
|
5
|
+
### Changed
|
6
|
+
* Change gemspec to include metadata
|
7
|
+
|
8
|
+
### Fixed
|
9
|
+
* Fix Ruby 2.7 warnings by Ryan Davis(@zenspider)
|
10
|
+
|
3
11
|
## [v0.5.0] - 2019-03-23
|
4
12
|
|
5
13
|
### Changed
|
@@ -44,6 +52,7 @@
|
|
44
52
|
|
45
53
|
* Initial implementation and release
|
46
54
|
|
55
|
+
[v0.5.1]: https://github.com/piotrmurach/necromancer/compare/v0.5.0...v0.5.1
|
47
56
|
[v0.5.0]: https://github.com/piotrmurach/necromancer/compare/v0.4.0...v0.5.0
|
48
57
|
[v0.4.0]: https://github.com/piotrmurach/necromancer/compare/v0.3.0...v0.4.0
|
49
58
|
[v0.3.0]: https://github.com/piotrmurach/necromancer/compare/v0.2.0...v0.3.0
|
data/lib/necromancer/context.rb
CHANGED
@@ -45,7 +45,7 @@ module Necromancer
|
|
45
45
|
def call(value, options = {})
|
46
46
|
numeric_converter = NumericConverters::StringToNumericConverter.new(:string, :numeric)
|
47
47
|
value.reduce([]) do |acc, el|
|
48
|
-
acc << numeric_converter.call(el, options)
|
48
|
+
acc << numeric_converter.call(el, **options)
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
@@ -18,7 +18,7 @@ module Necromancer
|
|
18
18
|
# converter.call('1abc') # => 1
|
19
19
|
#
|
20
20
|
# @api public
|
21
|
-
def call(value, options
|
21
|
+
def call(value, **options)
|
22
22
|
strict = options.fetch(:strict, config.strict)
|
23
23
|
Integer(value)
|
24
24
|
rescue
|
@@ -34,7 +34,7 @@ module Necromancer
|
|
34
34
|
# converter.call(1) # => '1'
|
35
35
|
#
|
36
36
|
# @api public
|
37
|
-
def call(value, _)
|
37
|
+
def call(value, **_)
|
38
38
|
value.to_s
|
39
39
|
end
|
40
40
|
end
|
@@ -47,7 +47,7 @@ module Necromancer
|
|
47
47
|
# converter.call('1.2') # => 1.2
|
48
48
|
#
|
49
49
|
# @api public
|
50
|
-
def call(value, options
|
50
|
+
def call(value, **options)
|
51
51
|
strict = options.fetch(:strict, config.strict)
|
52
52
|
Float(value)
|
53
53
|
rescue
|
@@ -66,13 +66,13 @@ module Necromancer
|
|
66
66
|
# converter.call('1') # => 1
|
67
67
|
#
|
68
68
|
# @api public
|
69
|
-
def call(value, options
|
69
|
+
def call(value, **options)
|
70
70
|
strict = options.fetch(:strict, config.strict)
|
71
71
|
case value
|
72
72
|
when INTEGER_MATCHER
|
73
|
-
StringToIntegerConverter.new(:string, :integer).call(value, options)
|
73
|
+
StringToIntegerConverter.new(:string, :integer).call(value, **options)
|
74
74
|
when FLOAT_MATCHER
|
75
|
-
StringToFloatConverter.new(:string, :float).call(value, options)
|
75
|
+
StringToFloatConverter.new(:string, :float).call(value, **options)
|
76
76
|
else
|
77
77
|
strict ? raise_conversion_type(value) : value
|
78
78
|
end
|
data/lib/necromancer/version.rb
CHANGED
data/necromancer.gemspec
CHANGED
@@ -12,6 +12,14 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.homepage = 'https://github.com/piotrmurach/necromancer'
|
13
13
|
spec.license = 'MIT'
|
14
14
|
|
15
|
+
if spec.respond_to?(:metadata=)
|
16
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
17
|
+
spec.metadata["changelog_uri"] = "https://github.com/piotrmurach/necromancer/blob/master/CHANGELOG.md"
|
18
|
+
spec.metadata["documentation_uri"] = "https://www.rubydoc.info/gems/necromancer"
|
19
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
20
|
+
spec.metadata["source_code_uri"] = "https://github.com/piotrmurach/necromancer"
|
21
|
+
end
|
22
|
+
|
15
23
|
spec.files = Dir['{lib,spec}/**/*.rb']
|
16
24
|
spec.files += Dir['tasks/*', 'necromancer.gemspec']
|
17
25
|
spec.files += Dir['README.md', 'CHANGELOG.md', 'LICENSE.txt', 'Rakefile']
|
data/spec/spec_helper.rb
CHANGED
@@ -4,10 +4,10 @@ if ENV['COVERAGE'] || ENV['TRAVIS']
|
|
4
4
|
require 'simplecov'
|
5
5
|
require 'coveralls'
|
6
6
|
|
7
|
-
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
7
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
|
8
8
|
SimpleCov::Formatter::HTMLFormatter,
|
9
9
|
Coveralls::SimpleCov::Formatter
|
10
|
-
]
|
10
|
+
])
|
11
11
|
|
12
12
|
SimpleCov.start do
|
13
13
|
command_name 'spec'
|
data/spec/unit/register_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: necromancer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Murach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -109,7 +109,12 @@ files:
|
|
109
109
|
homepage: https://github.com/piotrmurach/necromancer
|
110
110
|
licenses:
|
111
111
|
- MIT
|
112
|
-
metadata:
|
112
|
+
metadata:
|
113
|
+
allowed_push_host: https://rubygems.org
|
114
|
+
changelog_uri: https://github.com/piotrmurach/necromancer/blob/master/CHANGELOG.md
|
115
|
+
documentation_uri: https://www.rubydoc.info/gems/necromancer
|
116
|
+
homepage_uri: https://github.com/piotrmurach/necromancer
|
117
|
+
source_code_uri: https://github.com/piotrmurach/necromancer
|
113
118
|
post_install_message:
|
114
119
|
rdoc_options: []
|
115
120
|
require_paths:
|
@@ -125,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
130
|
- !ruby/object:Gem::Version
|
126
131
|
version: '0'
|
127
132
|
requirements: []
|
128
|
-
rubygems_version: 3.0.
|
133
|
+
rubygems_version: 3.0.6
|
129
134
|
signing_key:
|
130
135
|
specification_version: 4
|
131
136
|
summary: Conversion from one object type to another with a bit of black magic.
|