github-to-canvas 0.0.27 → 0.0.28

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
  SHA256:
3
- metadata.gz: eb0933e7879b19ca26982288527eb62ce59da160e7483109b9703dbe5103a4cb
4
- data.tar.gz: 235afe75dcb268ef87a21e720af630c46fc3dee071e38b827ce7b925e82f022f
3
+ metadata.gz: a2d55d83e956d2f1437ef00fced0e5908ed5e5c4db1b09450a5bc993544a040f
4
+ data.tar.gz: 78a2d3cef6c5814d9bf18b68dd63561e5c79f4d342272229689fc03f411cae44
5
5
  SHA512:
6
- metadata.gz: 92ade0732354bbd82bd8b457e1ec17b192626c3fda9b39af1ea96585d75122fbd4907fae9bfdaa56d735f10ba88d4ff0291bdbbe2bcc95f4a00975cb1c017265
7
- data.tar.gz: 7676ae7d369a5a98467525b8d8883bb8856771d8ac705dd3ef8a69eab53c931aeb9f342a8203027b55a8b5632a06c91fef9f098ac16e0d2754d5bfea24bead50
6
+ metadata.gz: cb37cb15e34de3981106ea56343e310542a3032e9a82eb529e0d3c52d741bf396771cff2e78feeeffce5374a0602141693d673e0187d5d77dbcd0523bc43c55a
7
+ data.tar.gz: 5615ccc3805322be5170f508cfe4726377a12dd2d0e12690b2f7d622ae5cb43b8977f30e7229fd5523ded91645e96b67f91bc8024bcddf605da582c7e0088dca
data/README.md CHANGED
@@ -1,10 +1,5 @@
1
1
  # GitHub to Canvas Gem
2
2
 
3
- ## Objectives
4
-
5
- 1. test
6
- 2. test 2
7
-
8
3
  ## Introduction
9
4
 
10
5
  The `github-to-canvas` gem is designed to enable GitHub to Canvas LMS
@@ -1,16 +1,15 @@
1
1
  require 'yaml'
2
-
3
2
  class CanvasDotfile
4
3
 
5
4
  def self.update_or_create(filepath, response, course, type)
6
5
  if File.file?(".canvas")
7
- if type == "assignment"
6
+ if type == "assignment" || type == "discussion"
8
7
  canvas_data = self.update_assignment_data(response, course, type)
9
8
  else
10
9
  canvas_data = self.update_page_data(response, course, type)
11
10
  end
12
11
  else
13
- if type == "assignment"
12
+ if type == "assignment" || type == "discussion"
14
13
  canvas_data = self.create_assignment_data(response, course, type)
15
14
  else
16
15
  canvas_data = self.create_page_data(response, course, type)
@@ -1,6 +1,5 @@
1
1
  require 'json'
2
2
  require 'rest-client'
3
-
4
3
  class CanvasInterface
5
4
 
6
5
  def self.submit_to_canvas(course_id, type, name, readme, dry_run = false)
@@ -33,7 +32,11 @@ class CanvasInterface
33
32
  end
34
33
 
35
34
  def self.update_existing_lesson(course_id, id, type, name, new_readme, dry_run)
36
- url = "#{ENV['CANVAS_API_PATH']}/courses/#{course_id}/#{type}s/#{id}"
35
+ if type == "discussion"
36
+ url = "#{ENV['CANVAS_API_PATH']}/courses/#{course_id}/#{type}_topics/#{id}"
37
+ else
38
+ url = "#{ENV['CANVAS_API_PATH']}/courses/#{course_id}/#{type}s/#{id}"
39
+ end
37
40
  payload = self.build_payload(type, name, new_readme)
38
41
  begin
39
42
  RestClient.put(url, payload, headers={
@@ -18,7 +18,7 @@ class UpdateCanvasLesson
18
18
  end
19
19
  canvas_data = CanvasDotfile.read_canvas_data
20
20
  canvas_data[:lessons].each { |lesson|
21
- CanvasInterface.update_existing_lesson(lesson[:course_id], lesson[:id], type, name, new_readme, dry_run)
21
+ CanvasInterface.update_existing_lesson(lesson[:course_id], lesson[:id], lesson[:type], name, new_readme, dry_run)
22
22
  }
23
23
  end
24
24
 
@@ -1,3 +1,3 @@
1
1
  class GithubToCanvas
2
- VERSION = "0.0.27"
2
+ VERSION = "0.0.28"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github-to-canvas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.27
4
+ version: 0.0.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - maxwellbenton