Class: YARD::Nowpunk
- Inherits:
-
Object
- Object
- YARD::Nowpunk
- Defined in:
- lib/yard-nowpunk.rb
Overview
TODO ([email protected]): Rename this to yard-github
Class Method Summary collapse
- .github_master ⇒ Object
- .github_url ⇒ Object
- .parse_github_url_from_git_config ⇒ Object
- .project_name ⇒ Object
Class Method Details
.github_master ⇒ Object
24 25 26 |
# File 'lib/yard-nowpunk.rb', line 24 def github_master github_url + "/tree/master/" end |
.github_url ⇒ Object
20 21 22 |
# File 'lib/yard-nowpunk.rb', line 20 def github_url "http://" + parse_github_url_from_git_config end |
.parse_github_url_from_git_config ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/yard-nowpunk.rb', line 7 def parse_github_url_from_git_config remote_origin = Git.open(Dir.pwd).config["remote.origin.url"] @url ||= if remote_origin =~ /@/ remote_origin.gsub("git@", "").gsub(":", "/") else remote_origin.gsub("git://", "") end.gsub(".git", "") end |
.project_name ⇒ Object
16 17 18 |
# File 'lib/yard-nowpunk.rb', line 16 def project_name parse_github_url_from_git_config.match(/github\.com\/(.*)\/(.*)/)[2] end |