Class: Snaptoken::Commands::Commit

Inherits:
BaseCommand show all
Defined in:
lib/snaptoken/commands/commit.rb

Instance Attribute Summary

Attributes inherited from BaseCommand

#config

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseCommand

#git_to_litdiff!, inherited, #initialize, #litdiff_to_git!, #needs!, #parseopts!

Constructor Details

This class inherits a constructor from Snaptoken::Commands::BaseCommand

Class Method Details

.nameObject



2
3
4
# File 'lib/snaptoken/commands/commit.rb', line 2

def self.name
  "commit"
end

.summaryObject



6
7
8
# File 'lib/snaptoken/commands/commit.rb', line 6

def self.summary
  "Append or insert a new step."
end

.usageObject



10
11
12
# File 'lib/snaptoken/commands/commit.rb', line 10

def self.usage
  ""
end

Instance Method Details

#runObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/snaptoken/commands/commit.rb', line 17

def run
  needs! :config, :repo

  if @git.commit!
    git_to_litdiff!
    puts "Success!"
  else
    puts "Looks like you've got a conflict to resolve!"
  end
end

#setopts!(o) ⇒ Object



14
15
# File 'lib/snaptoken/commands/commit.rb', line 14

def setopts!(o)
end