live_paper 0.0.1 → 0.0.2

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
2
  SHA1:
3
- metadata.gz: cdac946c63ee00fa820eb93e33ba775b3cc8bd80
4
- data.tar.gz: e30dda90cb7b7e1362e874cfe5c7f9a746f80a7b
3
+ metadata.gz: 094d1ab2992698b7f3c00d0243817276e88a5dbe
4
+ data.tar.gz: b60bc9c6f736b8430dc006e382c160e13c1ad6e6
5
5
  SHA512:
6
- metadata.gz: fd833ac68cfdc1c57d2276439fccc6b58e891bcd5b34acc71c773c3a2ae39c4b4381060a48843a53dfdec069a19edaab41733391a8401f257354a1c85057ae46
7
- data.tar.gz: f38360db944f969be80ef41d872357230ac1a9a9b6e4491167ee95c3de4f54a106fba014920a0781126022cbd3e20ffccbcec5a838ac0c23ecef068e69633839
6
+ metadata.gz: fb0a65ccbc4b3db5190d7e91b09d446c8923eff5e8414d83652245238d84b992e81199c076ce02d32c4161cca18077afbd02010d2edbf7cff533ff325f0b64ce
7
+ data.tar.gz: f24d967a52723f79bb539b7c0ca064850a827db911f1d05a0abef23e8bc96de9bde3a039c0a218bdccec3f6bd4c56abbc69f33f766806c73be73b1b80784d13b
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Provides a ruby interface to the Live Paper service by HP for creating watermarked images, QR codes, and mobile-friendly shortened URLs.
4
4
 
5
+ [![Gem Version](https://badge.fury.io/rb/live_paper.svg)](http://badge.fury.io/rb/live_paper)
6
+
5
7
 
6
8
  ## Installation
7
9
 
@@ -1,3 +1,3 @@
1
1
  module LivePaper
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/live_paper.rb CHANGED
@@ -34,13 +34,8 @@ module LivePaper
34
34
  def shorten(dest)
35
35
  #returns shortened url
36
36
  trig = trigger "shorturl"
37
- puts "Trigger: #{trig}"
38
-
39
37
  payoff = url_payoff dest
40
- puts "Payoff: #{payoff}"
41
-
42
- l = link(trig, payoff)
43
- puts "Link: #{l}"
38
+ link(trig, payoff)
44
39
 
45
40
  trig["link"].select { |item| item["rel"] == "shortURL" }.first["href"]
46
41
  end
@@ -48,32 +43,20 @@ module LivePaper
48
43
  def qr_bytes(dest)
49
44
  #returns shortened url
50
45
  trig = trigger "qrcode"
51
- puts "Trigger: #{trig}"
52
-
53
46
  payoff = url_payoff dest
54
- puts "Destination: #{dest}"
55
-
56
- l = link(trig, payoff)
57
- puts "Link: #{l}"
47
+ link(trig, payoff)
58
48
 
59
49
  img_loc = trig["link"].select { |item| item["rel"] == "image" }.first["href"]
60
-
61
50
  resp = RestClient.get(img_loc, {Authorization: api_headers[:Authorization], Accept: 'image/png'})
62
51
  resp.body
63
52
  end
64
53
 
65
54
  def watermark_bytes(dest, image_url)
66
55
  image = upload_image image_url
67
- puts "Source Image: #{image}"
68
56
 
69
57
  trig = trigger "watermark", watermark: {imageURL: image, resolution: "75", strength: "10"}
70
- puts "\nTrigger: #{trig}"
71
-
72
58
  payoff = url_payoff dest
73
- puts "\nDestination: #{dest}"
74
-
75
- l = link(trig, payoff)
76
- puts "\nLink: #{l}"
59
+ link(trig, payoff)
77
60
 
78
61
  img_loc = trig["link"].select { |item| item["rel"] == "image" }.first["href"]
79
62
  resp = RestClient.get(img_loc, Authorization: api_headers[:Authorization])
@@ -85,7 +68,6 @@ module LivePaper
85
68
 
86
69
  private
87
70
  def upload_image(img)
88
- puts "Upload Image #{img}"
89
71
  uri='https://storage.livepaperapi.com/objects/files'
90
72
  # return the original img uri if it is LPP storage
91
73
  if img.include? uri
data/live_paper.gemspec CHANGED
@@ -18,7 +18,8 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_development_dependency "rest-client"
21
+ spec.add_runtime_dependency "rest-client"
22
+
22
23
  spec.add_development_dependency "bundler", "~> 1.6"
23
24
  spec.add_development_dependency "rake"
24
25
  end
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.1
4
+ version: 0.0.2
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: 2014-06-18 00:00:00.000000000 Z
12
+ date: 2014-06-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
@@ -18,7 +18,7 @@ dependencies:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: '0'
21
- type: :development
21
+ type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements: