parallel588-klaviyo 0.14.3 → 0.15.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
- SHA1:
3
- metadata.gz: 39ef11999bcc95260bc661177337f868bc99e72c
4
- data.tar.gz: 61631a58d31a0f383eddaf664002ff482bf5ba8f
2
+ SHA256:
3
+ metadata.gz: 4b05296e28eda5f1953c0b0ab8d9aa195ab391dd179faefefcee0e99b71d6005
4
+ data.tar.gz: 0406daea14c4565221544bfeefbb1c552cdc22acda7cff64f31db138b73e5fbd
5
5
  SHA512:
6
- metadata.gz: eb39cf223b8c2b7b19a6a0b7a3e4f349a12e5d875b9690f977d16f883139499d71cf8c704ed01ccb4bc3418e31a87d9fe9849120124b4d601da4ff315027dc99
7
- data.tar.gz: aaed3550df167ae4bd073abe19baec81f536f7cf2c0bfd2c69347779db2ab5fdb416be957e07d40427b4a936151eee4521dc1417daa69ca5f2cab15a041e06ff
6
+ metadata.gz: ec912786cc67503a57994b40184734307de609559720ed062a5f72b3d8a41beba4bd2ec095b43d7dcc13a8feaaa373ed72cb50fda46ee21c468a5c3626221963
7
+ data.tar.gz: 0cd64fad5eed6ed748fb5dc57e4b6027331ad18dbd9aa84a1ec2eef9577457fc0a6b61f9336b40152f6c27b68585eb63cf9f8b05fe6a18016df37c57c870f5f3
@@ -19,12 +19,12 @@ Gem::Specification.new do |spec|
19
19
 
20
20
  spec.add_runtime_dependency('virtus', '>= 1.0')
21
21
  spec.add_runtime_dependency('json', '>= 1.7')
22
- spec.add_runtime_dependency('faraday', '>= 0.9.2')
23
- spec.add_runtime_dependency('faraday_middleware', '>= 0.10')
24
- spec.add_runtime_dependency('activesupport', ['>= 3.1', '< 6.0'])
22
+ spec.add_runtime_dependency('faraday', '~> 0.15.4')
23
+ spec.add_runtime_dependency('multi_json', '~> 1.13')
24
+ spec.add_runtime_dependency('activesupport', ['>= 3.1', '< 7.0'])
25
25
 
26
26
  spec.add_development_dependency 'bundler', '~> 1.11'
27
- spec.add_development_dependency 'rake', '~> 10.0'
27
+ spec.add_development_dependency 'rake', '~> 12.3', '>= 12.3.3'
28
28
  spec.add_development_dependency 'rspec', '~> 3.0'
29
29
  spec.add_development_dependency 'pry', '~> 0.10.3'
30
30
  spec.add_development_dependency 'webmock', '~> 2.0', '>= 2.0.3'
@@ -3,7 +3,7 @@ require 'klaviyo/version'
3
3
  require 'active_support'
4
4
  require 'active_support/core_ext'
5
5
  require 'faraday'
6
- require 'faraday_middleware'
6
+ require 'multi_json'
7
7
  require 'json'
8
8
  require 'virtus'
9
9
 
@@ -14,12 +14,10 @@ module Klaviyo
14
14
  raise Errors::AuthenticationError, 'No Token provided.' unless @token
15
15
 
16
16
  @conn = Faraday.new(default_req_options.merge(req_options)) do |f|
17
- f.headers['Accept'] = 'application/json'
18
- f.request :url_encoded
19
- f.response :logger
20
- f.response :json, content_type: 'application/json'
21
- f.adapter Faraday.default_adapter
17
+ f.request :url_encoded
18
+
22
19
  f.use Errors::RequestError
20
+ f.adapter Faraday.default_adapter
23
21
  end
24
22
  end
25
23
 
@@ -21,7 +21,8 @@ module Klaviyo
21
21
 
22
22
  attr_reader :meta, :items
23
23
 
24
- def initialize(data)
24
+ def initialize(raw_data)
25
+ data = raw_data.is_a?(String) ? MultiJson.load(raw_data) : raw_data
25
26
  @items = data.delete('data').map { |attrs| Klaviyo::Resource.build(attrs) }
26
27
  @meta = data
27
28
  end
@@ -36,8 +37,8 @@ module Klaviyo
36
37
  class Folder < KlaviyoObject; end
37
38
  class Membership < KlaviyoObject; end
38
39
 
39
- def self.build(attrs)
40
-
40
+ def self.build(params)
41
+ attrs = params.is_a?(String) ? MultiJson.load(params) : params
41
42
  object = attrs.delete('object')
42
43
  case object.to_s
43
44
  when 'person'
@@ -1,3 +1,3 @@
1
1
  module Klaviyo
2
- VERSION = "0.14.3"
2
+ VERSION = "0.15.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parallel588-klaviyo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.3
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maxim Pechnikov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-20 00:00:00.000000000 Z
11
+ date: 2020-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: virtus
@@ -42,30 +42,30 @@ dependencies:
42
42
  name: faraday
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.9.2
47
+ version: 0.15.4
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.9.2
54
+ version: 0.15.4
55
55
  - !ruby/object:Gem::Dependency
56
- name: faraday_middleware
56
+ name: multi_json
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0.10'
61
+ version: '1.13'
62
62
  type: :runtime
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.10'
68
+ version: '1.13'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: activesupport
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -75,7 +75,7 @@ dependencies:
75
75
  version: '3.1'
76
76
  - - "<"
77
77
  - !ruby/object:Gem::Version
78
- version: '6.0'
78
+ version: '7.0'
79
79
  type: :runtime
80
80
  prerelease: false
81
81
  version_requirements: !ruby/object:Gem::Requirement
@@ -85,7 +85,7 @@ dependencies:
85
85
  version: '3.1'
86
86
  - - "<"
87
87
  - !ruby/object:Gem::Version
88
- version: '6.0'
88
+ version: '7.0'
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: bundler
91
91
  requirement: !ruby/object:Gem::Requirement
@@ -106,14 +106,20 @@ dependencies:
106
106
  requirements:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: '10.0'
109
+ version: '12.3'
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: 12.3.3
110
113
  type: :development
111
114
  prerelease: false
112
115
  version_requirements: !ruby/object:Gem::Requirement
113
116
  requirements:
114
117
  - - "~>"
115
118
  - !ruby/object:Gem::Version
116
- version: '10.0'
119
+ version: '12.3'
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: 12.3.3
117
123
  - !ruby/object:Gem::Dependency
118
124
  name: rspec
119
125
  requirement: !ruby/object:Gem::Requirement
@@ -213,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
213
219
  version: '0'
214
220
  requirements: []
215
221
  rubyforge_project:
216
- rubygems_version: 2.5.2
222
+ rubygems_version: 2.7.3
217
223
  signing_key:
218
224
  specification_version: 4
219
225
  summary: You heard us, a Ruby wrapper for the Klaviyo API