live_paper 0.0.32 → 0.0.33

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fcecf58dac7040fe27c0853853f7125c2a0fbf0a
4
- data.tar.gz: be2a76fa20d093f03cd050af0a6a53c1e249b48b
3
+ metadata.gz: 8ef86f233c31494853c8b8d46b6b373db61880c0
4
+ data.tar.gz: 67254dbdc1182a31356e480ab230eaf3797c19b8
5
5
  SHA512:
6
- metadata.gz: 2eb042a037a18cfbdf09dc739320dc72e69dc1edbb6330a9ad6cbfdee79301f477f9ec4dd89eeccbd499215367e18f86d7c109f7a2382e3473360ec459d77004
7
- data.tar.gz: c66086f3ccaae104be3fcccef70e6aae4089fae36218c1ccda4bf0883ecdd6680cef419ff03bd67a9b5d7ecf974d0f21736ffe16fd0989222f88496a990e0251
6
+ metadata.gz: 04fc1b241e2c8b4532be43969dc44411792715797f68726f28fe0f1bf2e2373a891a5aa3c8617f5026226c7d5b61a19439726727954f33da016110941d6960ce
7
+ data.tar.gz: cf961f72490664dfda4cbe7c82bb0609a0a382d2f2e443b12be0cf715dea9b95346b954c855948e63758e4865c40cb30ca2136c8ec916aac5aa752dcefc8934c
@@ -7,8 +7,8 @@ module LivePaper
7
7
  class BaseObject
8
8
 
9
9
  LP_API_HOST="https://www.livepaperapi.com"
10
- AUTH_URL = "#{LP_API_HOST}/auth/token"
11
- AUTH_VALIDATION_URL = "#{LP_API_HOST}/auth/v1/validate"
10
+ AUTH_URL = "#{LP_API_HOST}/auth/v2/token"
11
+ AUTH_VALIDATION_URL = "#{LP_API_HOST}/auth/v2/validate"
12
12
 
13
13
  attr_accessor :id, :name, :date_created, :date_modified, :link
14
14
 
@@ -1,3 +1,3 @@
1
1
  module LivePaper
2
- VERSION = "0.0.32"
2
+ VERSION = "0.0.33"
3
3
  end
@@ -20,7 +20,7 @@ describe LivePaper::BaseObject do
20
20
  let(:object) { LivePaper::BaseObject.new data }
21
21
 
22
22
  before do
23
- stub_request(:post, /.*livepaperapi.com\/auth\/token.*/).to_return(:body => lpp_auth_response_json, :status => 200)
23
+ stub_request(:post, /.*livepaperapi.com\/auth\/v2\/token.*/).to_return(:body => lpp_auth_response_json, :status => 200)
24
24
  stub_request(:post, api_url).to_return(:body => lpp_richpayoff_response_json, :status => 200)
25
25
  stub_request(:post, LivePaper::BaseObject::AUTH_VALIDATION_URL).to_return(:status => 201, :body => "", :headers => { project_id: 'pid'})
26
26
  end
@@ -230,8 +230,8 @@ end
230
230
  date_created: 'date_created',
231
231
  date_modified: 'date_modified',
232
232
  link: [
233
- {:rel => "self", :href => "/api/v1/objects/obj_id"},
234
- {:rel => "analytics", :href => "/analytics/v1/objects/obj_id"}
233
+ {:rel => "self", :href => "/api/v2/objects/obj_id"},
234
+ {:rel => "analytics", :href => "/analytics/v2/objects/obj_id"}
235
235
  ]
236
236
  }
237
237
  }
@@ -281,15 +281,15 @@ end
281
281
  date_created: 'date_created',
282
282
  date_modified: 'date_modified',
283
283
  link: [
284
- {:rel => "self", :href => "/api/v1/payoffs/payoff_id"},
285
- {:rel => "analytics", :href => "/analytics/v1/payoffs/payoff_id"}
284
+ {:rel => "self", :href => "/api/v2/payoffs/payoff_id"},
285
+ {:rel => "analytics", :href => "/analytics/v2/payoffs/payoff_id"}
286
286
  ]
287
287
  }
288
288
  @obj = LivePaper::BaseObject.create @data
289
289
  end
290
290
 
291
291
  it 'should return href for rel link' do
292
- expect(@obj.rel('self')).to eq '/api/v1/payoffs/payoff_id'
292
+ expect(@obj.rel('self')).to eq '/api/v2/payoffs/payoff_id'
293
293
  end
294
294
 
295
295
  it 'should return nil for unknown rel link' do
@@ -8,7 +8,7 @@ describe LivePaper::Image do
8
8
 
9
9
  stub_request(:post, LivePaper::Image::API_URL.gsub(/PROJECTID/,'pid')).
10
10
  with(:body => "YOURIMAGEBYTES",
11
- :headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip, deflate', 'Authorization'=>'Bearer YouBeenHacked', 'Content-Length'=>'14', 'Content-Type'=>'image/jpeg', 'User-Agent'=>'Ruby'}).
11
+ :headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip, deflate', 'Authorization'=>'Bearer YouBeenHacked', 'Content-Length'=>'14', 'Content-Type'=>'image/jpeg', 'User-Agent'=> /ruby/}).
12
12
  to_return(:status => 201, :body => "", :headers => {location: lpp_img_uri})
13
13
  stub_request(:post, LivePaper::BaseObject::AUTH_VALIDATION_URL).to_return(:status => 201, :body => "", :headers => { project_id: 'pid'})
14
14
  end
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe LivePaper::Link do
4
4
  before do
5
- stub_request(:post, /.*livepaperapi.com\/auth\/token.*/).to_return(:body => lpp_auth_response_json, :status => 200)
5
+ stub_request(:post, /.*livepaperapi.com\/auth\/v2\/token.*/).to_return(:body => lpp_auth_response_json, :status => 200)
6
6
  stub_request(:post, LivePaper::Link.api_url).to_return(:body => lpp_link_response_json, :status => 200)
7
7
  stub_request(:get, "#{LivePaper::Link.api_url}/link_id").to_return(:body => lpp_link_response_json, :status => 200)
8
8
  stub_request(:get, "#{LivePaper::Link.api_url}/link_not_existent").to_return(:body => '{}', :status => 404)
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe LivePaper::Payoff do
4
4
  before do
5
- stub_request(:post, /.*livepaperapi.com\/auth\/token.*/).to_return(:body => lpp_auth_response_json, :status => 200)
5
+ stub_request(:post, /.*livepaperapi.com\/auth\/v2\/token.*/).to_return(:body => lpp_auth_response_json, :status => 200)
6
6
  stub_request(:post, LivePaper::Payoff.api_url).to_return(:body => lpp_richpayoff_response_json, :status => 200)
7
7
  stub_request(:get, "#{LivePaper::Payoff.api_url}/payoff_id").to_return(:body => lpp_payoff_response_json, :status => 200)
8
8
  stub_request(:get, "#{LivePaper::Payoff.api_url}/payoff_not_existent").to_return(:body => '{}', :status => 404)
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- DOWNLOAD_URL = "https://watermark.livepaperapi.com/watermark/v1/triggers"
3
+ DOWNLOAD_URL = "https://watermark.livepaperapi.com/watermark/v2/triggers"
4
4
 
5
5
  describe LivePaper::WmTrigger do
6
6
  let(:start_date) { "my_start_date" }
@@ -15,7 +15,7 @@ describe LivePaper::WmTrigger do
15
15
  }
16
16
 
17
17
  before do
18
- stub_request(:post, /.*livepaperapi.com\/auth\/token.*/).to_return(:body => lpp_auth_response_json, :status => 200)
18
+ stub_request(:post, /.*livepaperapi.com\/auth\/v2\/token.*/).to_return(:body => lpp_auth_response_json, :status => 200)
19
19
  stub_request(:post, LivePaper::WmTrigger.api_url).to_return(:body => lpp_trigger_response_json, :status => 200)
20
20
  stub_request(:get, "#{LivePaper::WmTrigger.api_url}/trigger_id").to_return(:body => lpp_trigger_response_json, :status => 200)
21
21
  stub_request(:get, "#{LivePaper::WmTrigger.api_url}/trigger_not_existent").to_return(:body => '{}', :status => 404)
@@ -1,5 +1,5 @@
1
- require "codeclimate-test-reporter"
2
- CodeClimate::TestReporter.start
1
+ require 'simplecov'
2
+ SimpleCov.start
3
3
 
4
4
  require 'live_paper'
5
5
 
@@ -34,11 +34,11 @@ def lpp_richpayoff_response_json
34
34
  "link":[
35
35
  {
36
36
  "rel":"self",
37
- "href":"/api/v1/payoffs/payoff_id"
37
+ "href":"/api/v2/payoffs/payoff_id"
38
38
  },
39
39
  {
40
40
  "rel":"analytics",
41
- "href":"/analytics/v1/payoffs/payoff_id"
41
+ "href":"/analytics/v2/payoffs/payoff_id"
42
42
  }
43
43
  ],
44
44
  "richPayoff" : {
@@ -65,8 +65,8 @@ def lpp_trigger_response_json(type='watermark')
65
65
  "dateCreated": "2014-10-08T22:06:28.518+0000",
66
66
  "dateModified": "2014-10-08T22:06:28.518+0000",
67
67
  "link": [
68
- {"rel":"self", "href": "https://www.livepaperapi.com/api/v1/triggers/trigger_id"},
69
- {"rel":"analytics", "href": "https://www.livepaperapi.com/analytics/v1/triggers/trigger_id"},
68
+ {"rel":"self", "href": "https://www.livepaperapi.com/api/v2/triggers/trigger_id"},
69
+ {"rel":"analytics", "href": "https://www.livepaperapi.com/analytics/v2/triggers/trigger_id"},
70
70
  {"rel":"download", "href": "https://fileapi/trigger_id/image"},
71
71
  {"rel":"shortURL", "href": "http://hpgo.co/abc123"}
72
72
  ],
@@ -119,7 +119,7 @@ def lpp_delete_error_response
119
119
  { "associatedLinks": "1",
120
120
  "link": [{
121
121
  "rel": "associatedLinks",
122
- "href": "https://dev.livepaperapi.com/api/v1/links?trigger=my_trigger_id"
122
+ "href": "https://dev.livepaperapi.com/api/v2/links?trigger=my_trigger_id"
123
123
  }],
124
124
  "error": {
125
125
  "title": "409 Conflict",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: live_paper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.32
4
+ version: 0.0.33
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Whitmarsh
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-11-16 00:00:00.000000000 Z
12
+ date: 2017-01-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -190,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
190
  version: '0'
191
191
  requirements: []
192
192
  rubyforge_project:
193
- rubygems_version: 2.4.6
193
+ rubygems_version: 2.4.8
194
194
  signing_key:
195
195
  specification_version: 4
196
196
  summary: Ruby interface to the Live Paper service by HP.