Module: GitExplorer
- Defined in:
- lib/git_explorer.rb,
lib/gitexplorer/version.rb
Defined Under Namespace
Classes: Explorer, GitStatus
Constant Summary
collapse
- VERSION =
"0.1.2"
Class Method Summary
collapse
Class Method Details
20
21
22
|
# File 'lib/git_explorer.rb', line 20
def self.
-> (dot_git_file_path) { dot_git_file_path.gsub(/\.git$/,'') }
end
|
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/git_explorer.rb', line 9
def self.
-> (status_output) {
project_name = status_output[/^(?<project_name>.*)$/, "project_name"]
branch = status_output[/On branch\s(?<branch>.*)/, "branch"]
status = :up_to_date unless status_output[/not staged/]
status = :not_staged if status_output[/not staged/]
files = status_output.scan(/modified: \s*(.*)$/).flatten
GitStatus.new(status, project_name, branch, files)
}
end
|