senkyoshi 1.0.4 → 1.0.5
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 +4 -4
- data/README.md +3 -0
- data/lib/senkyoshi/canvas_course.rb +6 -3
- data/lib/senkyoshi/configuration.rb +5 -0
- data/lib/senkyoshi/version.rb +1 -1
- data/lib/senkyoshi.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bfcbb5ad1a455e185f52a6d119204d63140c23f
|
4
|
+
data.tar.gz: 746db96ccf09d5edbe1c29740b587b1c43a9dd42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
215
|
-
|
216
|
-
|
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
|
data/lib/senkyoshi/version.rb
CHANGED
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
|
+
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
|
11
|
+
date: 2017-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry-byebug
|