github-to-canvas 0.0.51 → 0.0.56
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 +6 -5
- data/lib/github-to-canvas.rb +2 -2
- data/lib/github-to-canvas/repository_converter.rb +13 -7
- data/lib/github-to-canvas/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35b2320509da12ac07b0a2905c4302b8a2d3d492f2fc04bcd5dc606b8fb36cb3
|
4
|
+
data.tar.gz: 7964bd362c1315ddf7203f6f9599e8a69469d59579457fb6dd632c80c0127be5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c55a64f4a56fcb795af943a9db7e9799164cd19c5119738c0899ce3b73e1b8998a5c16ce676d5553828bf6d0f54b55d804c2066c2702e113ace009649e0ece3d
|
7
|
+
data.tar.gz: 37e1f2a57675d8ec0cb9dc6e36716b35b7ca8ab38b243e4cb6186a17fe0894c4b1ef8fde65dc0fbdaf3bb242d0bafcd08dd243abbb83acf03139de75597f95a4
|
data/bin/github-to-canvas
CHANGED
@@ -84,7 +84,7 @@ OptionParser.new do |opts|
|
|
84
84
|
"Adds additional Flatiron School HTML after markdown conversion") do |f|
|
85
85
|
options[:fis] = true
|
86
86
|
end
|
87
|
-
opts.on("--
|
87
|
+
opts.on("--forkable",
|
88
88
|
"Used with --fis-links, adds fork button to HTML header injected into Canvas lesson") do |remote|
|
89
89
|
options[:forkable] = true
|
90
90
|
end
|
@@ -135,6 +135,7 @@ end
|
|
135
135
|
if !options[:type]
|
136
136
|
if Dir.glob("**/*/").empty?
|
137
137
|
options[:type] = "page"
|
138
|
+
options[:forkable] = false
|
138
139
|
else
|
139
140
|
options[:type] = "assignment"
|
140
141
|
end
|
@@ -182,8 +183,8 @@ if options[:create_lesson]
|
|
182
183
|
save_to_github: !!options[:save_to_github],
|
183
184
|
fis_links: !!options[:fis],
|
184
185
|
remove_header_and_footer: !!options[:remove_header_and_footer],
|
185
|
-
only_update_content: !!options[:only_content]
|
186
|
-
forkable: !!options[:forkable]
|
186
|
+
only_update_content: !!options[:only_content],
|
187
|
+
forkable: !!options[:forkable])
|
187
188
|
end
|
188
189
|
|
189
190
|
if options[:align]
|
@@ -198,6 +199,6 @@ if options[:align]
|
|
198
199
|
save_to_github: !!options[:save_to_github],
|
199
200
|
fis_links: !!options[:fis],
|
200
201
|
remove_header_and_footer: !!options[:remove_header_and_footer],
|
201
|
-
only_update_content: !!options[:only_content]
|
202
|
-
forkable: !!options[:forkable]
|
202
|
+
only_update_content: !!options[:only_content],
|
203
|
+
forkable: !!options[:forkable])
|
203
204
|
end
|
data/lib/github-to-canvas.rb
CHANGED
@@ -74,13 +74,15 @@ class RepositoryConverter
|
|
74
74
|
|
75
75
|
def self.add_fis_links(filepath, readme, forkable)
|
76
76
|
repo_path = self.get_repo_url(filepath)
|
77
|
+
repo_name = repo_path.split('/')[-1]
|
78
|
+
repo_org = repo_path.split('/')[-2]
|
79
|
+
|
77
80
|
header = self.create_github_link_header(repo_path, forkable)
|
78
|
-
|
81
|
+
data_element = self.create_data_element(repo_org, repo_name)
|
82
|
+
data_element + header + readme
|
79
83
|
end
|
80
84
|
|
81
85
|
def self.create_github_link_header(repo_path, forkable)
|
82
|
-
repo_name = repo_path.split('/')[-1]
|
83
|
-
|
84
86
|
# add link to associated repository
|
85
87
|
# github_repo_link = "<a class='fis-git-link' href='#{repo_path}' target='_blank' rel='noopener'><img id='repo-img' title='Open GitHub Repo' alt='GitHub Repo' /></a>"
|
86
88
|
|
@@ -88,12 +90,16 @@ class RepositoryConverter
|
|
88
90
|
github_issue_link = "<a class='fis-git-link' href='#{repo_path}/issues/new' target='_blank' rel='noopener'><img id='issue-img' title='Create New Issue' alt='Create New Issue' /></a>"
|
89
91
|
|
90
92
|
# add link to fork (forking handled by separate Flatiron server, generation of link handled via custom Canvas JS theme file)
|
91
|
-
if (forkable)
|
92
|
-
github_fork_link = "<a class='fis-fork-link' id='fork-link'
|
93
|
+
if (forkable)
|
94
|
+
github_fork_link = "<a class='fis-fork-link' id='fork-link' href='#' target='_blank' rel='noopener'><img id='fork-img' title='Fork This Assignment' alt='Fork This Assignment' /></a>"
|
93
95
|
"<header class='fis-header' style='visibility: hidden;'>#{github_fork_link}#{github_issue_link}</header>"
|
94
|
-
|
96
|
+
else
|
95
97
|
"<header class='fis-header' style='visibility: hidden;'>#{github_issue_link}</header>"
|
96
|
-
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
def self.create_data_element(repo_org, repo_name)
|
102
|
+
"<div id='git-data-element' data-org='#{repo_org}' data-repo='#{repo_name}'></div>"
|
97
103
|
end
|
98
104
|
|
99
105
|
end
|
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: github-to-canvas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.56
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- maxwellbenton
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2020-05-12 00:00:00.000000000 Z
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '2.3'
|
69
|
-
description:
|
69
|
+
description:
|
70
70
|
email: maxwell@flatironschool.com
|
71
71
|
executables:
|
72
72
|
- github-to-canvas
|
@@ -91,7 +91,7 @@ homepage: https://github.com/learn-co-curriculum/github-to-canvas
|
|
91
91
|
licenses:
|
92
92
|
- MIT
|
93
93
|
metadata: {}
|
94
|
-
post_install_message:
|
94
|
+
post_install_message:
|
95
95
|
rdoc_options: []
|
96
96
|
require_paths:
|
97
97
|
- lib
|
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
107
|
version: '0'
|
108
108
|
requirements: []
|
109
109
|
rubygems_version: 3.1.4
|
110
|
-
signing_key:
|
110
|
+
signing_key:
|
111
111
|
specification_version: 4
|
112
112
|
summary: github-to-canvas is a tool for migrating and aligning GitHub content with
|
113
113
|
the Canvas LMS
|