fullcontact 0.13.0 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -0
- data/fullcontact.gemspec +0 -1
- data/lib/faraday/response/rubyize.rb +0 -2
- data/lib/fullcontact.rb +1 -0
- data/lib/fullcontact/ext/hash/to_snake_keys.rb +41 -0
- data/lib/fullcontact/version.rb +1 -1
- metadata +24 -34
data/README.md
CHANGED
@@ -9,6 +9,8 @@ A Ruby wrapper for the [FullContact API](http://www.fullcontact.com/)
|
|
9
9
|
|
10
10
|
Changes
|
11
11
|
-------
|
12
|
+
- 0.14.0
|
13
|
+
- Remove `plissken` gem to support Rails 5 (#42)
|
12
14
|
- 0.13.0
|
13
15
|
- Raise `ArgumentError` if query by Facebook ID/username is used.
|
14
16
|
- Remove deprecated messages.
|
data/fullcontact.gemspec
CHANGED
@@ -13,7 +13,6 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.add_runtime_dependency 'hashie', ['>= 2.0', '< 4.0']
|
14
14
|
s.add_runtime_dependency 'faraday', '~> 0.9.0'
|
15
15
|
s.add_runtime_dependency 'faraday_middleware', '>= 0.9'
|
16
|
-
s.add_runtime_dependency 'plissken'
|
17
16
|
|
18
17
|
s.author = 'FullContact, Inc.'
|
19
18
|
s.description = %q{A Ruby wrapper for the FullContact API}
|
data/lib/fullcontact.rb
CHANGED
@@ -0,0 +1,41 @@
|
|
1
|
+
# Hash.to_snake_keys
|
2
|
+
class Hash
|
3
|
+
# Recursively converts CamelCase and camelBack JSON-style hash keys to
|
4
|
+
# Rubyish snake_case, suitable for use during instantiation of Ruby
|
5
|
+
# model attributes.
|
6
|
+
#
|
7
|
+
def to_snake_keys(value = self)
|
8
|
+
case value
|
9
|
+
when Array
|
10
|
+
value.map { |v| to_snake_keys(v) }
|
11
|
+
when Hash
|
12
|
+
snake_hash(value)
|
13
|
+
else
|
14
|
+
value
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def snake_hash(value)
|
21
|
+
Hash[value.map { |k, v| [underscore_key(k).to_sym, to_snake_keys(v)] }]
|
22
|
+
end
|
23
|
+
|
24
|
+
def underscore_key(k)
|
25
|
+
if k.is_a? Symbol
|
26
|
+
underscore(k.to_s).to_sym
|
27
|
+
elsif k.is_a? String
|
28
|
+
underscore(k)
|
29
|
+
else
|
30
|
+
k # Plissken can't snakify anything except strings and symbols
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def underscore(string)
|
35
|
+
string.gsub(/::/, '/')
|
36
|
+
.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
|
37
|
+
.gsub(/([a-z\d])([A-Z])/, '\1_\2')
|
38
|
+
.tr('-', '_')
|
39
|
+
.downcase
|
40
|
+
end
|
41
|
+
end
|
data/lib/fullcontact/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fullcontact
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.14.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-07-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: maruku
|
16
|
-
requirement: &
|
16
|
+
requirement: &70240872599500 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0.7'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70240872599500
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: nokogiri
|
27
|
-
requirement: &
|
27
|
+
requirement: &70240872599000 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '1.4'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70240872599000
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rake
|
38
|
-
requirement: &
|
38
|
+
requirement: &70240872598420 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0.9'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70240872598420
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rspec
|
49
|
-
requirement: &
|
49
|
+
requirement: &70240872597600 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '3.1'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70240872597600
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: simplecov
|
60
|
-
requirement: &
|
60
|
+
requirement: &70240872597140 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0.4'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70240872597140
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: webmock
|
71
|
-
requirement: &
|
71
|
+
requirement: &70240872596660 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '1.6'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70240872596660
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: yard
|
82
|
-
requirement: &
|
82
|
+
requirement: &70240872596120 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ~>
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: '0.7'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70240872596120
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: hashie
|
93
|
-
requirement: &
|
93
|
+
requirement: &70240872595560 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -101,10 +101,10 @@ dependencies:
|
|
101
101
|
version: '4.0'
|
102
102
|
type: :runtime
|
103
103
|
prerelease: false
|
104
|
-
version_requirements: *
|
104
|
+
version_requirements: *70240872595560
|
105
105
|
- !ruby/object:Gem::Dependency
|
106
106
|
name: faraday
|
107
|
-
requirement: &
|
107
|
+
requirement: &70240872594780 !ruby/object:Gem::Requirement
|
108
108
|
none: false
|
109
109
|
requirements:
|
110
110
|
- - ~>
|
@@ -112,10 +112,10 @@ dependencies:
|
|
112
112
|
version: 0.9.0
|
113
113
|
type: :runtime
|
114
114
|
prerelease: false
|
115
|
-
version_requirements: *
|
115
|
+
version_requirements: *70240872594780
|
116
116
|
- !ruby/object:Gem::Dependency
|
117
117
|
name: faraday_middleware
|
118
|
-
requirement: &
|
118
|
+
requirement: &70240872610680 !ruby/object:Gem::Requirement
|
119
119
|
none: false
|
120
120
|
requirements:
|
121
121
|
- - ! '>='
|
@@ -123,18 +123,7 @@ dependencies:
|
|
123
123
|
version: '0.9'
|
124
124
|
type: :runtime
|
125
125
|
prerelease: false
|
126
|
-
version_requirements: *
|
127
|
-
- !ruby/object:Gem::Dependency
|
128
|
-
name: plissken
|
129
|
-
requirement: &70101799100840 !ruby/object:Gem::Requirement
|
130
|
-
none: false
|
131
|
-
requirements:
|
132
|
-
- - ! '>='
|
133
|
-
- !ruby/object:Gem::Version
|
134
|
-
version: '0'
|
135
|
-
type: :runtime
|
136
|
-
prerelease: false
|
137
|
-
version_requirements: *70101799100840
|
126
|
+
version_requirements: *70240872610680
|
138
127
|
description: A Ruby wrapper for the FullContact API
|
139
128
|
email:
|
140
129
|
- support@fullcontact.com
|
@@ -163,6 +152,7 @@ files:
|
|
163
152
|
- lib/fullcontact/configuration.rb
|
164
153
|
- lib/fullcontact/connection.rb
|
165
154
|
- lib/fullcontact/error.rb
|
155
|
+
- lib/fullcontact/ext/hash/to_snake_keys.rb
|
166
156
|
- lib/fullcontact/request.rb
|
167
157
|
- lib/fullcontact/version.rb
|
168
158
|
- spec/faraday/response_spec.rb
|
@@ -191,7 +181,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
191
181
|
version: '0'
|
192
182
|
segments:
|
193
183
|
- 0
|
194
|
-
hash: -
|
184
|
+
hash: -3898038741122446836
|
195
185
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
196
186
|
none: false
|
197
187
|
requirements:
|