github-to-canvas 0.0.16 → 0.0.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/github-to-canvas +7 -5
- data/lib/github-to-canvas/repository_converter.rb +1 -1
- data/lib/github-to-canvas/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 448a4a84a6539abab1189c190f3888a68c1521b54129ffed7a3d558f9ba1b75d
|
4
|
+
data.tar.gz: 55bf7acb67cc93c5fd9c009a8f5fae4b1bcfdd7a5c4d565d8fb6124c6c5f0868
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 270b759448944e453816e85c5516c029e308ec107d095c845838251f87f55d7c388add59e95a727118ebd38ae69e09270ee8b0929a408845fe0c3f7b16b9ea81
|
7
|
+
data.tar.gz: b779833f54c2d55c1c5541121222d73fb44400dd448cb697d8f38b29d6c29f279094a205a7abac98557b4a9e51003c5d7e79b938623722947be92baf13ed36d3
|
data/bin/github-to-canvas
CHANGED
@@ -48,7 +48,7 @@ OptionParser.new do |opts|
|
|
48
48
|
end
|
49
49
|
opts.on("-tTYPE", "--type TYPE",
|
50
50
|
"Sets the type Canvas lesson to be created (page or assignment). If no type, type decided based on repository structure") do |type|
|
51
|
-
if
|
51
|
+
if type == 'page' || type == 'assignment'
|
52
52
|
options[:type] = type
|
53
53
|
else
|
54
54
|
puts "Invalid type. Defaulting to page"
|
@@ -74,10 +74,12 @@ if options[:version]
|
|
74
74
|
GithubToCanvas.new(mode: 'version', course: nil)
|
75
75
|
end
|
76
76
|
|
77
|
-
if
|
78
|
-
|
79
|
-
|
80
|
-
|
77
|
+
if !options[:type]
|
78
|
+
if Dir.glob("**/*/").empty?
|
79
|
+
options[:type] = "page"
|
80
|
+
else
|
81
|
+
options[:type] = "assignment"
|
82
|
+
end
|
81
83
|
end
|
82
84
|
|
83
85
|
if !options[:branch]
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'redcarpet'
|
2
|
-
|
3
2
|
class RepositoryConverter
|
4
3
|
|
5
4
|
def self.convert(filepath, readme, branch)
|
@@ -16,6 +15,7 @@ class RepositoryConverter
|
|
16
15
|
def self.set_raw_image_remote_url(filepath)
|
17
16
|
remote = GithubInterface.git_remote(filepath)
|
18
17
|
remote.gsub!("git@github.com:","https://raw.githubusercontent.com/")
|
18
|
+
remote.gsub!("https://github.com/","https://raw.githubusercontent.com/")
|
19
19
|
remote.gsub!(/.git$/,"")
|
20
20
|
remote.strip!
|
21
21
|
end
|