Module: GitPivot::Git
- Extended by:
- Shared
- Defined in:
- lib/git-pivot/git.rb
Class Method Summary collapse
- .branch ⇒ Object
- .config(param = nil) ⇒ Object
- .deliver ⇒ Object
- .finish(commit) ⇒ Object
- .info ⇒ Object
- .last_story(id = nil) ⇒ Object
- .repo ⇒ Object
- .start(id, type) ⇒ Object
Methods included from Shared
Class Method Details
.branch ⇒ Object
39 40 41 |
# File 'lib/git-pivot/git.rb', line 39 def branch @branch ||= repo.head.name end |
.config(param = nil) ⇒ Object
30 31 32 33 |
# File 'lib/git-pivot/git.rb', line 30 def config(param=nil) return repo.config unless param repo.config[param] end |
.deliver ⇒ Object
26 27 28 |
# File 'lib/git-pivot/git.rb', line 26 def deliver `git push` end |
.finish(commit) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/git-pivot/git.rb', line 14 def finish(commit) if has_changes? && commit out "Please enter your commit message: ", false close_commit input elsif has_changes? exit out "Please commit changes before closing ticket." end merge_branch out "Merged changes back to master." end |
.info ⇒ Object
48 49 50 51 52 53 |
# File 'lib/git-pivot/git.rb', line 48 def info """ -- Git Info -- Branch name: #{branch} """ end |
.last_story(id = nil) ⇒ Object
43 44 45 46 |
# File 'lib/git-pivot/git.rb', line 43 def last_story(id=nil) return config['pivotal.last-story'] unless id config['pivotal.last-story'] = id end |
.repo ⇒ Object
35 36 37 |
# File 'lib/git-pivot/git.rb', line 35 def repo @repo ||= Grit::Repo.new(`pwd`.strip) end |
.start(id, type) ⇒ Object
8 9 10 11 12 |
# File 'lib/git-pivot/git.rb', line 8 def start(id, type) branch_name = create_branch(id, type) last_story(id) "Switched to branch #{branch_name}..." end |