github-to-canvas 0.0.31 → 0.0.36

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: cbe5aa05e4c77ad585a787d3d47d7f6f9bd3c1459888f6fc1bbba4d28270744d
4
- data.tar.gz: 27491ba2f7073b47ba291bf81796649346d3ec5d0f1203d2715af1373fde7f6a
3
+ metadata.gz: a277f51430eb482d411f25b2458151b29509ccf6b5d93ed37a161a43d2d198a0
4
+ data.tar.gz: 345c466354af608b95cc34b5291d7b7966fdca89fba2cc4754efc2da7de868d3
5
5
  SHA512:
6
- metadata.gz: 164d14066a9a97e873aa6d348fc16ee6bd9dd56d5670753490d0729bda8202a7d2b94881ef0c40f44bf8328383b176ec7809f7295ee0f88639310c1827040f7e
7
- data.tar.gz: 04640d7007324b1b75b4afc123eabec3e9e1fff600da90b1ad094ce04ba72fd1df6611f9e9e304fb0023d1779316f3d6d40a551f64ecab86226add8f0799565b
6
+ metadata.gz: 7936e708b7afc380dbfe3bb9f1c1b1502193652048ffc24f0549473b2903f00a311776db0c7c458b8ff3465ae08dc8aa8e999c53c38b9727d6036385e129a621
7
+ data.tar.gz: e8013f2e39e4f83be58e17f2ffdb2cce1dd00e28466b4663b3199b64cd78475b650bee6fab0988353f02138053c84569c6950641f59fe7cd0198222c56abbf97
@@ -93,10 +93,6 @@ if options[:version]
93
93
  GithubToCanvas.new(mode: 'version', course: nil)
94
94
  end
95
95
 
96
- if !options[:file_to_convert]
97
- options[:file_to_convert] = "README.md"
98
- end
99
-
100
96
  if !options[:type]
101
97
  if Dir.glob("**/*/").empty?
102
98
  options[:type] = "page"
@@ -114,9 +110,14 @@ if !options[:name]
114
110
  options[:name] = options[:file_to_convert]
115
111
  else
116
112
  options[:name] = File.basename(Dir.getwd)
113
+ options[:file_to_convert] = "README.md"
117
114
  end
118
115
  end
119
116
 
117
+ if !options[:file_to_convert]
118
+ options[:file_to_convert] = "README.md"
119
+ end
120
+
120
121
  if options[:create_lesson]
121
122
  GithubToCanvas.new(mode: "create",
122
123
  course: options[:course],
@@ -2,8 +2,9 @@ class CreateCanvasLesson
2
2
 
3
3
  def initialize(course, filepath, file_to_convert, branch, name, type, save_to_github, fis_links, remove_header_and_footer)
4
4
  name = name.split(/[- _]/).map(&:capitalize).join(' ')
5
- markdown = File.read("#{filepath}/#{file_to_convert}")
6
- if !markdown
5
+ begin
6
+ markdown = File.read("#{filepath}/#{file_to_convert}")
7
+ rescue
7
8
  puts "#{file_to_convert} not found in current directory. Exiting..."
8
9
  abort
9
10
  end
@@ -1,9 +1,10 @@
1
1
  class UpdateCanvasLesson
2
2
 
3
- def initialize(filepath, branch, name, type, save_to_github, fis_links, remove_header_and_footer)
3
+ def initialize(filepath, file_to_convert, branch, name, type, save_to_github, fis_links, remove_header_and_footer)
4
4
  name = name.split(/[- _]/).map(&:capitalize).join(' ')
5
- markdown = File.read("#{filepath}/#{file_to_convert}")
6
- if !markdown
5
+ begin
6
+ markdown = File.read("#{filepath}/#{file_to_convert}")
7
+ rescue
7
8
  puts "#{file_to_convert} not found in current directory. Exiting..."
8
9
  abort
9
10
  end
@@ -19,7 +20,7 @@ class UpdateCanvasLesson
19
20
  canvas_data = CanvasDotfile.read_canvas_data
20
21
  canvas_data[:lessons].each { |lesson|
21
22
  response = CanvasInterface.update_existing_lesson(lesson[:course_id], lesson[:id], lesson[:type], name, new_html, save_to_github)
22
- puts "Canvas lesson created. Lesson available at #{response['html_url']}."
23
+ # puts "Canvas lesson created. Lesson available at #{response['html_url']}."
23
24
  }
24
25
  end
25
26
 
@@ -1,3 +1,3 @@
1
1
  class GithubToCanvas
2
- VERSION = "0.0.31"
2
+ VERSION = "0.0.36"
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.31
4
+ version: 0.0.36
5
5
  platform: ruby
6
6
  authors:
7
7
  - maxwellbenton