scorm_engine 0.8.3 → 0.9.0

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
  SHA256:
3
- metadata.gz: c6dc07764b79c2b24e72ebd15d39f1deb301eb268e2d5ac10eb1771057847e39
4
- data.tar.gz: 747ccf82b2a4f489f9aa89fb4b9ac2831aa0771465f58dd8ff5ac314dff722a1
3
+ metadata.gz: a01b32c7b8dca247cfeff31eeec10efe24b2212e219b8fec0b76cc95571be773
4
+ data.tar.gz: 9d75ef9166e52ae9d52bdc8bf475c48d74803502eb37163f360205476705043e
5
5
  SHA512:
6
- metadata.gz: 2de6d2331954d65d497165150282dff1a0d7c604464001713ef4610b7f47e7c7f44ab4e40f17b141b6ea78173ea598b4ff636f8300462731a0538bd0fe2ffe24
7
- data.tar.gz: 25d76985d84f9150114e2dcbf38de35fdcf5a51e397b64d6df59762fa7495dca52367a8e53e5029ced8822cefeafbc5a506cd6343dae1efcfe93851e125bcaec
6
+ metadata.gz: 43be376e8bfb18097d9987a8fdf2bf71c7f07025160aa3df759b16d89222d7d85eb2e7cdc7b9d735921f143761d02608b784f50cf9497f098ad1092ca29f993d
7
+ data.tar.gz: 7d2a84544f3063591f595bb9f44163c17b88c0019b990f218d7137218aac2a1abf9cb9009f708291ea63db39307e9e39ca20ae56654d3880ac2afd8a5996b091
data/Rakefile CHANGED
@@ -1,7 +1,9 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rspec/core/rake_task"
3
3
  require "yard"
4
+ require "rubocop/rake_task"
4
5
 
6
+ RuboCop::RakeTask.new
5
7
  RSpec::Core::RakeTask.new(:spec)
6
8
 
7
9
  task default: :spec
@@ -37,10 +37,10 @@ module ScormEngine
37
37
  @logger = ::Logger.new(ENV.fetch("SCORM_ENGINE_LOGFILE", "/dev/null"))
38
38
 
39
39
  @log_options = begin
40
- JSON.parse(ENV.fetch("SCORM_ENGINE_LOG_OPTIONS"))
41
- rescue KeyError, JSON::ParserError
42
- { headers: false, bodies: false }
43
- end
40
+ JSON.parse(ENV.fetch("SCORM_ENGINE_LOG_OPTIONS"))
41
+ rescue KeyError, JSON::ParserError
42
+ { headers: false, bodies: false }
43
+ end
44
44
  end
45
45
  end
46
46
  end
@@ -34,9 +34,7 @@ module ScormEngine
34
34
  request.headers["engineTenantName"] = tenant unless @without_tenant
35
35
  else
36
36
  # "more" pagination urls are fully or relatively qualified
37
- unless path =~ %r{\Ahttps?://} || path.start_with?(base_uri.path)
38
- path = "#{tenant}/#{path}"
39
- end
37
+ path = "#{tenant}/#{path}" unless path =~ %r{\Ahttps?://} || path.start_with?(base_uri.path)
40
38
  end
41
39
 
42
40
  options = coerce_options(options)
@@ -21,6 +21,7 @@ module ScormEngine
21
21
  # @return [String]
22
22
  attr_accessor :body
23
23
 
24
+ # rubocop:disable Lint/MissingSuper
24
25
  def initialize(options = {})
25
26
  @options = options.dup
26
27
  @dispatch_id = options[:dispatch_id]
@@ -28,6 +29,7 @@ module ScormEngine
28
29
  @filename = options[:filename]
29
30
  @body = options[:body]
30
31
  end
32
+ # rubocop:enable Lint/MissingSuper
31
33
  end
32
34
  end
33
35
  end
@@ -1,5 +1,6 @@
1
1
  module ScormEngine
2
2
  module Models
3
+ # rubocop:disable Metrics/AbcSize
3
4
  class Registration < Base
4
5
  # @attr
5
6
  # The external identification of the registration.
@@ -183,5 +184,6 @@ module ScormEngine
183
184
  Time.parse(completed_date)
184
185
  end
185
186
  end
187
+ # rubocop:enable Metrics/AbcSize
186
188
  end
187
189
  end
@@ -1,3 +1,3 @@
1
1
  module ScormEngine
2
- VERSION = "0.8.3".freeze
2
+ VERSION = "0.9.0".freeze
3
3
  end
@@ -19,7 +19,7 @@ RSpec.describe ScormEngine::Api::Endpoints::Configuration do
19
19
  end
20
20
 
21
21
  it "returns metadata in raw_response when included in options" do
22
- expect(subject.raw_response.body['settingItems'].first["metadata"]).to_not be_nil
22
+ expect(subject.raw_response.body["settingItems"].first["metadata"]).to_not be_nil
23
23
  end
24
24
  end
25
25
  end
@@ -43,7 +43,7 @@ RSpec.describe ScormEngine::Api::Endpoints::Configuration do
43
43
  expect(configuration["UserCountReportLookBackDays"]).to eq "90"
44
44
  expect(configuration["UserCountReportDaysBetweenReports"]).to eq "20"
45
45
 
46
- resp = subject.post_app_configuration(
46
+ subject.post_app_configuration(
47
47
  settings: { "UserCountReportLookBackDays" => "365",
48
48
  "UserCountReportDaysBetweenReports" => 30 }
49
49
  )
@@ -22,7 +22,7 @@ RSpec.describe ScormEngine::Api::Endpoints::Registrations do
22
22
  against_real_scorm_engine do
23
23
  ensure_course_exists(client: subject, course_id: registration_options[:course_id])
24
24
  ensure_registration_exists(registration_options.merge(client: subject))
25
- ensure_course_exists(client: subject, course_id: registration_options[:course_id] + "-no-registrations")
25
+ ensure_course_exists(client: subject, course_id: "#{registration_options[:course_id]}-no-registrations")
26
26
  end
27
27
  end
28
28
 
@@ -50,7 +50,7 @@ RSpec.describe ScormEngine::Api::Endpoints::Registrations do
50
50
  end
51
51
 
52
52
  it "excludes results" do
53
- registrations = subject.get_registrations(course_id: registration_options[:course_id] + "-no-registrations")
53
+ registrations = subject.get_registrations(course_id: "#{registration_options[:course_id]}-no-registrations")
54
54
  reg = registrations.result.detect { |r| r.id == registration_options[:registration_id] }
55
55
  expect(reg).to be nil
56
56
  end
@@ -32,7 +32,7 @@ RSpec.describe ScormEngine::Faraday::Connection do
32
32
  client = ScormEngine::Client.new(tenant: "test")
33
33
 
34
34
  expect(client).to receive(:base_uri).with(version: 2).and_call_original
35
- client.send(:connection, { version: 2 })
35
+ client.send(:connection, version: 2)
36
36
  end
37
37
  end
38
38
  end
@@ -1,14 +1,16 @@
1
- RSpec.describe ScormEngine::Models::Base do
2
- module ScormEngine
3
- module Models
4
- class Test < Base
5
- def initialize(options = {})
6
- @options = options
7
- end
1
+ module ScormEngine
2
+ module Models
3
+ class Test < Base
4
+ # rubocop:disable Lint/MissingSuper
5
+ def initialize(options = {})
6
+ @options = options
8
7
  end
8
+ # rubocop:enable Lint/MissingSuper
9
9
  end
10
10
  end
11
+ end
11
12
 
13
+ RSpec.describe ScormEngine::Models::Base do
12
14
  describe "#to_hash" do
13
15
  it "returns a hash of the options" do
14
16
  options = { i: 1, s: "str", a: [1, 2, 3] }
@@ -4,7 +4,10 @@ require "pry"
4
4
  require "scorm_engine"
5
5
 
6
6
  # Ensure we're picking up only the test scorm settings
7
- Dotenv.load(".env.test")
7
+ Dotenv.load(".env.test.local",
8
+ ".env.test",
9
+ ".env.local",
10
+ ".env")
8
11
 
9
12
  RSpec.configure do |config|
10
13
  # Enable flags like --only-failures and --next-failure
@@ -42,6 +45,6 @@ RSpec.configure do |config|
42
45
  end
43
46
 
44
47
  # Require every spec support file
45
- Dir[File.join(File.dirname(__FILE__), "support", "**/*.rb")].each do |file|
48
+ Dir[File.join(File.dirname(__FILE__), "support", "**/*.rb")].sort.each do |file|
46
49
  require file
47
50
  end
@@ -7,13 +7,11 @@ module ScormEngineHelpers
7
7
  # importing a course and play it back other tests that expect the actual
8
8
  # record to exist in SCORM will fail.
9
9
  #
10
- def against_real_scorm_engine
10
+ def against_real_scorm_engine(&block)
11
11
  return unless scorm_engine_is_available?
12
12
 
13
13
  cassette = VCR.eject_cassette
14
- VCR.turned_off do
15
- yield
16
- end
14
+ VCR.turned_off(&block)
17
15
  VCR.insert_cassette(cassette.name, cassette.instance_variable_get(:@options))
18
16
  end
19
17
 
metadata CHANGED
@@ -1,58 +1,70 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scorm_engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Hallstrom
8
8
  - Mel Green
9
- autorequire:
9
+ autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-11-13 00:00:00.000000000 Z
12
+ date: 1980-01-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - "~>"
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: '0.12'
21
+ - - "<="
22
+ - !ruby/object:Gem::Version
23
+ version: '2.0'
21
24
  type: :runtime
22
25
  prerelease: false
23
26
  version_requirements: !ruby/object:Gem::Requirement
24
27
  requirements:
25
- - - "~>"
28
+ - - ">="
26
29
  - !ruby/object:Gem::Version
27
30
  version: '0.12'
31
+ - - "<="
32
+ - !ruby/object:Gem::Version
33
+ version: '2.0'
28
34
  - !ruby/object:Gem::Dependency
29
35
  name: faraday_middleware
30
36
  requirement: !ruby/object:Gem::Requirement
31
37
  requirements:
32
- - - "~>"
38
+ - - ">="
33
39
  - !ruby/object:Gem::Version
34
40
  version: '0.12'
41
+ - - "<="
42
+ - !ruby/object:Gem::Version
43
+ version: '2.0'
35
44
  type: :runtime
36
45
  prerelease: false
37
46
  version_requirements: !ruby/object:Gem::Requirement
38
47
  requirements:
39
- - - "~>"
48
+ - - ">="
40
49
  - !ruby/object:Gem::Version
41
50
  version: '0.12'
51
+ - - "<="
52
+ - !ruby/object:Gem::Version
53
+ version: '2.0'
42
54
  - !ruby/object:Gem::Dependency
43
55
  name: bundler
44
56
  requirement: !ruby/object:Gem::Requirement
45
57
  requirements:
46
58
  - - "~>"
47
59
  - !ruby/object:Gem::Version
48
- version: '1.16'
60
+ version: '2.0'
49
61
  type: :development
50
62
  prerelease: false
51
63
  version_requirements: !ruby/object:Gem::Requirement
52
64
  requirements:
53
65
  - - "~>"
54
66
  - !ruby/object:Gem::Version
55
- version: '1.16'
67
+ version: '2.0'
56
68
  - !ruby/object:Gem::Dependency
57
69
  name: dotenv
58
70
  requirement: !ruby/object:Gem::Requirement
@@ -73,14 +85,14 @@ dependencies:
73
85
  requirements:
74
86
  - - "~>"
75
87
  - !ruby/object:Gem::Version
76
- version: '0.11'
88
+ version: '0.1'
77
89
  type: :development
78
90
  prerelease: false
79
91
  version_requirements: !ruby/object:Gem::Requirement
80
92
  requirements:
81
93
  - - "~>"
82
94
  - !ruby/object:Gem::Version
83
- version: '0.11'
95
+ version: '0.1'
84
96
  - !ruby/object:Gem::Dependency
85
97
  name: rake
86
98
  requirement: !ruby/object:Gem::Requirement
@@ -115,14 +127,14 @@ dependencies:
115
127
  requirements:
116
128
  - - "~>"
117
129
  - !ruby/object:Gem::Version
118
- version: '0.56'
130
+ version: '1.0'
119
131
  type: :development
120
132
  prerelease: false
121
133
  version_requirements: !ruby/object:Gem::Requirement
122
134
  requirements:
123
135
  - - "~>"
124
136
  - !ruby/object:Gem::Version
125
- version: '0.56'
137
+ version: '1.0'
126
138
  - !ruby/object:Gem::Dependency
127
139
  name: rubyzip
128
140
  requirement: !ruby/object:Gem::Requirement
@@ -143,14 +155,14 @@ dependencies:
143
155
  requirements:
144
156
  - - "~>"
145
157
  - !ruby/object:Gem::Version
146
- version: '4.0'
158
+ version: '6.0'
147
159
  type: :development
148
160
  prerelease: false
149
161
  version_requirements: !ruby/object:Gem::Requirement
150
162
  requirements:
151
163
  - - "~>"
152
164
  - !ruby/object:Gem::Version
153
- version: '4.0'
165
+ version: '6.0'
154
166
  - !ruby/object:Gem::Dependency
155
167
  name: yard
156
168
  requirement: !ruby/object:Gem::Requirement
@@ -408,8 +420,9 @@ files:
408
420
  homepage: https://github.com/instructure-bridge/scorm_engine
409
421
  licenses:
410
422
  - MIT
411
- metadata: {}
412
- post_install_message:
423
+ metadata:
424
+ documentation_uri: https://instructure-bridge.github.io/scorm_engine/
425
+ post_install_message:
413
426
  rdoc_options: []
414
427
  require_paths:
415
428
  - lib
@@ -417,16 +430,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
417
430
  requirements:
418
431
  - - ">="
419
432
  - !ruby/object:Gem::Version
420
- version: '0'
433
+ version: '2.5'
421
434
  required_rubygems_version: !ruby/object:Gem::Requirement
422
435
  requirements:
423
436
  - - ">="
424
437
  - !ruby/object:Gem::Version
425
438
  version: '0'
426
439
  requirements: []
427
- rubyforge_project:
428
- rubygems_version: 2.7.6.2
429
- signing_key:
440
+ rubygems_version: 3.1.3
441
+ signing_key:
430
442
  specification_version: 4
431
443
  summary: Ruby Client for Rustici's SCORM Engine API
432
444
  test_files: []