plissken 1.3.1 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +14 -11
- data/VERSION +1 -1
- data/lib/plissken/methods.rb +4 -3
- metadata +12 -110
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19ddb8d989e1d33c6c807f407ef56921f8eef0c83a04d34d1b155f4c89917ecc
|
4
|
+
data.tar.gz: a5e33ee92cba1609729e69f3ca7a54d0108874d7dbba669e7297c37b4989b065
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bca62b7979a915d206108c2152e1f847b5d0f0e4e284556227345aac75a67b2f827672811d2b1ccbab68847ea59df8655d2efe15bdf97343bd094b40e008aec0
|
7
|
+
data.tar.gz: 3500beae861ca1a7a010ff869b480676ddaff1a9e6d2132a99b3da29718bb733fe78f881d96232b382dc21b705d515812ef87816c6a1c4d3de26cf128dd88df9
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,13 +1,18 @@
|
|
1
1
|
# Plissken
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/plissken.svg)](https://badge.fury.io/rb/plissken)
|
4
|
+
![CI](https://github.com/technicalpanda/plissken/workflows/CI/badge.svg)
|
4
5
|
|
5
6
|
Have you ever needed to automatically convert JSON-style `camelBack` or `CamelCase` hash keys into more Rubyish `snake_case`?
|
6
7
|
|
7
|
-
Plissken to the rescue
|
8
|
+
Plissken to the rescue!
|
8
9
|
|
9
10
|
This gem recursively converts all camelBack or CamelCase keys in either a Hash structure, or an Array of Hashes, to snake_case.
|
10
11
|
|
12
|
+
## Requirements
|
13
|
+
|
14
|
+
* Ruby >= 2.7
|
15
|
+
|
11
16
|
## Installation
|
12
17
|
|
13
18
|
Add this to your Gemfile:
|
@@ -52,16 +57,14 @@ Plissken works on either string keys or symbolized keys. It has no dependencies,
|
|
52
57
|
If you've already got `snake_case` and need to `CamelCase` it, you are encouraged to try
|
53
58
|
the [Awrence](http://github.com/futurechimp/awrence) gem.
|
54
59
|
|
55
|
-
## Contributing
|
60
|
+
## Contributing
|
61
|
+
|
62
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/technicalpanda/plissken. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
63
|
+
|
64
|
+
## License
|
56
65
|
|
57
|
-
|
58
|
-
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
59
|
-
* Fork the project.
|
60
|
-
* Start a feature/bugfix branch.
|
61
|
-
* Commit and push until you are happy with your contribution.
|
62
|
-
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
63
|
-
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
66
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
64
67
|
|
65
|
-
##
|
68
|
+
## Code of Conduct
|
66
69
|
|
67
|
-
|
70
|
+
Everyone interacting with this project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/technicalpanda/plissken/blob/main/CODE_OF_CONDUCT.md).
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
2.0.1
|
data/lib/plissken/methods.rb
CHANGED
@@ -20,13 +20,14 @@ module Plissken
|
|
20
20
|
private
|
21
21
|
|
22
22
|
def snake_hash(value)
|
23
|
-
|
23
|
+
value.to_h { |k, v| [underscore_key(k), to_snake_keys(v)] }
|
24
24
|
end
|
25
25
|
|
26
26
|
def underscore_key(key)
|
27
|
-
|
27
|
+
case key
|
28
|
+
when Symbol
|
28
29
|
underscore(key.to_s).to_sym
|
29
|
-
|
30
|
+
when String
|
30
31
|
underscore(key)
|
31
32
|
else
|
32
33
|
key # Plissken can't snakify anything except strings and symbols
|
metadata
CHANGED
@@ -1,115 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plissken
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dave Hrycyszyn
|
8
|
-
- Michael Chrisco
|
9
8
|
- Stuart Chinery
|
10
|
-
autorequire:
|
9
|
+
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
14
|
-
dependencies:
|
15
|
-
- !ruby/object:Gem::Dependency
|
16
|
-
name: byebug
|
17
|
-
requirement: !ruby/object:Gem::Requirement
|
18
|
-
requirements:
|
19
|
-
- - "~>"
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '11.1'
|
22
|
-
type: :development
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
requirements:
|
26
|
-
- - "~>"
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
version: '11.1'
|
29
|
-
- !ruby/object:Gem::Dependency
|
30
|
-
name: minitest
|
31
|
-
requirement: !ruby/object:Gem::Requirement
|
32
|
-
requirements:
|
33
|
-
- - "~>"
|
34
|
-
- !ruby/object:Gem::Version
|
35
|
-
version: '5.14'
|
36
|
-
type: :development
|
37
|
-
prerelease: false
|
38
|
-
version_requirements: !ruby/object:Gem::Requirement
|
39
|
-
requirements:
|
40
|
-
- - "~>"
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: '5.14'
|
43
|
-
- !ruby/object:Gem::Dependency
|
44
|
-
name: minitest-fail-fast
|
45
|
-
requirement: !ruby/object:Gem::Requirement
|
46
|
-
requirements:
|
47
|
-
- - "~>"
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: '0.1'
|
50
|
-
type: :development
|
51
|
-
prerelease: false
|
52
|
-
version_requirements: !ruby/object:Gem::Requirement
|
53
|
-
requirements:
|
54
|
-
- - "~>"
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
version: '0.1'
|
57
|
-
- !ruby/object:Gem::Dependency
|
58
|
-
name: minitest-macos-notification
|
59
|
-
requirement: !ruby/object:Gem::Requirement
|
60
|
-
requirements:
|
61
|
-
- - "~>"
|
62
|
-
- !ruby/object:Gem::Version
|
63
|
-
version: '0.3'
|
64
|
-
type: :development
|
65
|
-
prerelease: false
|
66
|
-
version_requirements: !ruby/object:Gem::Requirement
|
67
|
-
requirements:
|
68
|
-
- - "~>"
|
69
|
-
- !ruby/object:Gem::Version
|
70
|
-
version: '0.3'
|
71
|
-
- !ruby/object:Gem::Dependency
|
72
|
-
name: minitest-reporters
|
73
|
-
requirement: !ruby/object:Gem::Requirement
|
74
|
-
requirements:
|
75
|
-
- - "~>"
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: '1.4'
|
78
|
-
type: :development
|
79
|
-
prerelease: false
|
80
|
-
version_requirements: !ruby/object:Gem::Requirement
|
81
|
-
requirements:
|
82
|
-
- - "~>"
|
83
|
-
- !ruby/object:Gem::Version
|
84
|
-
version: '1.4'
|
85
|
-
- !ruby/object:Gem::Dependency
|
86
|
-
name: rake
|
87
|
-
requirement: !ruby/object:Gem::Requirement
|
88
|
-
requirements:
|
89
|
-
- - "~>"
|
90
|
-
- !ruby/object:Gem::Version
|
91
|
-
version: '13.0'
|
92
|
-
type: :development
|
93
|
-
prerelease: false
|
94
|
-
version_requirements: !ruby/object:Gem::Requirement
|
95
|
-
requirements:
|
96
|
-
- - "~>"
|
97
|
-
- !ruby/object:Gem::Version
|
98
|
-
version: '13.0'
|
99
|
-
- !ruby/object:Gem::Dependency
|
100
|
-
name: rubocop
|
101
|
-
requirement: !ruby/object:Gem::Requirement
|
102
|
-
requirements:
|
103
|
-
- - "~>"
|
104
|
-
- !ruby/object:Gem::Version
|
105
|
-
version: '0.79'
|
106
|
-
type: :development
|
107
|
-
prerelease: false
|
108
|
-
version_requirements: !ruby/object:Gem::Requirement
|
109
|
-
requirements:
|
110
|
-
- - "~>"
|
111
|
-
- !ruby/object:Gem::Version
|
112
|
-
version: '0.79'
|
12
|
+
date: 2022-01-23 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
113
14
|
description: |-
|
114
15
|
Have you ever needed to automatically convert JSON-style camelBack or CamelCase hash keys into more Rubyish snake_case?
|
115
16
|
|
@@ -118,7 +19,7 @@ description: |-
|
|
118
19
|
This gem recursively converts all camelBack or CamelCase keys in a hash structure to snake_case.
|
119
20
|
email:
|
120
21
|
- dave@constructiveproof.com
|
121
|
-
-
|
22
|
+
- code@technicalpanda.co.uk
|
122
23
|
executables: []
|
123
24
|
extensions: []
|
124
25
|
extra_rdoc_files: []
|
@@ -132,11 +33,12 @@ files:
|
|
132
33
|
- lib/plissken/ext/hash/to_snake_keys.rb
|
133
34
|
- lib/plissken/methods.rb
|
134
35
|
- lib/plissken/version.rb
|
135
|
-
homepage: https://github.com/
|
36
|
+
homepage: https://github.com/technicalpanda/plissken
|
136
37
|
licenses:
|
137
38
|
- MIT
|
138
|
-
metadata:
|
139
|
-
|
39
|
+
metadata:
|
40
|
+
rubygems_mfa_required: 'true'
|
41
|
+
post_install_message:
|
140
42
|
rdoc_options: []
|
141
43
|
require_paths:
|
142
44
|
- lib
|
@@ -144,15 +46,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
144
46
|
requirements:
|
145
47
|
- - ">="
|
146
48
|
- !ruby/object:Gem::Version
|
147
|
-
version: '
|
49
|
+
version: '2.7'
|
148
50
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
149
51
|
requirements:
|
150
52
|
- - ">="
|
151
53
|
- !ruby/object:Gem::Version
|
152
54
|
version: '0'
|
153
55
|
requirements: []
|
154
|
-
rubygems_version: 3.
|
155
|
-
signing_key:
|
56
|
+
rubygems_version: 3.2.33
|
57
|
+
signing_key:
|
156
58
|
specification_version: 4
|
157
59
|
summary: Snakify your camel keys when working with JSON APIs
|
158
60
|
test_files: []
|