github-to-canvas 0.0.15 → 0.0.20

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: 98f8ae0d915a1a0812d6b4777358098785861ffd4117bdc4836e86a2a8301aad
4
- data.tar.gz: a50127f7f2f5281e3eaf736fdc37097c8de795b4b2bfb7532cf1a97db113d816
3
+ metadata.gz: 9a4f7a0afcf69fa3c6a3b2c06eb36d73e3bfaef2691653202478bab81c2db709
4
+ data.tar.gz: 975fb0c2f4cd1a19628da5f641f9b057852b3f2f5efa7ffdcc0868119bef3912
5
5
  SHA512:
6
- metadata.gz: d067f9cfcf558b43bafc5c304ed806c7529d8de179148a84030982c39681d973e3dda04333db5dce52928a9faf13946ae63d152bf6ca8d194397d0d3ffbdfde9
7
- data.tar.gz: f78da19c7dee06b800e78bde25bff91a582e5bbbc611b2f016b30836ada9b9dcb7ad90c5bbaaeb51335360033c06a973ce20fb5471696d79559c6524bb0be2bf
6
+ metadata.gz: d4fa7f6eee1eb0e7e30d21a47602df34e323daab0237fd85fcd1b7cdb613ab1ca7b2b68a7939ece0c91b9c840bd3ed7554f404839b45c95a843bb5f0e5df9fd8
7
+ data.tar.gz: f2c98036eedb4d14ebade41064091c8c85f093bd6434e8769d6a952536916de03d96cf7ab08d21ff5be8336fe183915bc6570f7a5305ff95d8341a2682e0dc88
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,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
@@ -26,7 +26,7 @@ class RepositoryConverter
26
26
  image.gsub!(/\(.+\)/) { |path|
27
27
  path.delete_prefix!("(")
28
28
  path.delete_suffix!(")")
29
- "(" + remote + "/#{branch}/" + path + ")"
29
+ "(" + raw_remote_url + "/#{branch}/" + path + ")"
30
30
  }
31
31
  end
32
32
  image
@@ -1,3 +1,3 @@
1
1
  class GithubToCanvas
2
- VERSION = "0.0.15"
2
+ VERSION = "0.0.20"
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.15
4
+ version: 0.0.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - maxwellbenton