renc 2.2.0 → 2.2.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
- SHA1:
3
- metadata.gz: 7f70f4e782058204a07038072f5f044f6c70a6ac
4
- data.tar.gz: c8b8331054b0c93b40fca1fa9d7db3d27c0e4810
2
+ SHA256:
3
+ metadata.gz: 12a07a3819b5e0c3ac476b111f346a56a3a7936ca2843c00006367ff96ffa98a
4
+ data.tar.gz: 49c6afd4b3e1f84020be224fdd66a65e89688b8154fbf58596afecc0049e79bc
5
5
  SHA512:
6
- metadata.gz: 0c5f4a131d471a306f3f1cf58cef2eee70e5df70bbda6c3c46b2de09ab67e5299d8cc1348fdb9ec0ecab155364ada431d64ad5e0e369bc0917fadcb13f55aa67
7
- data.tar.gz: d632b298ec50c4c6ca6e693b0d50cb07df1acf9603102e55c0a6e0c6835a10616be4cb696ab5d8754652597d2d11125ca4b7f4a222e5937784efcbe89102d51e
6
+ metadata.gz: 0b37003f38acf041ca5b8e7710f0dfc2a4b6b4d7acf1e464a6135e4f41c799c16b12c1ac631f98e6823f88754516d2a408faa9c57eafe0db34f8f88a2874d1a6
7
+ data.tar.gz: 253d69c822c8865bacf37402fa1c52c593f4231dbf999e8821e12f29e5b76d59b33abac206eb09194b0ad0e3b08571a2574a5d18991d27eb84783db8d2c65c4f
@@ -1,13 +1,19 @@
1
1
  language: ruby
2
+
2
3
  cache: bundler
4
+
3
5
  rvm:
4
- - 2.4.0
5
- - 2.3.3
6
- - 2.2.6
7
- - 2.1.10
8
- - 2.0.0-p648
6
+ - 3.0
7
+ - 2.7
8
+ - 2.6
9
+ - 2.5
10
+
9
11
  before_install:
10
- - gem update --system --no-doc
11
- - gem install bundler
12
- after_success:
13
- - bundle exec codeclimate-test-reporter
12
+ - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
13
+ - chmod +x ./cc-test-reporter
14
+
15
+ before_script:
16
+ - ./cc-test-reporter before-build
17
+
18
+ after_script:
19
+ - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
@@ -1,5 +1,15 @@
1
- # v2.2.0
1
+ # CHANGELOG.md
2
+
3
+ ## v2.2.1
4
+
5
+ 2020-12-31 JST
6
+
7
+ - Add support for Ruby 3.0
8
+
9
+ ## v2.2.0
10
+
2
11
  2017-08-11 JST
12
+
3
13
  - [issue #25](https://github.com/k-ta-yamada/renc/issues/25)
4
14
  [add] Add target Class Struct #25
5
15
  - [issue #26](https://github.com/k-ta-yamada/renc/issues/26)
@@ -7,11 +17,13 @@
7
17
  - [issue #23](https://github.com/k-ta-yamada/renc/issues/23)
8
18
  [clean] Renc::Configuration.default_xxx='s comment is wrong #23
9
19
 
10
- # v2.1.0
20
+ ## v2.1.0
21
+
11
22
  - [issue #21](https://github.com/k-ta-yamada/renc/issues/21)
12
23
  change class structure; Separate Configuration #21
13
24
 
14
- # v2.0.0
25
+ ## v2.0.0
26
+
15
27
  - [issue #10](https://github.com/k-ta-yamada/renc/issues/10)
16
28
  Changing default_encoding by os #10
17
29
  - change default encoding is `Encoding.default_external`
@@ -20,27 +32,33 @@
20
32
  - change `#renc`'s arguments is change.
21
33
  #renc(encoding, `obj`) => #renc(encoding, `options`)
22
34
 
23
- # v1.3.1
35
+ ## v1.3.1
36
+
24
37
  - [issue #14](https://github.com/k-ta-yamada/renc/issues/14)
25
38
  String.include is NoMethodError on Ruby 2.0.0
26
39
 
27
- # v1.3.0
40
+ ## v1.3.0
41
+
28
42
  - [issue #7](https://github.com/k-ta-yamada/renc/issues/7)
29
43
  configuration default encoding
30
44
 
31
- # v1.2.0
45
+ ## v1.2.0
46
+
32
47
  - remove `Renc#enc` method
33
48
 
34
- # v1.1.0
49
+ ## v1.1.0
50
+
35
51
  - [issue #4](https://github.com/k-ta-yamada/renc/issues/4)
36
52
  #renc for Hash and Array
37
53
 
38
- # v1.0.1
54
+ ## v1.0.1
55
+
39
56
  - required Ruby version is change to over 2.0.0.
40
57
  - gemspec: `spec.required_ruby_version = '>= 2.0.0'`
41
58
  - maybe, be able to run on `version >= 2.0.0`.
42
59
 
43
- # v1.0.0
60
+ ## v1.0.0
61
+
44
62
  - change to instance_method from singleton_method.
45
63
  - renc method is implemented.
46
64
  - enc method is deprecated.
@@ -49,8 +67,10 @@
49
67
  - maybe, be able to run on `version >= 2.0.0`.
50
68
  - Travis CI: 2.2.4, 2.3.0
51
69
 
52
- # v0.2.0
70
+ ## v0.2.0
71
+
53
72
  - implement base features.
54
73
 
55
- # v0.1.0
74
+ ## v0.1.0
75
+
56
76
  - sorry, this version is dummy.
data/Gemfile CHANGED
@@ -2,5 +2,3 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in renc.gemspec
4
4
  gemspec
5
- gem 'codeclimate-test-reporter', group: :test, require: nil
6
- gem 'simplecov-console', group: :test, require: nil
data/README.md CHANGED
@@ -1,8 +1,9 @@
1
1
  [![Gem Version][gem_version-svg]][gem_version]
2
2
  [![Build Status][travis-svg]][travis]
3
+ [![Downloads][downloads-svg]][gem_version]
4
+ [![Inline docs][inch-ci-svg]][inch-ci]
3
5
  [![Code Climate][codeclimate-svg]][codeclimate]
4
6
  [![Test Coverage][codeclimate_cov-svg]][codeclimate_cov]
5
- [![Inline docs][inch-ci-svg]][inch-ci]
6
7
 
7
8
  # Renc
8
9
 
@@ -138,17 +139,17 @@ GitHub at https://github.com/k-ta-yamada/renc.
138
139
  This project is intended to be a safe,
139
140
  welcoming space for collaboration,
140
141
  and contributors are expected to adhere to the
141
- [Contributor Covenant](http://contributor-covenant.org) code of conduct.
142
+ [Contributor Covenant](https://contributor-covenant.org) code of conduct.
142
143
 
143
144
 
144
145
  ## License
145
146
 
146
147
  The gem is available as open source
147
- under the terms of the [MIT License](http://opensource.org/licenses/MIT).
148
+ under the terms of the [MIT License](https://opensource.org/licenses/MIT).
148
149
 
149
150
 
150
151
 
151
- [gem_version]: http://badge.fury.io/rb/renc
152
+ [gem_version]: https://badge.fury.io/rb/renc
152
153
  [gem_version-svg]: https://badge.fury.io/rb/renc.svg
153
154
  [travis]: https://travis-ci.org/k-ta-yamada/renc
154
155
  [travis-svg]: https://travis-ci.org/k-ta-yamada/renc.svg
@@ -156,5 +157,6 @@ under the terms of the [MIT License](http://opensource.org/licenses/MIT).
156
157
  [codeclimate-svg]: https://codeclimate.com/github/k-ta-yamada/renc/badges/gpa.svg
157
158
  [codeclimate_cov]: https://codeclimate.com/github/k-ta-yamada/renc/coverage
158
159
  [codeclimate_cov-svg]: https://codeclimate.com/github/k-ta-yamada/renc/badges/coverage.svg
159
- [inch-ci]: http://inch-ci.org/github/k-ta-yamada/renc
160
- [inch-ci-svg]: http://inch-ci.org/github/k-ta-yamada/renc.svg?branch=master
160
+ [inch-ci]: https://inch-ci.org/github/k-ta-yamada/renc
161
+ [inch-ci-svg]: https://inch-ci.org/github/k-ta-yamada/renc.svg?branch=master
162
+ [downloads-svg]: https://ruby-gem-downloads-badge.herokuapp.com/renc?type=total&total_label=&color=brightgreen
@@ -54,7 +54,7 @@ module Renc
54
54
 
55
55
  def _renc(obj)
56
56
  case obj
57
- when String then obj.encode(@encoding, @options)
57
+ when String then obj.encode(@encoding, **@options)
58
58
  when Hash then _hash(obj)
59
59
  when Array then _array(obj)
60
60
  when Struct then _struct(obj)
@@ -64,7 +64,7 @@ module Renc
64
64
 
65
65
  # recursive encode for Hash values of String.
66
66
  def _hash(obj)
67
- obj.each_with_object({}) { |(k, v), h| h[k] = _renc(v) }
67
+ obj.transform_values { |v| _renc(v) }
68
68
  end
69
69
 
70
70
  # recursive encode for Array values of String.
@@ -26,6 +26,7 @@ module Renc
26
26
  # @param encoding [Encoding]
27
27
  def default_encoding=(encoding)
28
28
  raise TypeError, ERR_MESSAGE_ENCODING unless encoding.is_a?(Encoding)
29
+
29
30
  @default_encoding = encoding
30
31
  end
31
32
 
@@ -43,6 +44,7 @@ module Renc
43
44
  # @param options [Hash]
44
45
  def default_options=(options)
45
46
  raise TypeError, ERR_MESSAGE_OPTIONS unless options.is_a?(Hash)
47
+
46
48
  @default_options = options
47
49
  end
48
50
  end
@@ -1,3 +1,3 @@
1
1
  module Renc
2
- VERSION = '2.2.0'.freeze
2
+ VERSION = '2.2.1'.freeze
3
3
  end
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ['k-ta-yamada']
10
10
  spec.email = ['key.luvless@gmail.com']
11
11
 
12
- spec.required_ruby_version = '>= 2.0.0'
12
+ spec.required_ruby_version = '>= 2.5.0'
13
13
 
14
14
  spec.summary = 'recursive encode for Hash and Array.'
15
15
  spec.description = 'recursive encode for Hash and Array.'
@@ -21,9 +21,11 @@ Gem::Specification.new do |spec|
21
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
22
  spec.require_paths = ['lib']
23
23
 
24
- spec.add_development_dependency 'bundler', '~> 1.11'
25
- spec.add_development_dependency 'rake', '~> 10.0'
26
- spec.add_development_dependency 'rspec', '~> 3.0'
24
+ spec.add_development_dependency 'bundler'
25
+ spec.add_development_dependency 'rake'
26
+ spec.add_development_dependency 'rspec'
27
+ spec.add_development_dependency 'simplecov'
28
+ spec.add_development_dependency 'simplecov-console'
27
29
 
28
30
  spec.add_development_dependency 'pry'
29
31
  spec.add_development_dependency 'pry-doc'
metadata CHANGED
@@ -1,57 +1,85 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: renc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - k-ta-yamada
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-11 00:00:00.000000000 Z
11
+ date: 2020-12-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.11'
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.11'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: simplecov
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
46
60
  - !ruby/object:Gem::Version
47
- version: '3.0'
61
+ version: '0'
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - "~>"
66
+ - - ">="
53
67
  - !ruby/object:Gem::Version
54
- version: '3.0'
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: simplecov-console
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: pry
57
85
  requirement: !ruby/object:Gem::Requirement
@@ -162,7 +190,7 @@ homepage: https://github.com/k-ta-yamada/renc
162
190
  licenses:
163
191
  - MIT
164
192
  metadata: {}
165
- post_install_message:
193
+ post_install_message:
166
194
  rdoc_options: []
167
195
  require_paths:
168
196
  - lib
@@ -170,16 +198,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
170
198
  requirements:
171
199
  - - ">="
172
200
  - !ruby/object:Gem::Version
173
- version: 2.0.0
201
+ version: 2.5.0
174
202
  required_rubygems_version: !ruby/object:Gem::Requirement
175
203
  requirements:
176
204
  - - ">="
177
205
  - !ruby/object:Gem::Version
178
206
  version: '0'
179
207
  requirements: []
180
- rubyforge_project:
181
- rubygems_version: 2.6.11
182
- signing_key:
208
+ rubygems_version: 3.2.3
209
+ signing_key:
183
210
  specification_version: 4
184
211
  summary: recursive encode for Hash and Array.
185
212
  test_files: []