legit 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +10 -6
- data/legit.gemspec +2 -2
- data/lib/legit/version.rb +1 -1
- data/test/legit_test.rb +105 -88
- data/test/test_helper.rb +38 -3
- data/test/test_repo.rb +44 -0
- metadata +174 -138
- checksums.yaml +0 -7
- data/test/setup_test_repo.rb +0 -27
data/README.md
CHANGED
@@ -11,9 +11,18 @@
|
|
11
11
|
$ gem install legit
|
12
12
|
```
|
13
13
|
|
14
|
+
Requires ruby >= 1.8.7
|
15
|
+
|
14
16
|
## Usage
|
15
17
|
Run `legit` with no options to see a list of commands and options.
|
16
18
|
|
19
|
+
### legit checkout
|
20
|
+
Recommended alias: `lco`
|
21
|
+
|
22
|
+
Fuzzy git checkout
|
23
|
+
|
24
|
+
![legit checkout example](http://i.imgur.com/3RS02IB.png)
|
25
|
+
|
17
26
|
### Setting Up a `catch-todos` `pre-commit` Hook
|
18
27
|
![$ git up](http://i.imgur.com/rv0AfQi.png)
|
19
28
|
|
@@ -34,12 +43,7 @@ legit catch-todos --disable # will not check todos until re-enabled
|
|
34
43
|
legit catch-todos --enable # sets it back to normal
|
35
44
|
```
|
36
45
|
|
37
|
-
Note:
|
38
|
-
|
39
|
-
RVM and similar tools do store executables in custom locations instead of the standard locations for executables such as `/usr/bin`. Since your `.bash_profile` (or similar) might not be executed by your GUI tool, you may need to create a symlink to legit in a location that is in the tool's default path. `/usr/bin` is usually included, so this should do:
|
40
|
-
```bash
|
41
|
-
sudo ln -s $(which legit) /usr/bin/legit # find where RVM is storing legit and add a symlink to it in /usr/bin
|
42
|
-
```
|
46
|
+
Note: some graphical git tools may not run git hooks.
|
43
47
|
|
44
48
|
## Contributing
|
45
49
|
|
data/legit.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
|
|
18
18
|
|
19
19
|
gem.add_development_dependency "rake", "~> 10.1.0"
|
20
20
|
gem.add_development_dependency "minitest", "~> 5.0.1"
|
21
|
-
gem.add_development_dependency "
|
21
|
+
gem.add_development_dependency "rr", "~> 1.1.2"
|
22
22
|
gem.add_development_dependency "guard-minitest"
|
23
23
|
gem.add_development_dependency "growl"
|
24
24
|
gem.add_development_dependency "rb-fsevent"
|
@@ -26,5 +26,5 @@ Gem::Specification.new do |gem|
|
|
26
26
|
|
27
27
|
gem.add_runtime_dependency "json", "~> 1.8.0"
|
28
28
|
gem.add_runtime_dependency "thor", "~> 0.18.1"
|
29
|
-
gem.add_runtime_dependency "rugged", "~> 0.
|
29
|
+
gem.add_runtime_dependency "rugged", "~> 0.18.0.b1"
|
30
30
|
end
|
data/lib/legit/version.rb
CHANGED
data/test/legit_test.rb
CHANGED
@@ -1,174 +1,191 @@
|
|
1
1
|
require File.expand_path('../test_helper', __FILE__)
|
2
2
|
require 'legit'
|
3
|
-
require File.expand_path('../
|
3
|
+
require File.expand_path('../test_repo', __FILE__)
|
4
4
|
|
5
5
|
describe Legit::CLI do
|
6
|
-
|
6
|
+
def expects_command(command)
|
7
|
+
any_instance_of(Legit::CLI) { |cli| mock(cli).run_command(command) }
|
8
|
+
end
|
7
9
|
|
8
10
|
before do
|
9
11
|
stub_config
|
10
|
-
Legit::CLI
|
11
|
-
|
12
|
+
any_instance_of(Legit::CLI) do |cli|
|
13
|
+
stub(cli).run_command
|
14
|
+
end
|
12
15
|
end
|
13
16
|
|
14
17
|
describe 'legit log' do
|
15
18
|
it "parses --me command and passes through other options" do
|
16
|
-
args = 'log -p --me -n 1'
|
17
19
|
stub_config({ 'user.name' => 'Stubbed Username' })
|
18
|
-
|
19
|
-
|
20
|
+
expects_command("#{Legit::Helpers::LOG_BASE_COMMAND} --author='Stubbed Username' -p -n 1")
|
21
|
+
legit 'log -p --me -n 1', :real_repo => false
|
20
22
|
end
|
21
23
|
|
22
24
|
it "passes through options that aren't defined by legit log" do
|
23
|
-
|
24
|
-
|
25
|
-
Legit::CLI.start(args.split(' '))
|
25
|
+
expects_command("#{Legit::Helpers::LOG_BASE_COMMAND} -p --stat")
|
26
|
+
legit 'log -p --stat', :real_repo => false
|
26
27
|
end
|
27
28
|
end
|
28
29
|
|
29
30
|
describe 'legit catch-todos' do
|
30
31
|
it "calls exit 1 when TODOs staged but not disabled" do
|
31
|
-
Legit::CLI
|
32
|
-
|
33
|
-
|
34
|
-
|
32
|
+
any_instance_of(Legit::CLI) do |cli|
|
33
|
+
mock(cli).todos_staged?('TODO') { true }
|
34
|
+
mock(cli).exit(1)
|
35
|
+
mock(cli).say("[pre-commit hook] Aborting commit... found staged `TODO`s.", :red)
|
36
|
+
end
|
37
|
+
legit 'catch-todos', :real_repo => false
|
35
38
|
end
|
36
39
|
|
37
40
|
it "doesn't call exit 1 when no TODOs staged" do
|
38
|
-
Legit::CLI
|
39
|
-
|
40
|
-
|
41
|
-
|
41
|
+
any_instance_of(Legit::CLI) do |cli|
|
42
|
+
mock(cli).todos_staged?('TODO') { false }
|
43
|
+
mock(cli).exit.never
|
44
|
+
mock(cli).say("[pre-commit hook] Success: No `TODO`s staged.", :green)
|
45
|
+
end
|
46
|
+
legit 'catch-todos', :real_repo => false
|
42
47
|
end
|
43
48
|
|
44
49
|
it "removes catch-todos-mode when called with --enable" do
|
45
|
-
config_mock = mock('
|
46
|
-
config_mock
|
47
|
-
|
48
|
-
Legit::CLI.start('catch-todos --enable'.split(' '))
|
50
|
+
config_mock = mock(Object.new).delete('hooks.catch-todos-mode')
|
51
|
+
stub_config(config_mock)
|
52
|
+
legit 'catch-todos --enable', :real_repo => false
|
49
53
|
end
|
50
54
|
|
51
55
|
it "sets catch-todos-mode to disable when called with --disable" do
|
52
|
-
config_mock = mock('
|
53
|
-
config_mock
|
54
|
-
|
55
|
-
Legit::CLI.start('catch-todos --disable'.split(' '))
|
56
|
+
config_mock = mock(Object.new).[]=('hooks.catch-todos-mode', 'disable')
|
57
|
+
stub_config(config_mock)
|
58
|
+
legit 'catch-todos --disable', :real_repo => false
|
56
59
|
end
|
57
60
|
|
58
61
|
it "sets catch-todos-mode to warn when called with --warn" do
|
59
|
-
config_mock = mock('
|
60
|
-
config_mock
|
61
|
-
|
62
|
-
Legit::CLI.start('catch-todos --warn'.split(' '))
|
62
|
+
config_mock = mock(Object.new).[]=('hooks.catch-todos-mode', 'warn')
|
63
|
+
stub_config(config_mock)
|
64
|
+
legit 'catch-todos --warn', :real_repo => false
|
63
65
|
end
|
64
66
|
|
65
67
|
it "skips catch-todos when disabled" do
|
66
68
|
stub_config('hooks.catch-todos-mode' => 'disable')
|
67
|
-
Legit::CLI
|
68
|
-
|
69
|
-
|
69
|
+
any_instance_of(Legit::CLI) do |cli|
|
70
|
+
mock(cli).run_catch_todos.never
|
71
|
+
mock(cli).say("[pre-commit hook] ignoring todos. Re-enable with `legit catch-todos --enable`", :yellow)
|
72
|
+
end
|
73
|
+
legit 'catch-todos', :real_repo => false
|
70
74
|
end
|
71
75
|
|
72
76
|
it "have exit status of 0 in warn mode when positive response" do
|
73
77
|
stub_config('hooks.catch-todos-mode' => 'warn')
|
74
|
-
Legit::CLI
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
+
any_instance_of(Legit::CLI) do |cli|
|
79
|
+
mock(cli).todos_staged?('TODO') { true }
|
80
|
+
mock(cli).exit.never
|
81
|
+
mock(cli).yes?("[pre-commit hook] Found staged `TODO`s. Do you still want to continue?", :yellow) { true }
|
82
|
+
end
|
83
|
+
|
84
|
+
legit 'catch-todos', :real_repo => false
|
78
85
|
end
|
79
86
|
end
|
80
87
|
|
81
88
|
describe 'legit delete' do
|
82
89
|
it 'force deletes branch when user responds yes' do
|
83
|
-
Legit::CLI
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
90
|
+
any_instance_of(Legit::CLI) do |cli|
|
91
|
+
mock(cli).delete_local_branch!('branch_to_delete') { false }
|
92
|
+
mock(cli).yes?('Force delete branch?', :red) { true }
|
93
|
+
mock(cli).force_delete_local_branch!('branch_to_delete')
|
94
|
+
mock(cli).delete_remote_branch?('branch_to_delete') { false }
|
95
|
+
end
|
96
|
+
|
97
|
+
legit 'delete branch_to_delete', :real_repo => false
|
88
98
|
end
|
89
99
|
|
90
100
|
it "doesn't force delete branch when user responds no" do
|
91
|
-
Legit::CLI
|
92
|
-
|
93
|
-
|
94
|
-
|
101
|
+
any_instance_of(Legit::CLI) do |cli|
|
102
|
+
mock(cli).delete_local_branch!('branch_to_delete') { false }
|
103
|
+
mock(cli).yes?('Force delete branch?', :red) { false }
|
104
|
+
mock(cli).force_delete_local_branch!.never
|
105
|
+
end
|
106
|
+
legit 'delete branch_to_delete', :real_repo => false
|
95
107
|
end
|
96
108
|
|
97
109
|
it 'deletes remotely when user responds yes' do
|
98
|
-
Legit::CLI
|
99
|
-
|
100
|
-
|
110
|
+
any_instance_of(Legit::CLI) do |cli|
|
111
|
+
mock(cli).delete_local_branch!('branch_to_delete') { true }
|
112
|
+
mock(cli).yes?.with('Delete branch remotely?', :red) { true }
|
113
|
+
end
|
114
|
+
legit 'delete branch_to_delete', :real_repo => false
|
101
115
|
end
|
102
116
|
|
103
117
|
it "doesn't delete remotely when user responds no" do
|
104
|
-
Legit::CLI
|
105
|
-
|
106
|
-
|
118
|
+
any_instance_of(Legit::CLI) do |cli|
|
119
|
+
mock(cli).delete_local_branch!('branch_to_delete') { true }
|
120
|
+
mock(cli).yes?('Delete branch remotely?', :red) { false }
|
121
|
+
end
|
122
|
+
legit 'delete branch_to_delete', :real_repo => false
|
107
123
|
end
|
108
124
|
end
|
109
125
|
|
110
126
|
describe "legit checkout" do
|
111
127
|
before do
|
112
|
-
|
128
|
+
@branches = %w{ feature_with_unique_match multiple_matches_a multiple_matches_b UPPERCASE_BRANCH }
|
113
129
|
end
|
114
130
|
|
115
131
|
it "checks out branch that matches substring" do
|
116
|
-
|
117
|
-
|
132
|
+
expects_command('git checkout feature_with_unique_match')
|
133
|
+
legit 'checkout niqu', :branches => @branches
|
118
134
|
end
|
119
135
|
|
120
136
|
it "lists options if non-unique match" do
|
121
|
-
Legit::CLI
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
137
|
+
any_instance_of(Legit::CLI) do |cli|
|
138
|
+
mock(cli).run_command.never
|
139
|
+
mock(cli).ask("Choose a branch to checkout:\n1. multiple_matches_a\n2. multiple_matches_b", :yellow) { '2' }
|
140
|
+
end
|
141
|
+
|
142
|
+
expects_command('git checkout multiple_matches_b')
|
143
|
+
legit 'checkout multiple_matches', :branches => @branches
|
126
144
|
end
|
127
145
|
|
128
146
|
it "calls checkout on branch if unique match" do
|
129
|
-
|
130
|
-
|
147
|
+
expects_command('git checkout feature_with_unique_match')
|
148
|
+
legit 'checkout unique', :branches => @branches
|
131
149
|
end
|
132
150
|
|
133
151
|
it "uses case-insensitive regex" do
|
134
|
-
|
135
|
-
|
152
|
+
expects_command('git checkout UPPERCASE_BRANCH')
|
153
|
+
legit 'checkout uppercase', :branches => @branches
|
136
154
|
end
|
137
155
|
|
138
156
|
it "doesn't call checkout and exits if no match" do
|
139
|
-
Legit::CLI
|
140
|
-
|
141
|
-
|
157
|
+
any_instance_of(Legit::CLI) do |cli|
|
158
|
+
mock(cli).run_command.never
|
159
|
+
mock(cli).say("No branches match /this_shouldnt_match_anything/i", :red)
|
160
|
+
end
|
161
|
+
assert_raises(SystemExit) do
|
162
|
+
legit 'checkout this_shouldnt_match_anything', :branches => @branches
|
163
|
+
end
|
142
164
|
end
|
143
165
|
|
144
166
|
it "calls checkout on branch if unique match" do
|
145
|
-
|
146
|
-
|
167
|
+
expects_command('git checkout feature_with_unique_match')
|
168
|
+
legit 'checkout _wit.', :branches => @branches
|
147
169
|
end
|
148
170
|
|
149
171
|
it "doesn't call checkout and exits if there is no regex match" do
|
150
|
-
Legit::CLI
|
151
|
-
|
152
|
-
|
172
|
+
any_instance_of(Legit::CLI) do |cli|
|
173
|
+
mock(cli).run_command.never
|
174
|
+
mock(cli).say("No branches match /^_wit./i", :red)
|
175
|
+
end
|
176
|
+
assert_raises(SystemExit) do
|
177
|
+
legit 'checkout ^_wit.', :branches => @branches
|
178
|
+
end
|
153
179
|
end
|
154
180
|
end
|
155
181
|
|
156
182
|
describe 'legit bisect' do
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
183
|
+
it "calls the right commands" do
|
184
|
+
command = 'ruby -n my/test/file "/testpattern/"'
|
185
|
+
expects_command('git bisect start HEAD HEAD~5')
|
186
|
+
expects_command("git bisect run #{command}")
|
187
|
+
expects_command("git bisect reset")
|
188
|
+
legit "bisect HEAD HEAD~5 #{command}", :real_repo => false
|
189
|
+
end
|
163
190
|
end
|
164
191
|
end
|
165
|
-
|
166
|
-
def stub_config(config = {})
|
167
|
-
Legit::CLI.any_instance.stubs(:repo => stub({ :config => config }))
|
168
|
-
end
|
169
|
-
|
170
|
-
def setup_example_repo
|
171
|
-
SetupTestRepo.new.invoke(:create_repo)
|
172
|
-
example_repo = Rugged::Repository.new(File.expand_path('../example_repo', __FILE__))
|
173
|
-
Legit::CLI.any_instance.stubs(:repo => example_repo)
|
174
|
-
end
|
data/test/test_helper.rb
CHANGED
@@ -1,8 +1,43 @@
|
|
1
|
+
Bundler.require(:pry) if ENV['PRY']
|
2
|
+
|
1
3
|
require 'coveralls'
|
2
4
|
Coveralls.wear!
|
3
5
|
|
4
|
-
require
|
6
|
+
require 'minitest/autorun'
|
7
|
+
require 'rr'
|
8
|
+
|
9
|
+
require 'thor'
|
10
|
+
# silence warnings for mocks
|
11
|
+
class Thor
|
12
|
+
def self.create_command(meth) #:nodoc:
|
13
|
+
if @usage && @desc
|
14
|
+
base_class = @hide ? Thor::HiddenCommand : Thor::Command
|
15
|
+
commands[meth] = base_class.new(meth, @desc, @long_desc, @usage, method_options)
|
16
|
+
@usage, @desc, @long_desc, @method_options, @hide = nil
|
17
|
+
true
|
18
|
+
elsif self.all_commands[meth] || meth == "method_missing"
|
19
|
+
true
|
20
|
+
else
|
21
|
+
#puts "[WARNING] Attempted to create command #{meth.inspect} without usage or description. " <<
|
22
|
+
# "Call desc if you want this method to be available as command or declare it inside a " <<
|
23
|
+
# "no_commands{} block. Invoked from #{caller[1].inspect}."
|
24
|
+
false
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
5
28
|
|
6
|
-
|
29
|
+
def legit(command, options = {})
|
30
|
+
fake_repo = options.delete(:fake_repo)
|
31
|
+
run_command = Proc.new { Legit::CLI.start(command.split(' ')) }
|
32
|
+
if fake_repo
|
33
|
+
run_command.call
|
34
|
+
else
|
35
|
+
TestRepo.inside(options, &run_command)
|
36
|
+
end
|
37
|
+
end
|
7
38
|
|
8
|
-
|
39
|
+
def stub_config(config = {})
|
40
|
+
any_instance_of(Rugged::Repository) do |repo|
|
41
|
+
stub(repo).config { config }
|
42
|
+
end
|
43
|
+
end
|
data/test/test_repo.rb
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
class TestRepo
|
4
|
+
|
5
|
+
def self.inside(options = {}, &block)
|
6
|
+
block_given? or raise "Must pass in block"
|
7
|
+
repo = TestRepo.new(options[:branches])
|
8
|
+
repo.create!
|
9
|
+
Dir.chdir(repo.test_dir, &block)
|
10
|
+
ensure
|
11
|
+
repo.destroy!
|
12
|
+
end
|
13
|
+
|
14
|
+
def initialize(branches)
|
15
|
+
@branches = branches || []
|
16
|
+
end
|
17
|
+
|
18
|
+
def create!
|
19
|
+
FileUtils.mkdir_p(test_dir)
|
20
|
+
FileUtils.cd(test_dir) do
|
21
|
+
`git init`
|
22
|
+
`git config user.name "John Doe" && git config user.email johndoe@example.com`
|
23
|
+
setup_branches
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def destroy!
|
28
|
+
FileUtils.rm_rf(test_dir)
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_dir
|
32
|
+
File.expand_path('../sandbox', __FILE__)
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
def setup_branches
|
37
|
+
File.open('README.txt', 'w') {|f| f.write("Example repo for testing\n") }
|
38
|
+
`git add .`
|
39
|
+
`git commit -m 'Add README'`
|
40
|
+
@branches.each do |branch_name|
|
41
|
+
`git branch #{branch_name}`
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
metadata
CHANGED
@@ -1,164 +1,187 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: legit
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 3
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 14
|
10
|
+
version: 0.0.14
|
5
11
|
platform: ruby
|
6
|
-
authors:
|
12
|
+
authors:
|
7
13
|
- Dillon Kearns
|
8
14
|
autorequire:
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
+
|
18
|
+
date: 2013-09-01 00:00:00 -07:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
23
|
+
none: false
|
24
|
+
requirements:
|
17
25
|
- - ~>
|
18
|
-
- !ruby/object:Gem::Version
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
hash: 75
|
28
|
+
segments:
|
29
|
+
- 10
|
30
|
+
- 1
|
31
|
+
- 0
|
19
32
|
version: 10.1.0
|
20
|
-
|
33
|
+
version_requirements: *id001
|
21
34
|
prerelease: false
|
22
|
-
|
23
|
-
requirements:
|
24
|
-
- - ~>
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 10.1.0
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: minitest
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ~>
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 5.0.1
|
35
|
+
name: rake
|
34
36
|
type: :development
|
35
|
-
|
36
|
-
|
37
|
-
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
38
41
|
- - ~>
|
39
|
-
- !ruby/object:Gem::Version
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 53
|
44
|
+
segments:
|
45
|
+
- 5
|
46
|
+
- 0
|
47
|
+
- 1
|
40
48
|
version: 5.0.1
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
49
|
+
version_requirements: *id002
|
50
|
+
prerelease: false
|
51
|
+
name: minitest
|
52
|
+
type: :development
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
56
|
+
requirements:
|
45
57
|
- - ~>
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
hash: 23
|
60
|
+
segments:
|
61
|
+
- 1
|
62
|
+
- 1
|
63
|
+
- 2
|
64
|
+
version: 1.1.2
|
65
|
+
version_requirements: *id003
|
66
|
+
prerelease: false
|
67
|
+
name: rr
|
48
68
|
type: :development
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
71
|
+
none: false
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
hash: 3
|
76
|
+
segments:
|
77
|
+
- 0
|
78
|
+
version: "0"
|
79
|
+
version_requirements: *id004
|
49
80
|
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ~>
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 0.14.0
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
81
|
name: guard-minitest
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - '>='
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
82
|
type: :development
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
85
|
+
none: false
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
hash: 3
|
90
|
+
segments:
|
91
|
+
- 0
|
92
|
+
version: "0"
|
93
|
+
version_requirements: *id005
|
63
94
|
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - '>='
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
95
|
name: growl
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - '>='
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
96
|
type: :development
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
99
|
+
none: false
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
hash: 3
|
104
|
+
segments:
|
105
|
+
- 0
|
106
|
+
version: "0"
|
107
|
+
version_requirements: *id006
|
77
108
|
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - '>='
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
109
|
name: rb-fsevent
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - '>='
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
110
|
type: :development
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
hash: 3
|
118
|
+
segments:
|
119
|
+
- 0
|
120
|
+
version: "0"
|
121
|
+
version_requirements: *id007
|
91
122
|
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - '>='
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
123
|
name: coveralls
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - '>='
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
124
|
type: :development
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: json
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
127
|
+
none: false
|
128
|
+
requirements:
|
115
129
|
- - ~>
|
116
|
-
- !ruby/object:Gem::Version
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
hash: 55
|
132
|
+
segments:
|
133
|
+
- 1
|
134
|
+
- 8
|
135
|
+
- 0
|
117
136
|
version: 1.8.0
|
118
|
-
|
137
|
+
version_requirements: *id008
|
119
138
|
prerelease: false
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
name: thor
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
139
|
+
name: json
|
140
|
+
type: :runtime
|
141
|
+
- !ruby/object:Gem::Dependency
|
142
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
143
|
+
none: false
|
144
|
+
requirements:
|
129
145
|
- - ~>
|
130
|
-
- !ruby/object:Gem::Version
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
hash: 85
|
148
|
+
segments:
|
149
|
+
- 0
|
150
|
+
- 18
|
151
|
+
- 1
|
131
152
|
version: 0.18.1
|
132
|
-
|
153
|
+
version_requirements: *id009
|
133
154
|
prerelease: false
|
134
|
-
|
135
|
-
|
155
|
+
name: thor
|
156
|
+
type: :runtime
|
157
|
+
- !ruby/object:Gem::Dependency
|
158
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
159
|
+
none: false
|
160
|
+
requirements:
|
136
161
|
- - ~>
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
|
139
|
-
|
162
|
+
- !ruby/object:Gem::Version
|
163
|
+
hash: 3106864031
|
164
|
+
segments:
|
165
|
+
- 0
|
166
|
+
- 18
|
167
|
+
- 0
|
168
|
+
- b
|
169
|
+
- 1
|
170
|
+
version: 0.18.0.b1
|
171
|
+
version_requirements: *id010
|
172
|
+
prerelease: false
|
140
173
|
name: rugged
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - ~>
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: 0.19.0
|
146
174
|
type: :runtime
|
147
|
-
|
148
|
-
|
149
|
-
requirements:
|
150
|
-
- - ~>
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: 0.19.0
|
153
|
-
description: A collection of scripts for common git tasks to simplify and improve
|
154
|
-
workflow.
|
155
|
-
email:
|
175
|
+
description: A collection of scripts for common git tasks to simplify and improve workflow.
|
176
|
+
email:
|
156
177
|
- dillon@dillonkearns.com
|
157
|
-
executables:
|
178
|
+
executables:
|
158
179
|
- legit
|
159
180
|
extensions: []
|
181
|
+
|
160
182
|
extra_rdoc_files: []
|
161
|
-
|
183
|
+
|
184
|
+
files:
|
162
185
|
- .gitignore
|
163
186
|
- .travis.yml
|
164
187
|
- Gemfile
|
@@ -172,32 +195,45 @@ files:
|
|
172
195
|
- lib/legit/helpers.rb
|
173
196
|
- lib/legit/version.rb
|
174
197
|
- test/legit_test.rb
|
175
|
-
- test/setup_test_repo.rb
|
176
198
|
- test/test_helper.rb
|
199
|
+
- test/test_repo.rb
|
200
|
+
has_rdoc: true
|
177
201
|
homepage: https://github.com/dillonkearns/legit
|
178
202
|
licenses: []
|
179
|
-
|
203
|
+
|
180
204
|
post_install_message:
|
181
205
|
rdoc_options: []
|
182
|
-
|
206
|
+
|
207
|
+
require_paths:
|
183
208
|
- lib
|
184
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
185
|
-
|
186
|
-
|
187
|
-
|
209
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
210
|
+
none: false
|
211
|
+
requirements:
|
212
|
+
- - ">="
|
213
|
+
- !ruby/object:Gem::Version
|
214
|
+
hash: 57
|
215
|
+
segments:
|
216
|
+
- 1
|
217
|
+
- 8
|
218
|
+
- 7
|
188
219
|
version: 1.8.7
|
189
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
220
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
221
|
+
none: false
|
222
|
+
requirements:
|
223
|
+
- - ">="
|
224
|
+
- !ruby/object:Gem::Version
|
225
|
+
hash: 3
|
226
|
+
segments:
|
227
|
+
- 0
|
228
|
+
version: "0"
|
194
229
|
requirements: []
|
230
|
+
|
195
231
|
rubyforge_project:
|
196
|
-
rubygems_version:
|
232
|
+
rubygems_version: 1.5.3
|
197
233
|
signing_key:
|
198
|
-
specification_version:
|
234
|
+
specification_version: 3
|
199
235
|
summary: A collection of scripts for common git tasks to simplify and improve workflow.
|
200
|
-
test_files:
|
236
|
+
test_files:
|
201
237
|
- test/legit_test.rb
|
202
|
-
- test/setup_test_repo.rb
|
203
238
|
- test/test_helper.rb
|
239
|
+
- test/test_repo.rb
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 496dfcd5cb7b062ac51f2371e752980fe4104e82
|
4
|
-
data.tar.gz: ef4efafa23bd59980490b00997cc92fc9c5b115d
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 1f80616786cb2fe52f054131ff0debb1cd1df3b1ef43e1c3a72ce244b670027c2c6f9f1b7c8d701c3477d03b19a45102aef80fde62797c00862d7bb971e0ed95
|
7
|
-
data.tar.gz: 058acddbcdd1ba8ec4ea7c2012a32f765ce955b02cce1a76de8a2ac3c0d6adf9ffdbb351abfc9a316395b885f28acf644e72fbe6f374c0c02d5b223a7a26d879
|
data/test/setup_test_repo.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
require 'thor'
|
2
|
-
|
3
|
-
class SetupTestRepo < Thor
|
4
|
-
include Thor::Actions
|
5
|
-
|
6
|
-
desc "SOMETHING", 'something else'
|
7
|
-
def create_repo
|
8
|
-
test_location = File.expand_path('../example_repo', __FILE__)
|
9
|
-
remove_dir(test_location)
|
10
|
-
inside(test_location) do
|
11
|
-
run 'git init'
|
12
|
-
run 'git config user.name "John Doe" && git config user.email johndoe@example.com'
|
13
|
-
setup_branches
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
private
|
18
|
-
def setup_branches
|
19
|
-
create_file('README.txt', 'Example repo for testing')
|
20
|
-
run "git add ."
|
21
|
-
run "git commit -m 'Add README'"
|
22
|
-
branch_names = %w{ feature_with_unique_match multiple_matches_a multiple_matches_b UPPERCASE_BRANCH }
|
23
|
-
branch_names.each do |branch_name|
|
24
|
-
run "git branch #{branch_name}"
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|