senkyoshi 1.0.4 → 1.0.5

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: 26c7126fd95fa6cf136131c92014471f65e2089e
4
- data.tar.gz: 6a6a5352177a859ddbb3ac1c83fe9ac465e927a9
3
+ metadata.gz: 9bfcbb5ad1a455e185f52a6d119204d63140c23f
4
+ data.tar.gz: 746db96ccf09d5edbe1c29740b587b1c43a9dd42
5
5
  SHA512:
6
- metadata.gz: bb156e023de570e457222738c42a34af1433c279ad9879501fcd7ed82d5a76538f2e3bfc191832bdcdcd03a54f4486a87abe2fbc9783d2eb9d54a7b415dff903
7
- data.tar.gz: fb795ce77619b24d9b0ec6e55eeba40ece4e82b5f325b8b48a39be08d970349e96828395a1c29e34d63e4b8d60cd96d16b8fe11c57b844a9b140b11f780bb400
6
+ metadata.gz: 32a24dc841797b72293bed5d0aabd1864657bb2b165c5a0b9d610433587d1b7555c9cc24deeebee984fd990ccf019339fc66e7d637fc8e4c45bd7d4d2c4bb979
7
+ data.tar.gz: 3696fb68ef7759f6f890b7bc6ff377ab0b3e78116484ab79b24c5bcdb6c1997f9b27ffd3723d1df6b2dad79580d29c4e6fe62a3b0ae21f489078c54f7b2b52e6
data/README.md CHANGED
@@ -55,6 +55,9 @@ Create a `senkyoshi.yml` and add credentials:
55
55
 
56
56
  # The account or sub-account ID. This can be :self, :default, or an ID
57
57
  :account_id: <id>
58
+
59
+ # The number of seconds before uploads timeout. Defaults to 1800 (30 minutes)
60
+ :request_timeout: <request timeout seconds>
58
61
  ```
59
62
 
60
63
  ## Usage
@@ -6,6 +6,7 @@ module Senkyoshi
6
6
  ##
7
7
  # This class represents a canvas course for which we are uploading data to
8
8
  ##
9
+
9
10
  class CanvasCourse
10
11
  attr_reader :scorm_packages
11
12
 
@@ -211,9 +212,11 @@ module Senkyoshi
211
212
  upload_params[:file] = file
212
213
 
213
214
  # Post to S3
214
- RestClient.post(
215
- upload_url,
216
- upload_params,
215
+ RestClient::Request.execute(
216
+ method: :post,
217
+ url: upload_url,
218
+ payload: upload_params,
219
+ timeout: Senkyoshi.configuration.request_timeout,
217
220
  ) do |response|
218
221
  # Post to Canvas
219
222
  RestClient.post(
@@ -8,6 +8,9 @@ module Senkyoshi
8
8
  attr_accessor :scorm_url
9
9
  attr_accessor :scorm_launch_url
10
10
  attr_accessor :scorm_shared_auth
11
+ attr_accessor :request_timeout
12
+
13
+ DEFAULT_TIMEOUT = 1_800 # 30 minutes
11
14
 
12
15
  def initialize
13
16
  @canvas_url = Configuration._config[:canvas_url]
@@ -16,6 +19,8 @@ module Senkyoshi
16
19
  @scorm_url = Configuration._config[:scorm_url]
17
20
  @scorm_launch_url = Configuration._config[:scorm_launch_url]
18
21
  @scorm_shared_auth = Configuration._config[:scorm_shared_auth]
22
+ @request_timeout =
23
+ Configuration._config[:request_timeout] || DEFAULT_TIMEOUT
19
24
  end
20
25
 
21
26
  def self._config
@@ -1,3 +1,3 @@
1
1
  module Senkyoshi
2
- VERSION = "1.0.4".freeze
2
+ VERSION = "1.0.5".freeze
3
3
  end
data/lib/senkyoshi.rb CHANGED
@@ -11,6 +11,8 @@ require "ostruct"
11
11
  require "nokogiri"
12
12
  require "zip"
13
13
 
14
+ Zip.write_zip64_support = true
15
+
14
16
  require "senkyoshi/exceptions"
15
17
 
16
18
  module Senkyoshi
@@ -94,7 +96,6 @@ module Senkyoshi
94
96
  end
95
97
 
96
98
  course = ModuleConverter.set_modules(course, pre_data)
97
-
98
99
  resources.find_instances_of(Rule).each do |rule|
99
100
  course = rule.canvas_conversion(course, resources)
100
101
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: senkyoshi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Atomic Jolt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-31 00:00:00.000000000 Z
11
+ date: 2017-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry-byebug