renc 2.2.1 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +0 -1
- data/CHANGELOG.md +6 -0
- data/README.md +43 -16
- data/lib/renc/version.rb +1 -1
- data/renc.gemspec +6 -2
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 750acdb58a73c029d510df8600bf2a86180e0a92d0740270d6c99dfe96348188
|
4
|
+
data.tar.gz: ae4999e736bfadce482148ac54e43115452e39f1ea17f93971fe14d81517fae5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c30d4bb81f8f243a2082eb3c32d21da3eb967a24c37dc4d175757a6b02f3308a300cc7c2d415f1b67cf980c5fcc54fbef28fbb15cdf449ce8893e587b0624e1
|
7
|
+
data.tar.gz: 4eb48aa439836190cc3e73631348fcb590898fe29a32d339fc94fb3548275368621c21353856bf8151f524198d603c3e6fabc8fcc87c19774172b7a9c28aacce
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# Renc
|
2
|
+
|
1
3
|
[![Gem Version][gem_version-svg]][gem_version]
|
2
4
|
[![Build Status][travis-svg]][travis]
|
3
5
|
[![Downloads][downloads-svg]][gem_version]
|
@@ -5,12 +7,26 @@
|
|
5
7
|
[![Code Climate][codeclimate-svg]][codeclimate]
|
6
8
|
[![Test Coverage][codeclimate_cov-svg]][codeclimate_cov]
|
7
9
|
|
8
|
-
# Renc
|
9
|
-
|
10
10
|
recursive encode for Hash and Array.
|
11
11
|
|
12
|
+
<!-- TOC -->
|
13
|
+
|
14
|
+
- [1. Installation](#1-installation)
|
15
|
+
- [2. Usage](#2-usage)
|
16
|
+
- [2.1. Basic](#21-basic)
|
17
|
+
- [2.2. Nested Hash and Array](#22-nested-hash-and-array)
|
18
|
+
- [2.3. Configuration](#23-configuration)
|
19
|
+
- [2.3.1. Renc.default_encoding](#231-rencdefault_encoding)
|
20
|
+
- [2.3.2. Renc.default_options](#232-rencdefault_options)
|
21
|
+
- [3. Development](#3-development)
|
22
|
+
- [4. Contributing](#4-contributing)
|
23
|
+
- [5. License](#5-license)
|
12
24
|
|
13
|
-
|
25
|
+
<!-- /TOC -->
|
26
|
+
|
27
|
+
---
|
28
|
+
|
29
|
+
## 1. Installation
|
14
30
|
|
15
31
|
Add this line to your application's Gemfile:
|
16
32
|
|
@@ -20,16 +36,21 @@ gem 'renc'
|
|
20
36
|
|
21
37
|
And then execute:
|
22
38
|
|
23
|
-
|
39
|
+
```sh
|
40
|
+
bundle
|
41
|
+
```
|
24
42
|
|
25
43
|
Or install it yourself as:
|
26
44
|
|
27
|
-
|
45
|
+
```sh
|
46
|
+
gem install renc
|
47
|
+
```
|
28
48
|
|
49
|
+
---
|
29
50
|
|
30
|
-
## Usage
|
51
|
+
## 2. Usage
|
31
52
|
|
32
|
-
### Basic
|
53
|
+
### 2.1. Basic
|
33
54
|
|
34
55
|
```ruby
|
35
56
|
require 'renc'
|
@@ -53,7 +74,8 @@ hash_val.renc[:a].encoding # => #<Encoding::UTF-8>
|
|
53
74
|
hash_val.renc == hash_val # => true
|
54
75
|
```
|
55
76
|
|
56
|
-
### Nested Hash and Array
|
77
|
+
### 2.2. Nested Hash and Array
|
78
|
+
|
57
79
|
> @ref [./spec/spec_helper.rb](https://github.com/k-ta-yamada/renc/blob/master/spec/spec_helper.rb#L18)
|
58
80
|
|
59
81
|
```ruby
|
@@ -83,9 +105,9 @@ encoded_string_values.select! { |v| v.is_a?(String) } # => ["a", "bb0"]
|
|
83
105
|
encoded_string_values.all? { |v| v.encoding == Encoding::UTF_8 } # => true
|
84
106
|
```
|
85
107
|
|
86
|
-
### Configuration
|
108
|
+
### 2.3. Configuration
|
87
109
|
|
88
|
-
#### Renc.default_encoding
|
110
|
+
#### 2.3.1. Renc.default_encoding
|
89
111
|
|
90
112
|
```ruby
|
91
113
|
# default configure encoding is Encoding.default_external
|
@@ -101,7 +123,7 @@ Renc.default_encoding = Encoding::ASCII
|
|
101
123
|
'test'.renc(Encoding::ASCII).encoding # => #<Encoding:US-ASCII>
|
102
124
|
```
|
103
125
|
|
104
|
-
#### Renc.default_options
|
126
|
+
#### 2.3.2. Renc.default_options
|
105
127
|
|
106
128
|
```ruby
|
107
129
|
# default configure options is { undef: :replace }
|
@@ -116,8 +138,9 @@ Renc.default_options = { undef: nil }
|
|
116
138
|
'🐘'.renc(Encoding::ASCII, undef: nil).encoding # => Encoding::UndefinedConversionError: U+1F418 from UTF-8 to US-ASCII
|
117
139
|
```
|
118
140
|
|
141
|
+
---
|
119
142
|
|
120
|
-
## Development
|
143
|
+
## 3. Development
|
121
144
|
|
122
145
|
After checking out the repo, run `bin/setup` to install dependencies.
|
123
146
|
Then, run `rake spec` to run the tests.
|
@@ -131,8 +154,9 @@ which will create a git tag for the version,
|
|
131
154
|
push git commits and tags,
|
132
155
|
and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
133
156
|
|
157
|
+
---
|
134
158
|
|
135
|
-
## Contributing
|
159
|
+
## 4. Contributing
|
136
160
|
|
137
161
|
Bug reports and pull requests are welcome on
|
138
162
|
GitHub at https://github.com/k-ta-yamada/renc.
|
@@ -141,18 +165,21 @@ welcoming space for collaboration,
|
|
141
165
|
and contributors are expected to adhere to the
|
142
166
|
[Contributor Covenant](https://contributor-covenant.org) code of conduct.
|
143
167
|
|
168
|
+
---
|
144
169
|
|
145
|
-
## License
|
170
|
+
## 5. License
|
146
171
|
|
147
172
|
The gem is available as open source
|
148
173
|
under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
149
174
|
|
175
|
+
---
|
150
176
|
|
177
|
+
eof
|
151
178
|
|
152
179
|
[gem_version]: https://badge.fury.io/rb/renc
|
153
180
|
[gem_version-svg]: https://badge.fury.io/rb/renc.svg
|
154
|
-
[travis]: https://travis-ci.
|
155
|
-
[travis-svg]: https://travis-ci.
|
181
|
+
[travis]: https://app.travis-ci.com/k-ta-yamada/renc
|
182
|
+
[travis-svg]: https://app.travis-ci.com/k-ta-yamada/renc.svg?branch=master
|
156
183
|
[codeclimate]: https://codeclimate.com/github/k-ta-yamada/renc
|
157
184
|
[codeclimate-svg]: https://codeclimate.com/github/k-ta-yamada/renc/badges/gpa.svg
|
158
185
|
[codeclimate_cov]: https://codeclimate.com/github/k-ta-yamada/renc/coverage
|
data/lib/renc/version.rb
CHANGED
data/renc.gemspec
CHANGED
@@ -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.
|
12
|
+
spec.required_ruby_version = '>= 2.6.0'
|
13
13
|
|
14
14
|
spec.summary = 'recursive encode for Hash and Array.'
|
15
15
|
spec.description = 'recursive encode for Hash and Array.'
|
@@ -24,7 +24,11 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_development_dependency 'bundler'
|
25
25
|
spec.add_development_dependency 'rake'
|
26
26
|
spec.add_development_dependency 'rspec'
|
27
|
-
|
27
|
+
# Workaround for cc-test-reporter with SimpleCov 0.18.
|
28
|
+
# Stop upgrading SimpleCov until the following issue will be resolved.
|
29
|
+
# https://github.com/codeclimate/test-reporter/issues/418
|
30
|
+
# https://github.com/codeclimate/test-reporter/issues/413
|
31
|
+
spec.add_development_dependency 'simplecov', '= 0.17'
|
28
32
|
spec.add_development_dependency 'simplecov-console'
|
29
33
|
|
30
34
|
spec.add_development_dependency 'pry'
|
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: 2.2.
|
4
|
+
version: 2.2.2
|
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:
|
11
|
+
date: 2021-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -56,16 +56,16 @@ dependencies:
|
|
56
56
|
name: simplecov
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
61
|
+
version: '0.17'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
68
|
+
version: '0.17'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: simplecov-console
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -198,7 +198,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
198
198
|
requirements:
|
199
199
|
- - ">="
|
200
200
|
- !ruby/object:Gem::Version
|
201
|
-
version: 2.
|
201
|
+
version: 2.6.0
|
202
202
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
203
203
|
requirements:
|
204
204
|
- - ">="
|