6px 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/lib/6px/client.rb +12 -6
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
YWQ4OTEyNWJkYWM2MmNkNzI0NzQ3YjcxMTM4Mjg3OGM1MmVlZDEzMg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
Yzg3NWIxZDc2ZTcyNzk4YzhlNjJkMDVjOGExNWM5MmUyNDkzM2E3Nw==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NmYxMWE3N2E2NWMzZjAzZmU5ZGNhZjdkM2U1MzllNmQ0Nzg0OTJmZTcwN2I2
|
10
|
+
MjM0NzZjNzRlYThmYjQ1ZDA0NjQxMzI3MjAxMDYxMmVlMTM0MzFiNjZiZGI5
|
11
|
+
ODE3NzFlODM5MzUxZjY0NzlmNWNhMjRjOGRjYjI5YmFlMzhiOTg=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ZDA0NDE0NmIzZTM5NGY3Yzc3NDc2MjI3NzhkNjI3MWI0MmNhOTJkYWVlYmM5
|
14
|
+
ZmY4NmMyM2UzM2FkZDBiMDg0M2MzNzI1YjQ2MmI2Mzc3ZjcyNGFkOWQ5NGUy
|
15
|
+
OWZhNmM2NzIxM2I3Y2Y5ZDBmY2Y4ZTE3ZGMzYjdmZDY0NTdkN2Y=
|
data/lib/6px/client.rb
CHANGED
@@ -40,9 +40,10 @@ class PX
|
|
40
40
|
|
41
41
|
@output = {
|
42
42
|
ref: images,
|
43
|
-
type: '
|
43
|
+
type: 'image/jpeg',
|
44
44
|
url: '',
|
45
|
-
methods: []
|
45
|
+
methods: [],
|
46
|
+
tag: ''
|
46
47
|
}
|
47
48
|
|
48
49
|
self
|
@@ -70,6 +71,11 @@ class PX
|
|
70
71
|
self
|
71
72
|
end
|
72
73
|
|
74
|
+
def tag(tag)
|
75
|
+
@output[:tag] = tag
|
76
|
+
self
|
77
|
+
end
|
78
|
+
|
73
79
|
# Sets additional data on job
|
74
80
|
def data(data)
|
75
81
|
@data = data
|
@@ -116,7 +122,7 @@ class PX
|
|
116
122
|
image_type = image_type(url)
|
117
123
|
encoded_image = Base64.encode64(raw_image)
|
118
124
|
|
119
|
-
"
|
125
|
+
"data:#{image_type};base64,#{encoded_image}"
|
120
126
|
end
|
121
127
|
|
122
128
|
def image_type(path)
|
@@ -124,9 +130,9 @@ class PX
|
|
124
130
|
jpg = Regexp.new("\xff\xd8\xff\xe0\x00\x10JFIF".force_encoding("binary"))
|
125
131
|
jpg2 = Regexp.new("\xff\xd8\xff\xe1(.*){2}Exif".force_encoding("binary"))
|
126
132
|
case IO.read(path, 10)
|
127
|
-
when /^GIF8/ then '
|
128
|
-
when /^#{png}/ then '
|
129
|
-
when /^#{jpg}/, /^#{jpg2}/ then '
|
133
|
+
when /^GIF8/ then 'image/gif'
|
134
|
+
when /^#{png}/ then 'image/png'
|
135
|
+
when /^#{jpg}/, /^#{jpg2}/ then 'image/jpg'
|
130
136
|
end
|
131
137
|
end
|
132
138
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: 6px
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Leonard
|
@@ -14,28 +14,28 @@ dependencies:
|
|
14
14
|
name: httparty
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0.3'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: json
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.6'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.6'
|
41
41
|
description: Ruby wrapper for 6px's API
|
@@ -56,12 +56,12 @@ require_paths:
|
|
56
56
|
- lib
|
57
57
|
required_ruby_version: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
63
63
|
requirements:
|
64
|
-
- -
|
64
|
+
- - ! '>='
|
65
65
|
- !ruby/object:Gem::Version
|
66
66
|
version: '0'
|
67
67
|
requirements: []
|