github-to-canvas 0.0.14 → 0.0.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/bin/github-to-canvas +2 -2
- data/lib/github-to-canvas/repository_converter.rb +3 -2
- data/lib/github-to-canvas/version.rb +2 -2
- 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: bfda203dbd3a7e66e56136021641ab5145f47fa4e8995c35ef26e412e5ebde4e
|
4
|
+
data.tar.gz: 23601eb1f2c9b50b5286d60295c2c33537b56ff37d7e19118899b2f8ec299d01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30bfb4f75c02de44d9363e0b2ca548c43b62ccb066e418ac1c29b2ae90066a14fb966bbde4aa37e4a70b48d271b53ff143f9fa81448c1b35369469f70ae1cab7
|
7
|
+
data.tar.gz: dd8177964070c9d305692c83f89827e016140c30f100f01f0f01df008cc8eec67b963babe6767b95233a46e1acc7f9c52804bfde8434bea62dabe1dce56b2696
|
data/README.md
CHANGED
@@ -106,8 +106,14 @@ You can override the default behaviors with the following arguments:
|
|
106
106
|
appropriate Canvas lesson type instead of relying on the repository's
|
107
107
|
directory structure
|
108
108
|
|
109
|
+
## Examples of Valid Images This Gem Can Convert
|
110
|
+
|
111
|
+
Inline Markdown:
|
112
|
+
|
109
113
|
![example in-line image](https://curriculum-content.s3.amazonaws.com/fewpjs/fewpjs-fetch-lab/Image_25_AsynchronousJavaScript.png)
|
110
114
|
|
115
|
+
HTML:
|
116
|
+
|
111
117
|
<p align="center">
|
112
118
|
<img src="https://curriculum-content.s3.amazonaws.com/fewpjs/fewpjs-fetch-lab/Image_25_AsynchronousJavaScript.png" width="500">
|
113
119
|
</p>
|
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,7 +74,7 @@ if options[:version]
|
|
74
74
|
GithubToCanvas.new(mode: 'version', course: nil)
|
75
75
|
end
|
76
76
|
|
77
|
-
if Dir.glob("**/*/").empty?
|
77
|
+
if Dir.glob("**/*/").empty? && !options[:type]
|
78
78
|
options[:type] = "page"
|
79
79
|
else
|
80
80
|
options[:type] = "assignment"
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'redcarpet'
|
2
|
-
|
2
|
+
require 'byebug'
|
3
3
|
class RepositoryConverter
|
4
4
|
|
5
5
|
def self.convert(filepath, readme, branch)
|
@@ -16,6 +16,7 @@ class RepositoryConverter
|
|
16
16
|
def self.set_raw_image_remote_url(filepath)
|
17
17
|
remote = GithubInterface.git_remote(filepath)
|
18
18
|
remote.gsub!("git@github.com:","https://raw.githubusercontent.com/")
|
19
|
+
remote.gsub!("https://github.com/","https://raw.githubusercontent.com/")
|
19
20
|
remote.gsub!(/.git$/,"")
|
20
21
|
remote.strip!
|
21
22
|
end
|
@@ -26,7 +27,7 @@ class RepositoryConverter
|
|
26
27
|
image.gsub!(/\(.+\)/) { |path|
|
27
28
|
path.delete_prefix!("(")
|
28
29
|
path.delete_suffix!(")")
|
29
|
-
"(" +
|
30
|
+
"(" + raw_remote_url + "/#{branch}/" + path + ")"
|
30
31
|
}
|
31
32
|
end
|
32
33
|
image
|
@@ -1,3 +1,3 @@
|
|
1
|
-
class
|
2
|
-
VERSION = "0.0.
|
1
|
+
class GithubToCanvas
|
2
|
+
VERSION = "0.0.19"
|
3
3
|
end
|