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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae90724ef58574c75adb58628e97ea656d36a13e4c64bc3125260dd686a544f1
4
- data.tar.gz: b5b7231af66add1087f97fbbf89fba065ed3b9846936debe0fd5e566bdb2c744
3
+ metadata.gz: bfda203dbd3a7e66e56136021641ab5145f47fa4e8995c35ef26e412e5ebde4e
4
+ data.tar.gz: 23601eb1f2c9b50b5286d60295c2c33537b56ff37d7e19118899b2f8ec299d01
5
5
  SHA512:
6
- metadata.gz: 58125925c61d906e7f6adfe71c90771f5f52f7a82d44a05d12611016d77ea7f4c749dbfb4fbdc97821c7628a53d2e1ed203685a90ddcf2a832b3ea17fed2e4e3
7
- data.tar.gz: efb1191f1486bdc7ff0602d3c2931d492c571385def2148d7f1c6082f9a4ba7f34cbf5b595d8fbca0635cba2ddaf0676d0de4a22898f97801ca4ca4d95381ebd
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>
@@ -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 t == 'page' || t == 'assignment'
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
- "(" + remote + "/#{branch}/" + path + ")"
30
+ "(" + raw_remote_url + "/#{branch}/" + path + ")"
30
31
  }
31
32
  end
32
33
  image
@@ -1,3 +1,3 @@
1
- class LearnTool
2
- VERSION = "0.0.14"
1
+ class GithubToCanvas
2
+ VERSION = "0.0.19"
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.14
4
+ version: 0.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - maxwellbenton