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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4dd3ab1c6c19565bf5e03e674831589f0ab407f65afeb3cc6aadf14c28c2dfa7
4
- data.tar.gz: ba9661ec0bc2824d6d42fecf0c904232a2cc323c1dedc4803dafc7347959e992
3
+ metadata.gz: 35b2320509da12ac07b0a2905c4302b8a2d3d492f2fc04bcd5dc606b8fb36cb3
4
+ data.tar.gz: 7964bd362c1315ddf7203f6f9599e8a69469d59579457fb6dd632c80c0127be5
5
5
  SHA512:
6
- metadata.gz: ababba4146ccb17bdd7779600697d964b13f7a86827fcb3b6ecb05fdcea8cb34b4ab6153f994bbce8dc4c6b42acb45793f3b2eabff787a5161b664ba2b183282
7
- data.tar.gz: ed1939d585348330f4c7e39f66485093de9ef9f7af359ae55830e447a567040de97b4ad754d93a6a7a50ef910c181cf5933f0c0f48bbd02265ca8eea0df7961d
6
+ metadata.gz: c55a64f4a56fcb795af943a9db7e9799164cd19c5119738c0899ce3b73e1b8998a5c16ce676d5553828bf6d0f54b55d804c2066c2702e113ace009649e0ece3d
7
+ data.tar.gz: 37e1f2a57675d8ec0cb9dc6e36716b35b7ca8ab38b243e4cb6186a17fe0894c4b1ef8fde65dc0fbdaf3bb242d0bafcd08dd243abbb83acf03139de75597f95a4
@@ -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("--fork",
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
@@ -19,8 +19,8 @@ class GithubToCanvas
19
19
  save_to_github:false,
20
20
  fis_links:false,
21
21
  remove_header_and_footer:false,
22
- only_update_content: false),
23
- forkable: false
22
+ only_update_content: false,
23
+ forkable: false)
24
24
 
25
25
  if mode == 'version'
26
26
  puts VERSION
@@ -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
- header + readme
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' data-repo='#{repo_name}' href='#' target='_blank' rel='noopener'><img id='fork-img' title='Fork This Assignment' alt='Fork This Assignment' /></a>"
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
- } else {
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
@@ -1,3 +1,3 @@
1
1
  class GithubToCanvas
2
- VERSION = "0.0.51"
2
+ VERSION = "0.0.56"
3
3
  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.51
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