cielo24 0.0.7 → 0.0.8

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: ac1299303ddcc2014db9089215d733ef4e3308f1
4
- data.tar.gz: 8495707247b1e88c08c99fc09b9ec2cc486d929b
3
+ metadata.gz: 827188b8e97e031a14d9c4923c44f73c80f2e1bb
4
+ data.tar.gz: 858f74b9cb08ef0e3ac3a6232e3e19091ae7a5a9
5
5
  SHA512:
6
- metadata.gz: 0cc9c9090e2b3ca4f07ff151e406f081574ee687c09756b5e94d270e394e702e5b1a1530e00ebaa4096e789a0f1af8f44e1ae55c20dd9373c9e99e81fac2b494
7
- data.tar.gz: 7f309f52761b1cc90931073d1d88f14586d6cf91a00eda9656957555fd7ee4a77c5c56ed267088b03345278859a29987cf91f5324e624deca9fb5185e08ea03b
6
+ metadata.gz: f0ec27fdb903e3765e905e5ae7557b68739e11017c820cb94e3cb046a9670e7fb9c5f6a13ae04b5bca87f1ff843cd24134573e2f576df01567fe99845115edb0
7
+ data.tar.gz: 3ce8a723d3e9c8e3662b5e0c5d985d6f1cd92ebdf27c03e1b7f34489919c08872d784a257bed9f82ac69b55cdfffdcb80991a00c06fe379fd2165e0117e87d79
@@ -11,7 +11,7 @@ module Cielo24
11
11
 
12
12
  attr_accessor :base_url
13
13
 
14
- VERSION = 1
14
+ API_VERSION = 1
15
15
 
16
16
  LOGIN_PATH = "/api/account/login"
17
17
  LOGOUT_PATH = "/api/account/logout"
@@ -137,8 +137,9 @@ module Cielo24
137
137
  def add_media_to_job_file(api_token, job_id, media_file)
138
138
  assert_argument(media_file, "Media File")
139
139
  query_hash = init_job_req_dict(api_token, job_id)
140
+ file_size = File.size(media_file.path)
140
141
 
141
- json = WebUtils.get_json(@base_url + ADD_MEDIA_TO_JOB_PATH, 'POST', nil, query_hash, {"Content-Type" => "video/mp4"}, {"upload" => media_file})
142
+ json = WebUtils.get_json(@base_url + ADD_MEDIA_TO_JOB_PATH, 'POST', nil, query_hash, {'Content-Type' => 'video/mp4', 'Content-Length' => file_size}, media_file)
142
143
  return json["TaskId"]
143
144
  end
144
145
 
@@ -240,7 +241,7 @@ module Cielo24
240
241
  end
241
242
 
242
243
  def init_version_dict()
243
- {v: VERSION}
244
+ {v: API_VERSION}
244
245
  end
245
246
 
246
247
  def assert_argument(arg, arg_name)
@@ -1,3 +1,3 @@
1
1
  module Cielo24
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -23,11 +23,12 @@ module Cielo24
23
23
  def self.http_request(uri, method, timeout, query=nil, headers = nil, body = nil)
24
24
  http_client = HTTPClient.new
25
25
  http_client.cookie_manager = nil
26
+ http_client.send_timeout = 60*60*24*7 # HTTPClient default timeout set to 7 days, our own timeout handler is down below
26
27
 
27
28
  # Timeout block:
28
29
  begin
29
30
  # Error is raised if the following block fails to execute in 'timeout' sec:
30
- Timeout.timeout(timeout) {
31
+ Timeout.timeout(timeout) { # nil timeout = infinite
31
32
 
32
33
  response = http_client.request(method, uri, query, body, headers, nil)
33
34
  # Handle web errors
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cielo24
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
- - Evgeny Chistyakov
7
+ - cielo24
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-24 00:00:00.000000000 Z
11
+ date: 2014-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -80,8 +80,7 @@ files:
80
80
  - lib/cielo24/web_utils.rb
81
81
  - lib/cielo24.rb
82
82
  homepage: http://cielo24.com
83
- licenses:
84
- - MIT
83
+ licenses: []
85
84
  metadata: {}
86
85
  post_install_message:
87
86
  rdoc_options: []