Class: MarkdownRubyDocumentation::GitHubProject
- Inherits:
-
Object
- Object
- MarkdownRubyDocumentation::GitHubProject
- Defined in:
- lib/markdown_ruby_documentation/git_hub_project.rb
Class Method Summary collapse
- .branch ⇒ Object
- .current_branch ⇒ Object
- .git_url ⇒ Object
- .root_path ⇒ Object
- .set_branch(branch) ⇒ Object
- .url ⇒ Object
Class Method Details
.branch ⇒ Object
20 21 22 |
# File 'lib/markdown_ruby_documentation/git_hub_project.rb', line 20 def branch @branch || current_branch end |
.current_branch ⇒ Object
24 25 26 |
# File 'lib/markdown_ruby_documentation/git_hub_project.rb', line 24 def current_branch `git rev-parse --abbrev-ref HEAD`.chomp end |
.git_url ⇒ Object
4 5 6 |
# File 'lib/markdown_ruby_documentation/git_hub_project.rb', line 4 def git_url `git config --get remote.origin.url`.chomp end |
.root_path ⇒ Object
12 13 14 |
# File 'lib/markdown_ruby_documentation/git_hub_project.rb', line 12 def root_path `git rev-parse --show-toplevel`.chomp end |
.set_branch(branch) ⇒ Object
16 17 18 |
# File 'lib/markdown_ruby_documentation/git_hub_project.rb', line 16 def set_branch(branch) @branch = branch end |
.url ⇒ Object
8 9 10 |
# File 'lib/markdown_ruby_documentation/git_hub_project.rb', line 8 def url "https://github.com/#{git_url.split(":").last.gsub(".git", "")}".chomp end |