renc 0.2.0 → 1.0.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: 36fc265a71968fed982b140c1925848904ce5a26
4
- data.tar.gz: 062f3218d2e3c643d57255f03ef5a5bfe5862bb8
3
+ metadata.gz: 8b37aa5ea23c2d62516fb961f243cf75f611d8a7
4
+ data.tar.gz: c2eece2df16dcbf6b81bcfc176d99661c25d14e1
5
5
  SHA512:
6
- metadata.gz: b4cfd70b202d6244d7e0657fbc4bb04b4733dd9252e6ddc8bd218acece2d1dd119fd5e0c49f52a2925c04342e1086c03df56b9c0aa9c1c1b8d9f9d92134a5536
7
- data.tar.gz: 9164395218da7e9d5dc74402b13f278e3410ded27182b650cb5e7b9ddff9a436d20ad94118915356e1d008b7fedeb79b81f9dab58c3a3f34b2159302e0f85548
6
+ metadata.gz: 1761bfd89920e0d4f5f1f39efa483d1d591669bfe853b45adad8c9c802148a15de1d1f87daf1753246d8237a7586373e7f1f13d7da3eec49c132c12b7c7c3e67
7
+ data.tar.gz: 85f8565ede7fe37f109fe69a68040084703332983b6e0b30f0880d784b01554d3a5126cf11088db4a052cc5a504fd143461018febd12a8dc75c9ac56b6d36012
@@ -0,0 +1,14 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ AllCops:
4
+ # Include:
5
+ # - Gemfile
6
+ # - Rakefile
7
+ # - lib/
8
+ # - spec/
9
+ Exclude:
10
+ - renc.gemspec
11
+ - vendor/**/*
12
+
13
+ Style/AsciiComments:
14
+ Enabled: false
File without changes
@@ -1,7 +1,6 @@
1
1
  language: ruby
2
+ cache: bundler
2
3
  rvm:
3
4
  - 2.3.0
4
- - 2.2.3
5
- - 2.1.7
6
- - 2.0.0
5
+ - 2.2.4
7
6
  before_install: gem install bundler -v 1.11.2
@@ -1,3 +1,12 @@
1
+ # v1.0.0
2
+ - base method change from singleton_method to instance_method.
3
+ - renc method is implemented.
4
+ - enc method is deprecated.
5
+ - required Ruby version is change to over 2.2.4.
6
+ - gemspec: `spec.required_ruby_version = '>= 2.2.4'`
7
+ - maybe, be able to run on `version >= 2.0.0`.
8
+ - Travis CI: 2.2.4, 2.3.0
9
+
1
10
  # v0.2.0
2
11
  - implement base features.
3
12
 
data/Gemfile CHANGED
@@ -2,3 +2,5 @@ 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,3 +1,9 @@
1
+ [![Gem Version][gem_version-svg]][gem_version]
2
+ [![Build Status][travis-svg]][travis]
3
+ [![Code Climate][codeclimate-svg]][codeclimate]
4
+ [![Test Coverage][codeclimate_cov-svg]][codeclimate_cov]
5
+ [![Inline docs][inch-ci-svg]][inch-ci]
6
+
1
7
  # Renc
2
8
 
3
9
  Welcome to your new gem!
@@ -69,3 +75,20 @@ and contributors are expected to adhere to the
69
75
 
70
76
  The gem is available as open source
71
77
  under the terms of the [MIT License](http://opensource.org/licenses/MIT).
78
+
79
+
80
+
81
+ [gem_version]: http://badge.fury.io/rb/renc
82
+ [gem_version-svg]: https://badge.fury.io/rb/renc.svg
83
+
84
+ [travis]: https://travis-ci.org/k-ta-yamada/renc
85
+ [travis-svg]: https://travis-ci.org/k-ta-yamada/renc.svg
86
+
87
+ [codeclimate]: https://codeclimate.com/github/k-ta-yamada/renc
88
+ [codeclimate-svg]: https://codeclimate.com/github/k-ta-yamada/renc/badges/gpa.svg
89
+
90
+ [codeclimate_cov]: https://codeclimate.com/github/k-ta-yamada/renc/coverage
91
+ [codeclimate_cov-svg]: https://codeclimate.com/github/k-ta-yamada/renc/badges/coverage.svg
92
+
93
+ [inch-ci]: http://inch-ci.org/github/k-ta-yamada/renc
94
+ [inch-ci-svg]: http://inch-ci.org/github/k-ta-yamada/renc.svg?branch=master
@@ -7,8 +7,8 @@ require 'renc'
7
7
  # with your gem easier. You can also use a different console, if you like.
8
8
 
9
9
  # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
10
+ require 'pry'
11
+ Pry.start
12
12
 
13
- require 'irb'
14
- IRB.start
13
+ # require 'irb'
14
+ # IRB.start
@@ -2,7 +2,7 @@ require 'renc/version'
2
2
 
3
3
  # namespace
4
4
  module Renc
5
- def self.enc(obj, encoding = Encoding::UTF_8)
5
+ def renc(obj, encoding = Encoding::UTF_8)
6
6
  case obj
7
7
  when String then obj.encode(encoding)
8
8
  when Hash then enc_hash(obj, encoding)
@@ -11,16 +11,20 @@ module Renc
11
11
  end
12
12
  end
13
13
 
14
- # private
14
+ extend Gem::Deprecate
15
+ alias enc renc
16
+ deprecate :enc, :renc, 2016, 3
15
17
 
16
- def self.enc_hash(obj, encoding)
18
+ private
19
+
20
+ def enc_hash(obj, encoding)
17
21
  obj.each_with_object({}) do |args, h|
18
22
  key, val = args
19
- h[key] = enc(val, encoding)
23
+ h[key] = renc(val, encoding)
20
24
  end
21
25
  end
22
26
 
23
- def self.enc_array(obj, encoding)
24
- obj.map { |val| enc(val, encoding) }
27
+ def enc_array(obj, encoding)
28
+ obj.map { |val| renc(val, encoding) }
25
29
  end
26
30
  end
@@ -1,3 +1,3 @@
1
1
  module Renc
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '1.0.0'.freeze
3
3
  end
@@ -9,6 +9,8 @@ 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.2.4'
13
+
12
14
  spec.summary = 'recurse encoding for Hash and Array.'
13
15
  spec.description = 'recurse encoding for Hash and Array.'
14
16
  spec.homepage = 'https://github.com/k-ta-yamada/renc'
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: 0.2.0
4
+ version: 1.0.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-26 00:00:00.000000000 Z
11
+ date: 2016-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -131,6 +131,8 @@ extra_rdoc_files: []
131
131
  files:
132
132
  - ".gitignore"
133
133
  - ".rspec"
134
+ - ".rubocop.yml"
135
+ - ".rubocop_todo.yml"
134
136
  - ".travis.yml"
135
137
  - CAHNGELOG.md
136
138
  - CODE_OF_CONDUCT.md
@@ -155,7 +157,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
155
157
  requirements:
156
158
  - - ">="
157
159
  - !ruby/object:Gem::Version
158
- version: '0'
160
+ version: 2.2.4
159
161
  required_rubygems_version: !ruby/object:Gem::Requirement
160
162
  requirements:
161
163
  - - ">="