Module: Docks::Helpers::Github
- Defined in:
- lib/docks/helpers/github_helper.rb
Instance Method Summary collapse
- #github_issue_message ⇒ Object
- #github_root_url ⇒ Object
- #github_url(file) ⇒ Object
- #has_github? ⇒ Boolean
- #relative_pattern_files ⇒ Object
Instance Method Details
#github_issue_message ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/docks/helpers/github_helper.rb', line 12 def root = Docks.config.root.to_s files = @pattern.files.map { |file| file.sub(root, "") } file_checklist = relative_pattern_files.map { |file| "- [#{@pattern.files.length == 1 ? "x" : " "}] [#{file}](#{github_url(file)})" }.join("\n") "\n\n\n---\n\nThis issue is related to the following files:\n\n#{file_checklist}" end |
#github_root_url ⇒ Object
24 25 26 |
# File 'lib/docks/helpers/github_helper.rb', line 24 def github_root_url @github_root_url ||= Docks.config.github_repo.sub(/(.)\/?$/, '\1') end |
#github_url(file) ⇒ Object
8 9 10 |
# File 'lib/docks/helpers/github_helper.rb', line 8 def github_url(file) "#{github_root_url}/blob/master/#{url_encode(file).gsub("%2F", "/").sub(/^\//, "")}" end |