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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54b73371441befba7008b0cc6c8129df5fc20f03d93a782e6ef3e16326a9fe85
4
- data.tar.gz: a182cfa0bff4c5028b6dda198f3097a72d2b303666a80008a5039bda42cd4ef8
3
+ metadata.gz: d2c75ba263712a00a1285f1fd8ae475b707c399274e16ba0fba2cb3530d5e4fa
4
+ data.tar.gz: 81d2facadf014a876d53b723153d07ca6c71e2160b91de158f8932434a02c851
5
5
  SHA512:
6
- metadata.gz: b14e129413456b5da151b801cb64808e53a61b00ca21da82929afa8176bcfb32a3de58c7920fb6839dc45bcc58cd837605caada739d3b1f9ad0ed7595edb11fe
7
- data.tar.gz: 14d85a2123407d031c1d11828e2b13471b1b8d8c8d44c211ab92662ff9d08f36dcff6373be9d3d0d034ef015d872a166966058de59fd70a8d8124120cd28437c
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
@@ -53,7 +53,7 @@ module Necromancer
53
53
  end
54
54
 
55
55
  # Converts the object
56
- # @param [Object] value
56
+ # @param [Object] object
57
57
  # any object to be converted
58
58
  #
59
59
  # @api public
@@ -58,7 +58,7 @@ module Necromancer
58
58
  # @api public
59
59
  def to(target, options = {})
60
60
  conversion = conversions[source || detect(object, false), detect(target)]
61
- conversion.call(object, options)
61
+ conversion.call(object, **options)
62
62
  end
63
63
  alias >> to
64
64
 
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Necromancer
4
- VERSION = "0.5.0"
4
+ VERSION = "0.5.1"
5
5
  end # Necromancer
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'
@@ -4,7 +4,7 @@ RSpec.describe Necromancer, '.register' do
4
4
  it "allows ro register converter" do
5
5
  converter = described_class.new
6
6
  UpcaseConverter = Struct.new(:source, :target) do
7
- def call(value, options)
7
+ def call(value, **options)
8
8
  value.to_s.upcase
9
9
  end
10
10
  end
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.0
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-03-23 00:00:00.000000000 Z
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.3
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.