Skip to content

Commit 1b94027

Browse files
committed
Merge pull request #1 from miquella/cleanup
Cleanup and updating to latest gems
2 parents 199fb21 + d91c75a commit 1b94027

41 files changed

Lines changed: 740 additions & 821 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
*.gem
21
.bundle
2+
.rspec
3+
*.gem
34
Gemfile.lock
45
pkg/*
56
spec/apikey.rb
6-
.rspec
7-
8-

Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ gemspec
55
gem 'rspec'
66
gem 'cucumber'
77
gem 'rake'
8-

README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Rustici SCORM Cloud Ruby Client
2+
3+
> Let me know if you are interested in taking it over. I developed the code but never
4+
> actually used it in production. Use with caution.
5+
6+
This ruby gem is provides a ruby interface to the Rustici Scorm Cloud.
7+
8+
9+
## Shell CLI Interface
10+
11+
$ `gem install scorm_cloud`
12+
$ `scorm_cloud rustici.course.getCourseList —appid myappid —secret mysecret`
13+
14+
15+
## Standard Ruby Use
16+
17+
require 'scorm_cloud'
18+
sc = ScormCloud::ScormCloud.new("my_app_id", "my_secret_key")
19+
sc.course.get_course_list.each { |c| puts "#{c.id} #{c.title}"}
20+
21+
22+
## Ruby on Rails Use
23+
24+
*Place the following in: Gemfile*
25+
26+
require 'scorm_cloud', :git => 'git@github.com:aeseducation/scorm-cloud.git'
27+
28+
*Place the following in: config/initializers/scorm_cloud.rb*
29+
30+
MyApplication::Application.configure do |config|
31+
config.scorm_cloud.appid = "my_app_id"
32+
config.scorm_cloud.secretkey = "my_secret_key"
33+
end
34+
35+
*Place the following in: app/controllers.course_controller.rb*
36+
37+
class CourseController < ApplicationController
38+
def index
39+
@courses = scorm_cloud.course.get_course_list
40+
end
41+
42+
def launch
43+
return_url = course_index_url
44+
reg = scorm_cloud.registrations.create_registration(...)
45+
redirect_to scorm_cloud.registrations.launch(...)
46+
end
47+
end
48+
49+
*Place the following in: app/views/course/index.html.erb*
50+
51+
<ul>
52+
<%= @courses.each |course| %>
53+
<li>
54+
<%= link_to course_launch_path(course.title, course.id) %>
55+
</li>
56+
<% end %>
57+
</ul>

Rakefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ Cucumber::Rake::Task.new do |t|
1010
end
1111

1212
namespace :cucumber do
13-
Cucumber::Rake::Task.new('apibugs') do |t|
14-
t.cucumber_opts = "--tags @apibug"
15-
end
16-
Cucumber::Rake::Task.new('wip') do |t|
17-
t.cucumber_opts = "--tags @wip"
18-
end
13+
Cucumber::Rake::Task.new('apibugs') do |t|
14+
t.cucumber_opts = "--tags @apibug"
15+
end
16+
Cucumber::Rake::Task.new('wip') do |t|
17+
t.cucumber_opts = "--tags @wip"
18+
end
1919
end
2020

2121
task :test do
22-
[:spec, :cucumber].each { |t| Rake::Task[t].execute }
22+
[:spec, :cucumber].each { |t| Rake::Task[t].execute }
2323
end
2424

25-
task :default => :test
25+
task :default => :test

bin/scorm_cloud

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ $:.unshift(File.expand_path('../../lib', __FILE__))
33
require 'scorm_cloud'
44
require 'scorm_cloud/CLI'
55
ScormCloud::CLI.start
6-

features/api_bugs.feature

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
@apibug
22
Feature: API Bugs and Questions
33

4-
Scenario: Deleting a non-existant package should return an error
5-
in this case it seems to return deleted=true even when the file
6-
does not exist
4+
Scenario: Deleting a non-existant package should return an error
5+
in this case it seems to return deleted=true even when the file
6+
does not exist
77

8-
When I delete a non-existant package
9-
Then I should get an error
8+
When I delete a non-existant package
9+
Then I should get an error
1010

1111

1212
# Preview documentation doesn't list redirect URL as a parameter

features/course_service.feature

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
Feature: Course Service Interface
22

3-
Scenario: A user can import a previously uploaded course
4-
When I import a course
5-
Then there should be 1 course in the list
6-
And the course should be in the course list
7-
And the course should exist
8-
And I can get a preview URL for the course
9-
And I can get the manifest for the course
10-
And I can get the attributes for the course
3+
Scenario: A user can import a previously uploaded course
4+
When I import a course
5+
Then there should be 1 course in the list
6+
And the course should be in the course list
7+
And the course should exist
8+
And I can get a preview URL for the course
9+
And I can get the manifest for the course
10+
And I can get the attributes for the course
1111

12-
When I delete the course
13-
Then there should be 0 courses in the list
14-
Then the course should not be in the course list
12+
When I delete the course
13+
Then there should be 0 courses in the list
14+
Then the course should not be in the course list
1515

16-
Scenario: A user can update course attributes
17-
When I import a course
18-
And I update course attributes
19-
Then the course attributes should be updated
16+
Scenario: A user can update course attributes
17+
When I import a course
18+
And I update course attributes
19+
Then the course attributes should be updated

features/debug_service.feature

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Feature: Debug Service Interface
22

3-
Scenario: Debug Services Function
3+
Scenario: Debug Services Function
44

5-
When I ping the server
6-
Then the response should be "pong"
5+
When I ping the server
6+
Then the response should be "pong"
77

8-
When I authping the server
9-
Then the response should be "pong"
8+
When I authping the server
9+
Then the response should be "pong"
1010

11-
When I get the current time
12-
Then the resonse should be the current time
11+
When I get the current time
12+
Then the resonse should be the current time
Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
Feature: Registration Service
22

3-
Background: Setup a course
4-
Given a registered course
3+
Background: Setup a course
4+
Given a registered course
55

6-
Scenario: Register a learner
6+
Scenario: Register a learner
77

8-
When I register a learner
9-
Then the learner should be in the registration list
10-
And I can get the registration results
8+
When I register a learner
9+
Then the learner should be in the registration list
10+
And I can get the registration results
1111

12-
When I launch the course
13-
Then I will get a valid url
12+
When I launch the course
13+
Then I will get a valid url
1414

15-
When I reset the registration
16-
Then the learner should be in the registration list
17-
And I can get the registration results
18-
19-
When I delete the registration
20-
Then the learner should not be in the registration list
15+
When I reset the registration
16+
Then the learner should be in the registration list
17+
And I can get the registration results
2118

19+
When I delete the registration
20+
Then the learner should not be in the registration list

0 commit comments

Comments
 (0)