renc 1.1.0 → 1.2.0

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
  SHA1:
3
- metadata.gz: bb71daa147a8f421b6596731e638044fa7dae64f
4
- data.tar.gz: d01f8c0d216baaf810601d557280af7db92f1aed
3
+ metadata.gz: d23dd022e00e54050a4613a1aae4999e49046876
4
+ data.tar.gz: 5e0c6ca26059dcfaa1c52ff9f522a5e3bb35362d
5
5
  SHA512:
6
- metadata.gz: 837078d4f5c516c5efa4d4d61340c70c46a7deae5dbed5491bc9801dd3260e2c860564f2ae3a63d568cbc0cd2057cfa227d05a83c47a76d90b0eae54233a253b
7
- data.tar.gz: b314a50cfbeb37858b7b8dbb7b3854cfbcc9f774ac7ef2acc9b30954a566609b41c126f47af815c0b7f17788bb2675d6db64c43f5ad3bf679cd56df81524ee44
6
+ metadata.gz: 6bd1436484490cf7f116aad27f3b7eb044292148857f11b6956e7369822f4ec3aa708d2dd9ad100252964ca05c01108723b971eb5c33ac7862ad0f1301e7f703
7
+ data.tar.gz: 7424d0ddbcd033c1416a01d34bb39db2dc4a98b222fead380395cc1d9d44f3c89b4897ee9f7610f4db2d919be9fae0de65c9c58597c5a7300ef3cc889076e70e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # v1.2.0
2
+ - remove `Renc#enc` method
3
+
1
4
  # v1.1.0
2
5
  - [issue #4](https://github.com/k-ta-yamada/tee_logger/issues/4)
3
6
  #renc for Hash and Array
data/bin/console CHANGED
File without changes
data/lib/renc.rb CHANGED
@@ -20,28 +20,23 @@ require 'renc/version'
20
20
  # # or context `main`
21
21
  # extend Renc
22
22
  module Renc
23
+ TARGET_CLASS = [String, Array, Hash].freeze
23
24
  # include #renc method
24
- [String, Hash, Array].each { |klass| klass.include self }
25
+ TARGET_CLASS.each { |klass| klass.include self }
25
26
 
26
27
  # recurse encoding for Hash and Array.
27
- # @param obj [Object]
28
28
  # @param encoding [Encoding]
29
+ # @param obj [Object]
29
30
  # @return [Object]
30
31
  def renc(encoding = Encoding::UTF_8, obj = self)
31
- # binding.pry
32
32
  case obj
33
33
  when String then obj.encode(encoding)
34
- when Hash then renc_hash(obj, encoding)
35
34
  when Array then renc_array(obj, encoding)
35
+ when Hash then renc_hash(obj, encoding)
36
36
  else obj
37
37
  end
38
38
  end
39
39
 
40
- # @see #renc
41
- alias enc renc
42
- extend Gem::Deprecate
43
- deprecate :enc, :renc, 2016, 3
44
-
45
40
  private
46
41
 
47
42
  # recurse encoding for Hash values of String.
@@ -49,7 +44,6 @@ module Renc
49
44
  obj.each_with_object({}) do |args, h|
50
45
  key, val = args
51
46
  h[key] = renc(encoding, val)
52
- # h[key] = val.renc(encoding)
53
47
  end
54
48
  end
55
49
 
data/lib/renc/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Renc
2
- VERSION = '1.1.0'.freeze
2
+ VERSION = '1.2.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: renc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - k-ta-yamada
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-29 00:00:00.000000000 Z
11
+ date: 2016-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -179,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
179
179
  version: '0'
180
180
  requirements: []
181
181
  rubyforge_project:
182
- rubygems_version: 2.2.2
182
+ rubygems_version: 2.5.1
183
183
  signing_key:
184
184
  specification_version: 4
185
185
  summary: recurse encoding for Hash and Array.