Class: Hookers::Commands::GitCommit
- Inherits:
-
Object
- Object
- Hookers::Commands::GitCommit
- Includes:
- Hookers::Command
- Defined in:
- lib/hookers/commands/git_commit.rb
Constant Summary collapse
- KEYS =
%w(bug feature story fixed fixes completed finished delivers)
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#git ⇒ Object
Returns the value of attribute git.
-
#options ⇒ Object
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(command, args) ⇒ GitCommit
constructor
A new instance of GitCommit.
- #run ⇒ Object
Methods included from Hookers::Command
Constructor Details
#initialize(command, args) ⇒ GitCommit
Returns a new instance of GitCommit.
21 22 23 24 |
# File 'lib/hookers/commands/git_commit.rb', line 21 def initialize(command, args) self. = (args) self.git = Git::Repository.new end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
8 9 10 |
# File 'lib/hookers/commands/git_commit.rb', line 8 def command @command end |
#git ⇒ Object
Returns the value of attribute git.
8 9 10 |
# File 'lib/hookers/commands/git_commit.rb', line 8 def git @git end |
#options ⇒ Object
Returns the value of attribute options.
8 9 10 |
# File 'lib/hookers/commands/git_commit.rb', line 8 def @options end |
Class Method Details
.slop ⇒ Object
14 15 16 17 18 19 |
# File 'lib/hookers/commands/git_commit.rb', line 14 def self.slop Slop.new(help: true) do on :m, "Message to be used on commit", argument: true on :id, "Pivotal story id", argument: true end end |
Instance Method Details
#run ⇒ Object
26 27 28 |
# File 'lib/hookers/commands/git_commit.rb', line 26 def run puts git.commit "[#{self.command.upcase} ##{[:id]}] #{[:m]}" end |