Class: MarkdownRubyDocumentation::GitHubProject

Inherits:
Object
  • Object
show all
Defined in:
lib/markdown_ruby_documentation/git_hub_project.rb

Class Method Summary collapse

Class Method Details

.branchObject



20
21
22
# File 'lib/markdown_ruby_documentation/git_hub_project.rb', line 20

def branch
  @branch || current_branch
end

.current_branchObject



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_urlObject



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_pathObject



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

.urlObject



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