Module: Texico::Git
- Defined in:
- lib/texico/git.rb
Class Method Summary collapse
- .init(target, initial_commit = false) ⇒ Object
- .list_tags(target) ⇒ Object
- .tag(target, label, message) ⇒ Object
Class Method Details
.init(target, initial_commit = false) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/texico/git.rb', line 6 def init(target, initial_commit = false) if initial_commit system "git init '#{target}' && git -C '#{target}' add . " \ "&& git -C '#{target}' commit -m 'Initial commit'" else system "git init '#{target}'" end end |
.list_tags(target) ⇒ Object
21 22 23 24 25 |
# File 'lib/texico/git.rb', line 21 def (target) Open3.popen2 "git -C '#{target}' tag -l" do |_, stdout, _| stdout.each_line.map { |line| line.chomp } end end |
.tag(target, label, message) ⇒ Object
16 17 18 |
# File 'lib/texico/git.rb', line 16 def tag(target, label, ) system "git -C '#{target}' tag -a #{label} -m '#{}'" end |