Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Extract GitTracker::Runner to do the leg work.

  • Loading branch information...
commit 2636372a41ab10577a2fe4ac392cf808d9c6f92f 1 parent 69f4a2b
@stevenharman authored
View
2  bin/git-tracker
@@ -1,4 +1,4 @@
#!/usr/bin/env ruby
require 'git_tracker'
-GitTracker.execute(*ARGV)
+GitTracker::Runner.execute(*ARGV)
View
16 lib/git_tracker.rb
@@ -1,19 +1,5 @@
require 'git_tracker/hook'
require 'git_tracker/prepare_commit_message'
+require 'git_tracker/runner'
require 'git_tracker/version'
-module GitTracker
- def self.execute(cmd_arg, *args)
- command = cmd_arg.gsub(/-/, '_')
- abort("[git_tracker] command: '#{cmd_arg}' does not exist.") unless respond_to?(command)
- send(command, *args)
- end
-
- def self.prepare_commit_msg(*args)
- PrepareCommitMessage.run(*args)
- end
-
- def self.install
- Hook.install
- end
-end
View
22 lib/git_tracker/runner.rb
@@ -0,0 +1,22 @@
+require 'git_tracker/prepare_commit_message'
+require 'git_tracker/hook'
+
+module GitTracker
+ module Runner
+
+ def self.execute(cmd_arg, *args)
+ command = cmd_arg.gsub(/-/, '_')
+ abort("[git_tracker] command: '#{cmd_arg}' does not exist.") unless respond_to?(command)
+ send(command, *args)
+ end
+
+ def self.prepare_commit_msg(*args)
+ PrepareCommitMessage.run(*args)
+ end
+
+ def self.install
+ Hook.install
+ end
+ end
+
+end
View
4 spec/git_tracker_spec.rb → spec/git_tracker/runner_spec.rb
@@ -1,7 +1,7 @@
require 'spec_helper'
-require 'git_tracker'
+require 'git_tracker/runner'
-describe GitTracker do
+describe GitTracker::Runner do
subject { described_class }
let(:args) { ['a_file', 'the_source', 'sha1234'] }

2 comments on commit 2636372

@vanstee

I wish git could tell that you moved methods from git_tracker.rb -> git_tracker/runner.rb.

@stevenharman

Agreed, that would be sweet. Although, Git was able to detect that I renamed the git_tracker_spec.rb file to git_tracker/runner_spec.rb, so that's nice.

Please sign in to comment.
Something went wrong with that request. Please try again.