github-to-canvas 0.0.52 → 0.0.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/github-to-canvas +4 -4
- 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: 700beff2aa372bc0ddd7f8faf571f512530fbcaf554ce723c8906e3c4537fd89
|
4
|
+
data.tar.gz: acd4476c34e0e79b4b042e8760be95ab80e8d88a44a6c425bbd351328ea01a1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e2717eb284c2521c05507a63e1de6f9e54ebac23cc37b06967857ce8f669a78355eaa33da631dddf06257167f5f21e871eefe7025ed9a2b8f3891e86570e744
|
7
|
+
data.tar.gz: b5579232cc6a7f69f0c0e6dfcf9cc46f1a2078a7478c845e0f5f9db3c20710d67eb55b4861d0bd3c0357612f11fd841634c898bd962a7d339a832c2dda85c779
|
data/bin/github-to-canvas
CHANGED
@@ -183,8 +183,8 @@ if options[:create_lesson]
|
|
183
183
|
save_to_github: !!options[:save_to_github],
|
184
184
|
fis_links: !!options[:fis],
|
185
185
|
remove_header_and_footer: !!options[:remove_header_and_footer],
|
186
|
-
only_update_content: !!options[:only_content]
|
187
|
-
forkable: !!options[:forkable]
|
186
|
+
only_update_content: !!options[:only_content],
|
187
|
+
forkable: !!options[:forkable])
|
188
188
|
end
|
189
189
|
|
190
190
|
if options[:align]
|
@@ -199,6 +199,6 @@ if options[:align]
|
|
199
199
|
save_to_github: !!options[:save_to_github],
|
200
200
|
fis_links: !!options[:fis],
|
201
201
|
remove_header_and_footer: !!options[:remove_header_and_footer],
|
202
|
-
only_update_content: !!options[:only_content]
|
203
|
-
forkable: !!options[:forkable]
|
202
|
+
only_update_content: !!options[:only_content],
|
203
|
+
forkable: !!options[:forkable])
|
204
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.57
|
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
|