camel_snake_keys 0.0.5 → 0.0.6

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: b21140710746cd5e5d82b5f063b4654126df61f9
4
- data.tar.gz: e1714386e270c31d3dd6054fb3f923d74138eeca
2
+ SHA256:
3
+ metadata.gz: aa1c9add7284fe62b15cee14c52d235fec33afcef807443b16e3707968637a8f
4
+ data.tar.gz: 232f5192defb1ca29e6a5d0be7167d2da77022d821df89d198edcc9f4e77db40
5
5
  SHA512:
6
- metadata.gz: 239f2025330fe5ed5a4bc0d4359905009e9dee60dfe4124ceafefa05f4fa193aa507d89558667925f9bcaf3358e9618bf211c13297b0c37ebf2e54e4ab9a4716
7
- data.tar.gz: 31f4b8bf86703c297e0675898d9ed66a7e1a1f2fba4000f0fe4e9c785ffa90b8afc29574877cb5e1371c7484bf1a547b5a47eef47eae8919437dd9594ea21686
6
+ metadata.gz: 47b49b0cc1b7ac5bf0ef0a0b7ee8e8e4c5b0f20d302c22e852fbecadf140c37a6cc1997220b0e65a48ec9ef180bc95dc2b9edc27f2fb08a9a619cdce282f3da8
7
+ data.tar.gz: 52c3a13f86946c9dc122503fb0b2473930a5c09fd6a58c3a35e7c5af04c7f69358f686d591cb084012f36d6da944722fad854809003fdd70f98253966d9df1cf
data/.gitignore CHANGED
@@ -3,3 +3,4 @@ coverage/
3
3
  log/*.log
4
4
  Gemfile.lock
5
5
  pkg/
6
+ .DS_Store
@@ -0,0 +1 @@
1
+ 2.3.0
@@ -11,9 +11,9 @@ rvm:
11
11
  - 2.2
12
12
  - 2.1
13
13
  - 2.0.0
14
- - jruby-9.0.4.0
14
+ # - jruby-9.1.0.0
15
15
  - ruby-head
16
- - jruby-head
16
+ # - jruby-head
17
17
 
18
18
  matrix:
19
19
  allow_failures:
@@ -27,7 +27,7 @@ env:
27
27
  - RAILS=4.2.7.1
28
28
  - RAILS=master
29
29
  global:
30
- - JRUBY_OPTS="-J-Xmx1024m --debug"
30
+ # - JRUBY_OPTS="-J-Xmx1024m --debug"
31
31
 
32
32
  notifications:
33
33
  email:
@@ -1,4 +1,12 @@
1
+ 0.0.6 4/07/2020
2
+ ==============
3
+
4
+ ### Bug fix
5
+
6
+ Pass the indifferent access flag down the recursion.
7
+
1
8
  0.0.3 5/11/2016
9
+ ==============
2
10
 
3
11
  ### Features
4
12
 
@@ -37,9 +37,9 @@ module CamelSnakeKeys
37
37
 
38
38
  def snake_keys(data, indifference=false)
39
39
  if data.kind_of? Array
40
- data.map { |v| snake_keys(v) }
40
+ data.map { |v| snake_keys(v, indifference) }
41
41
  elsif data.kind_of? Hash
42
- hash = Hash[data.sort_by {|k,_v| k =~ /_/ ? 0 : 1 }.map {|k, v| [if_underscore(k), snake_keys(v)] }]
42
+ hash = Hash[data.sort_by {|k,_v| k =~ /_/ ? 0 : 1 }.map {|k, v| [if_underscore(k), snake_keys(v, indifference)] }]
43
43
  hash = hash.with_indifferent_access if indifference
44
44
  data.class == Hash ? hash : data.class.new(hash)
45
45
  else
@@ -49,9 +49,9 @@ module CamelSnakeKeys
49
49
 
50
50
  def camel_keys(data, indifference=false)
51
51
  if data.kind_of? Array
52
- data.map { |v| camel_keys(v) }
52
+ data.map { |v| camel_keys(v, indifference) }
53
53
  elsif data.kind_of? Hash
54
- hash = Hash[data.sort_by {|k,_v| k =~ /_/ ? 1 : 0 }.map {|k, v| [if_camelize(k), camel_keys(v)] }]
54
+ hash = Hash[data.sort_by {|k,_v| k =~ /_/ ? 1 : 0 }.map {|k, v| [if_camelize(k), camel_keys(v, indifference)] }]
55
55
  hash = hash.with_indifferent_access if indifference
56
56
  data.class == Hash ? hash : data.class.new(hash)
57
57
  else
@@ -1,5 +1,5 @@
1
1
  module CamelSnakeKeys
2
- VERSION = "0.0.5".freeze
2
+ VERSION = "0.0.6".freeze
3
3
 
4
4
  def self.version
5
5
  VERSION
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: camel_snake_keys
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Buermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-06 00:00:00.000000000 Z
11
+ date: 2020-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -62,6 +62,7 @@ files:
62
62
  - ".coveralls.yml"
63
63
  - ".gitignore"
64
64
  - ".rubocop.yml"
65
+ - ".ruby-version"
65
66
  - ".travis.yml"
66
67
  - CHANGELOG.md
67
68
  - Gemfile
@@ -91,8 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
92
  - !ruby/object:Gem::Version
92
93
  version: '0'
93
94
  requirements: []
94
- rubyforge_project:
95
- rubygems_version: 2.6.10
95
+ rubygems_version: 3.1.2
96
96
  signing_key:
97
97
  specification_version: 4
98
98
  summary: Convert nested data structure hash keys between camel and snake case.