blitline 2.7.0 → 2.8.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c6f8526e89387132b5400a1d2c21e5ca5bbc88a1
4
- data.tar.gz: edf00bc96d398976cb4c2aa6be0c747d6808602a
3
+ metadata.gz: aa6c46eb5a368e561534fa855f33d7ecf8f703f3
4
+ data.tar.gz: cf1ec7aa89bc94968ec4dbe3ba9913ade1e6d95c
5
5
  SHA512:
6
- metadata.gz: 968185ef0b3f27b54c9abc51e206c10283d362d9576dd4f8ba35d9e72025b6c3a46636bdedd1db5450b9e2827f598761a537c98484abac88e798f0b4210727bb
7
- data.tar.gz: 2f41599eb183245428699a57f21a0baf8a5a738545df47feac81066717b0eec624a95ee0672fff6d54c3ac8a3694b6bfdf2f4b9b5cf5a82f01fa212fdccaa728
6
+ metadata.gz: 162525047ad185e91175350fb0cc60f0f7fb6c74f27ee8186686cfc4ead04f1e313a9a4a14b544ccfa46f39c91665cd02076272b02f7e2e53599dd2c19024d46
7
+ data.tar.gz: a8b3588d75ed7b72b279399411c77d942a630cc2596d7db4c13ecb5ba6938df635ea63d32063053ddcd73a58944f935f77dc060849297fe96232f3273f069a24
data/Gemfile CHANGED
@@ -8,6 +8,8 @@ source "http://rubygems.org"
8
8
  group :development do
9
9
  gem "shoulda", ">= 0"
10
10
  gem "jeweler"
11
+ gem 'test-unit'
11
12
  end
12
13
 
14
+
13
15
  gem 'multi_json'
@@ -33,11 +33,14 @@ GEM
33
33
  oauth2 (0.5.2)
34
34
  faraday (~> 0.7)
35
35
  multi_json (~> 1.0)
36
+ power_assert (0.2.2)
36
37
  rack (1.5.2)
37
38
  rake (10.1.1)
38
39
  rdoc (4.1.1)
39
40
  json (~> 1.4)
40
41
  shoulda (2.11.3)
42
+ test-unit (3.0.8)
43
+ power_assert
41
44
 
42
45
  PLATFORMS
43
46
  ruby
@@ -46,3 +49,7 @@ DEPENDENCIES
46
49
  jeweler
47
50
  multi_json
48
51
  shoulda
52
+ test-unit
53
+
54
+ BUNDLED WITH
55
+ 1.11.2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.7.0
1
+ 2.8.0
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: blitline 2.7.0 ruby lib
5
+ # stub: blitline 2.8.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "blitline"
9
- s.version = "2.7.0"
9
+ s.version = "2.8.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Blitline LLC"]
14
- s.date = "2015-08-27"
14
+ s.date = "2016-04-02"
15
15
  s.description = "The blitline gems provides a simple easy wrapper to the Blitline.com web api"
16
16
  s.email = "support@blitline.com"
17
17
  s.extra_rdoc_files = [
@@ -40,7 +40,7 @@ Gem::Specification.new do |s|
40
40
  ]
41
41
  s.homepage = "http://github.com/blitline-dev/blitline"
42
42
  s.licenses = ["MIT"]
43
- s.rubygems_version = "2.4.5"
43
+ s.rubygems_version = "2.4.8"
44
44
  s.summary = "Blitline provides simple image processing in the cloud"
45
45
 
46
46
  if s.respond_to? :specification_version then
@@ -50,15 +50,18 @@ Gem::Specification.new do |s|
50
50
  s.add_runtime_dependency(%q<multi_json>, [">= 0"])
51
51
  s.add_development_dependency(%q<shoulda>, [">= 0"])
52
52
  s.add_development_dependency(%q<jeweler>, [">= 0"])
53
+ s.add_development_dependency(%q<test-unit>, [">= 0"])
53
54
  else
54
55
  s.add_dependency(%q<multi_json>, [">= 0"])
55
56
  s.add_dependency(%q<shoulda>, [">= 0"])
56
57
  s.add_dependency(%q<jeweler>, [">= 0"])
58
+ s.add_dependency(%q<test-unit>, [">= 0"])
57
59
  end
58
60
  else
59
61
  s.add_dependency(%q<multi_json>, [">= 0"])
60
62
  s.add_dependency(%q<shoulda>, [">= 0"])
61
63
  s.add_dependency(%q<jeweler>, [">= 0"])
64
+ s.add_dependency(%q<test-unit>, [">= 0"])
62
65
  end
63
66
  end
64
67
 
@@ -71,13 +71,18 @@ class Blitline
71
71
  end
72
72
 
73
73
  raise "Error posting job: #{result.to_s}" if result["error"]
74
- job_id = json_result["results"][0]["job_id"]
74
+
75
+ # handle async group jobs if existing
76
+ job_id = json_result["results"][0]["group_completion_job_id"]
77
+ # otherwise assume regular job poll
78
+ job_id = json_result["results"][0]["job_id"] unless job_id
75
79
  return poll_job(job_id, timeout_secs)
76
80
  end
77
81
 
78
82
  def poll_job(job_id, timeout_secs = 60)
79
83
  raise "Invalid 'job_id'" unless job_id && job_id.length > 0
80
84
  url = "/listen/#{job_id}"
85
+
81
86
  response = fetch(url, timeout_secs)
82
87
 
83
88
  if response.is_a?(Hash)
@@ -29,17 +29,6 @@ class TestBlitline < Test::Unit::TestCase
29
29
  end
30
30
  end
31
31
 
32
- should "raise exception if job missing image identifier" do
33
- assert_raises RuntimeError do
34
- blitline = Blitline.new
35
- job = Blitline::Job.new("http://ww.foo.com")
36
- job.application_id = "foo"
37
- job.add_function("blur", nil, "my_image")
38
- blitline.jobs << job
39
- results = blitline.post_jobs
40
- end
41
- end
42
-
43
32
  should "properly jsonize the jsonizable_attributes" do
44
33
  job = Blitline::Job.new("http://ww.foo.com")
45
34
  job.add_function("blue", nil, "my_image")
@@ -4,6 +4,7 @@ class TestService < Test::Unit::TestCase
4
4
  if ENV['BLITLINE_APPLICATION_ID']
5
5
  require 'multi_json'
6
6
  SAMPLE_IMAGE_SRC = "http://www.google.com/intl/en_com/images/srpr/logo3w.png"
7
+ SAMPLE_PDF = "https://s3.amazonaws.com/blitdoc/pdfs/nice.pdf"
7
8
 
8
9
  should "be able to commit a simple job to service" do
9
10
  blitline = Blitline.new
@@ -47,6 +48,32 @@ class TestService < Test::Unit::TestCase
47
48
  assert(returned_values['results'][0]['images'].length > 0, "No images returned")
48
49
  end
49
50
 
51
+ should "be able to handle pdf burst and wait_for_poll" do
52
+ blitline = Blitline.new
53
+ blitline.add_job_via_hash({
54
+ "application_id"=> "#{ENV['BLITLINE_APPLICATION_ID']}",
55
+ "src"=> SAMPLE_PDF,
56
+ "v" => 1.20,
57
+ "src_type" => "burst_pdf",
58
+ "functions"=> [
59
+ {
60
+ "name"=> "resize_to_fit",
61
+ "params"=> {
62
+ "width"=> 100
63
+ },
64
+ "save"=> {
65
+ "image_identifier"=> "MY_CLIENT_ID"
66
+ }
67
+ }
68
+ ]
69
+ })
70
+
71
+ returned_values = blitline.post_job_and_wait_for_poll
72
+ assert(returned_values['images'].length > 0, "No images returned")
73
+ assert(returned_values['images'][0]["url"], "No images returned")
74
+ assert(returned_values['images'][0]["url"].end_with?("__0.jpg"), "Not burst result")
75
+ end
76
+
50
77
  should "be able to add job via hash and wait for polling" do
51
78
  blitline = Blitline.new
52
79
  blitline.add_job_via_hash({
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blitline
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.0
4
+ version: 2.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blitline LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-27 00:00:00.000000000 Z
11
+ date: 2016-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: test-unit
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  description: The blitline gems provides a simple easy wrapper to the Blitline.com
56
70
  web api
57
71
  email: support@blitline.com
@@ -99,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
113
  version: '0'
100
114
  requirements: []
101
115
  rubyforge_project:
102
- rubygems_version: 2.4.5
116
+ rubygems_version: 2.4.8
103
117
  signing_key:
104
118
  specification_version: 4
105
119
  summary: Blitline provides simple image processing in the cloud