ruby-pardot 1.1.0 → 1.2.0
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 +5 -5
- data/Gemfile.lock +7 -7
- data/lib/pardot/authentication.rb +1 -1
- data/lib/pardot/http.rb +2 -2
- data/lib/pardot/version.rb +1 -1
- data/ruby-pardot.gemspec +4 -4
- data/spec/pardot/authentication_spec.rb +16 -2
- metadata +15 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 33f862629251e35bc4abea0f50af5fbd34e83d2b561529107dda17f5c5fe5bf8
|
4
|
+
data.tar.gz: 773061f478695e10e26c2f17ea36ba1a81ee2a241797426e1581a02ac59f24d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 439fc348827c87938b93035b7b1d6bcdb6a043e49897041b9b45029b9f95dd3b562db3a3cad345b58dde4b9bb0c21823d311f18c90d4f593562b8d7e695f7f29
|
7
|
+
data.tar.gz: b63c4c6083d3c86d2204ea43638a3133bf619a746d5c355d29a47c4c2dd326a68e1a5a77322183655829be0d0959b335a67f816a5bd7ad30609ef23b7b4325e3
|
data/Gemfile.lock
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ruby-pardot (1.
|
5
|
-
crack
|
6
|
-
httparty
|
4
|
+
ruby-pardot (1.2.0)
|
5
|
+
crack (= 0.4.3)
|
6
|
+
httparty (= 0.13.1)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: http://rubygems.org/
|
10
10
|
specs:
|
11
|
-
crack (0.4.
|
11
|
+
crack (0.4.3)
|
12
12
|
safe_yaml (~> 1.0.0)
|
13
13
|
diff-lcs (1.1.2)
|
14
14
|
fakeweb (1.3.0)
|
15
15
|
httparty (0.13.1)
|
16
16
|
json (~> 1.8)
|
17
17
|
multi_xml (>= 0.5.2)
|
18
|
-
json (1.8.
|
19
|
-
multi_xml (0.
|
18
|
+
json (1.8.6)
|
19
|
+
multi_xml (0.6.0)
|
20
20
|
rspec (2.5.0)
|
21
21
|
rspec-core (~> 2.5.0)
|
22
22
|
rspec-expectations (~> 2.5.0)
|
@@ -37,4 +37,4 @@ DEPENDENCIES
|
|
37
37
|
ruby-pardot!
|
38
38
|
|
39
39
|
BUNDLED WITH
|
40
|
-
|
40
|
+
2.0.1
|
@@ -2,7 +2,7 @@ module Pardot
|
|
2
2
|
module Authentication
|
3
3
|
|
4
4
|
def authenticate
|
5
|
-
resp = post "login", nil, :email => @email, :password => @password, :user_key => @user_key
|
5
|
+
resp = post "login", nil, nil, nil, :email => @email, :password => @password, :user_key => @user_key
|
6
6
|
update_version(resp["version"]) if resp && resp["version"]
|
7
7
|
@api_key = resp && resp["api_key"]
|
8
8
|
end
|
data/lib/pardot/http.rb
CHANGED
@@ -13,10 +13,10 @@ module Pardot
|
|
13
13
|
raise Pardot::NetError.new(e)
|
14
14
|
end
|
15
15
|
|
16
|
-
def post object, path, params = {}, num_retries = 0
|
16
|
+
def post object, path, params = {}, num_retries = 0, bodyParams = {}
|
17
17
|
smooth_params object, params
|
18
18
|
full_path = fullpath object, path
|
19
|
-
check_response self.class.post(full_path, :query => params)
|
19
|
+
check_response self.class.post(full_path, :query => params, :body => bodyParams)
|
20
20
|
|
21
21
|
rescue Pardot::ExpiredApiKeyError => e
|
22
22
|
handle_expired_api_key :post, object, path, params, num_retries, e
|
data/lib/pardot/version.rb
CHANGED
data/ruby-pardot.gemspec
CHANGED
@@ -5,8 +5,8 @@ Gem::Specification.new do |s|
|
|
5
5
|
s.name = "ruby-pardot"
|
6
6
|
s.version = Pardot::VERSION
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
|
-
s.authors = ["Dan Cunning"]
|
9
|
-
s.email = ["support@pardot.com"]
|
8
|
+
s.authors = ["Dan Cunning", "Chris Little", "Justin Roberts"]
|
9
|
+
s.email = ["support@pardot.com", "chris.little@salesforce.com", "justin.roberts@salesforce.com"]
|
10
10
|
s.homepage = "http://github.com/pardot/ruby-pardot"
|
11
11
|
s.summary = "Library for interacting with the Pardot API"
|
12
12
|
s.description = "Library for interacting with the Pardot API"
|
@@ -14,8 +14,8 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.required_rubygems_version = ">= 1.3.6"
|
15
15
|
s.rubyforge_project = "ruby-pardot"
|
16
16
|
|
17
|
-
s.add_dependency "crack"
|
18
|
-
s.add_dependency "httparty"
|
17
|
+
s.add_dependency "crack", "0.4.3"
|
18
|
+
s.add_dependency "httparty", "0.13.1"
|
19
19
|
|
20
20
|
s.add_development_dependency "bundler", ">= 1.10"
|
21
21
|
s.add_development_dependency "rspec"
|
@@ -11,13 +11,17 @@ describe Pardot::Authentication do
|
|
11
11
|
before do
|
12
12
|
@client = create_client
|
13
13
|
|
14
|
-
fake_post "/api/login/version/3
|
14
|
+
fake_post "/api/login/version/3",
|
15
15
|
%(<?xml version="1.0" encoding="UTF-8"?>\n<rsp stat="ok" version="1.0">\n <api_key>my_api_key</api_key>\n</rsp>\n)
|
16
16
|
end
|
17
17
|
|
18
18
|
def authenticate
|
19
19
|
@client.authenticate
|
20
20
|
end
|
21
|
+
|
22
|
+
def verifyBody
|
23
|
+
FakeWeb.last_request.body.should == 'email=user%40test.com&password=foo&user_key=bar'
|
24
|
+
end
|
21
25
|
|
22
26
|
it "should return the api key" do
|
23
27
|
authenticate.should == "my_api_key"
|
@@ -26,16 +30,19 @@ describe Pardot::Authentication do
|
|
26
30
|
it "should set the api key" do
|
27
31
|
authenticate
|
28
32
|
@client.api_key.should == "my_api_key"
|
33
|
+
verifyBody
|
29
34
|
end
|
30
35
|
|
31
36
|
it "should make authenticated? true" do
|
32
37
|
authenticate
|
33
38
|
@client.authenticated?.should == true
|
39
|
+
verifyBody
|
34
40
|
end
|
35
41
|
|
36
42
|
it "should use version 3" do
|
37
43
|
authenticate
|
38
44
|
@client.version.to_i.should == 3
|
45
|
+
verifyBody
|
39
46
|
end
|
40
47
|
|
41
48
|
end
|
@@ -45,13 +52,17 @@ describe Pardot::Authentication do
|
|
45
52
|
before do
|
46
53
|
@client = create_client
|
47
54
|
|
48
|
-
fake_post "/api/login/version/3
|
55
|
+
fake_post "/api/login/version/3",
|
49
56
|
%(<?xml version="1.0" encoding="UTF-8"?>\n<rsp stat="ok" version="1.0">\n <api_key>my_api_key</api_key>\n<version>4</version>\n</rsp>\n)
|
50
57
|
end
|
51
58
|
|
52
59
|
def authenticate
|
53
60
|
@client.authenticate
|
54
61
|
end
|
62
|
+
|
63
|
+
def verifyBody
|
64
|
+
FakeWeb.last_request.body.should == 'email=user%40test.com&password=foo&user_key=bar'
|
65
|
+
end
|
55
66
|
|
56
67
|
it "should return the api key" do
|
57
68
|
authenticate.should == "my_api_key"
|
@@ -60,16 +71,19 @@ describe Pardot::Authentication do
|
|
60
71
|
it "should set the api key" do
|
61
72
|
authenticate
|
62
73
|
@client.api_key.should == "my_api_key"
|
74
|
+
verifyBody
|
63
75
|
end
|
64
76
|
|
65
77
|
it "should make authenticated? true" do
|
66
78
|
authenticate
|
67
79
|
@client.authenticated?.should == true
|
80
|
+
verifyBody
|
68
81
|
end
|
69
82
|
|
70
83
|
it "should use version 4" do
|
71
84
|
authenticate
|
72
85
|
@client.version.to_i.should == 4
|
86
|
+
verifyBody
|
73
87
|
end
|
74
88
|
|
75
89
|
end
|
metadata
CHANGED
@@ -1,43 +1,45 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-pardot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Cunning
|
8
|
+
- Chris Little
|
9
|
+
- Justin Roberts
|
8
10
|
autorequire:
|
9
11
|
bindir: bin
|
10
12
|
cert_chain: []
|
11
|
-
date:
|
13
|
+
date: 2019-02-08 00:00:00.000000000 Z
|
12
14
|
dependencies:
|
13
15
|
- !ruby/object:Gem::Dependency
|
14
16
|
name: crack
|
15
17
|
requirement: !ruby/object:Gem::Requirement
|
16
18
|
requirements:
|
17
|
-
- -
|
19
|
+
- - '='
|
18
20
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
21
|
+
version: 0.4.3
|
20
22
|
type: :runtime
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
23
25
|
requirements:
|
24
|
-
- -
|
26
|
+
- - '='
|
25
27
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
28
|
+
version: 0.4.3
|
27
29
|
- !ruby/object:Gem::Dependency
|
28
30
|
name: httparty
|
29
31
|
requirement: !ruby/object:Gem::Requirement
|
30
32
|
requirements:
|
31
|
-
- -
|
33
|
+
- - '='
|
32
34
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
35
|
+
version: 0.13.1
|
34
36
|
type: :runtime
|
35
37
|
prerelease: false
|
36
38
|
version_requirements: !ruby/object:Gem::Requirement
|
37
39
|
requirements:
|
38
|
-
- -
|
40
|
+
- - '='
|
39
41
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
42
|
+
version: 0.13.1
|
41
43
|
- !ruby/object:Gem::Dependency
|
42
44
|
name: bundler
|
43
45
|
requirement: !ruby/object:Gem::Requirement
|
@@ -83,6 +85,8 @@ dependencies:
|
|
83
85
|
description: Library for interacting with the Pardot API
|
84
86
|
email:
|
85
87
|
- support@pardot.com
|
88
|
+
- chris.little@salesforce.com
|
89
|
+
- justin.roberts@salesforce.com
|
86
90
|
executables: []
|
87
91
|
extensions: []
|
88
92
|
extra_rdoc_files: []
|
@@ -144,8 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
148
|
- !ruby/object:Gem::Version
|
145
149
|
version: 1.3.6
|
146
150
|
requirements: []
|
147
|
-
|
148
|
-
rubygems_version: 2.5.1
|
151
|
+
rubygems_version: 3.0.2
|
149
152
|
signing_key:
|
150
153
|
specification_version: 4
|
151
154
|
summary: Library for interacting with the Pardot API
|