nit 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +9 -0
- data/lib/nit/command/commit.rb +8 -0
- data/lib/nit/lines.rb +1 -1
- data/lib/nit/version.rb +1 -1
- data/nit.gemspec +2 -2
- data/test/commands_test.rb +3 -1
- data/test/dummies/{stage → files}/brandnew.rb +0 -0
- data/test/dummies/{stage → files}/new.rb +0 -0
- data/test/dummies/{stage → files}/on_stage.rb +0 -0
- data/test/dummies/{stage → files}/staged.rb +0 -0
- data/test/dummies/{stage/git → git}/COMMIT_EDITMSG +0 -0
- data/test/dummies/{stage/git → git}/HEAD +0 -0
- data/test/dummies/{stage/git → git}/config +0 -0
- data/test/dummies/{stage/git → git}/description +0 -0
- data/test/dummies/{stage/git → git}/hooks/applypatch-msg.sample +0 -0
- data/test/dummies/{stage/git → git}/hooks/commit-msg.sample +0 -0
- data/test/dummies/{stage/git → git}/hooks/post-update.sample +0 -0
- data/test/dummies/{stage/git → git}/hooks/pre-applypatch.sample +0 -0
- data/test/dummies/{stage/git → git}/hooks/pre-commit.sample +0 -0
- data/test/dummies/{stage/git → git}/hooks/pre-rebase.sample +0 -0
- data/test/dummies/{stage/git → git}/hooks/prepare-commit-msg.sample +0 -0
- data/test/dummies/{stage/git → git}/hooks/update.sample +0 -0
- data/test/dummies/{stage/git → git}/index +0 -0
- data/test/dummies/{stage/git → git}/info/exclude +0 -0
- data/test/dummies/{stage/git → git}/logs/HEAD +0 -0
- data/test/dummies/{stage/git → git}/logs/refs/heads/master +0 -0
- data/test/dummies/{stage/git → git}/objects/0f/e4f83176db6842cd95f439f1edad3cb8483b4e +0 -0
- data/test/dummies/{stage/git → git}/objects/5c/0d92dd14afeb4c2bcd11bc3f072390be598a73 +0 -0
- data/test/dummies/{stage/git → git}/objects/60/bd895ee4a908b754f1980491c0e0852c29a8cd +0 -0
- data/test/dummies/{stage/git → git}/objects/b7/5ac79d08245a3a8a662520dd90f80be097cc44 +0 -0
- data/test/dummies/{stage/git → git}/objects/c1/172bf75d73a630c467f1e1448c44d9188fe23e +0 -0
- data/test/dummies/{stage/git → git}/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 +0 -0
- data/test/dummies/{stage/git → git}/refs/heads/master +0 -0
- data/test/lines_test.rb +2 -1
- data/test/nit_test.rb +27 -2
- data/test/status_test.rb +1 -0
- data/test/test_helper.rb +1 -0
- metadata +72 -74
- data/test/dummies/stage/.gitignore +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f516d5091e63c8591e12facb8e6971d19116c8bc
|
4
|
+
data.tar.gz: c76c5d753527a5568bce39965197aa5c1ddf34cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f3392cec82272850b8dd83bf405deb84c85e3c00746fc744e4d2b371675f91f782a32f7f75c094d1ceb51e918f5b132f45fdafff002768047de43a3e9e65c5a
|
7
|
+
data.tar.gz: afd638bc8f316a9982ae688137edaec506807d7a42935e69689eed73e0e0a58a272333ce054aa191a2b1b5014976b8f6d92a2480d60ef969a448317fd66bf994
|
data/CHANGES.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
## 0.0.5
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
## 0.0.4
|
6
|
+
|
7
|
+
* Fixed a bug where new files starting with one of the chars in [modified] weren't recognized.
|
8
|
+
* Finally allow `nit commit -m "awesome work" abc", it didn't really work on the CLI before.
|
9
|
+
|
1
10
|
## 0.0.3
|
2
11
|
|
3
12
|
* Some bug fixes.
|
data/lib/nit/command/commit.rb
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
class Nit::Command
|
2
2
|
class Commit < Status
|
3
3
|
def process(state, indexes, args)
|
4
|
+
handle_m!(args)
|
4
5
|
system "git add #{state.files.list(indexes)} && git commit #{args.join(" ")}"
|
5
6
|
end
|
7
|
+
|
8
|
+
private
|
9
|
+
def handle_m!(args)
|
10
|
+
return unless i = args.index("-m")
|
11
|
+
|
12
|
+
args[i+1] = "\"#{args[i+1]}\""
|
13
|
+
end
|
6
14
|
end
|
7
15
|
end
|
data/lib/nit/lines.rb
CHANGED
data/lib/nit/version.rb
CHANGED
data/nit.gemspec
CHANGED
@@ -18,9 +18,9 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency "thor"
|
21
|
+
spec.add_dependency "thor", "~> 0.18.1"
|
22
22
|
|
23
23
|
spec.add_development_dependency "bundler", "~> 1.3"
|
24
24
|
spec.add_development_dependency "rake"
|
25
|
-
spec.add_development_dependency "minitest", "
|
25
|
+
spec.add_development_dependency "minitest", "5.2.0"
|
26
26
|
end
|
data/test/commands_test.rb
CHANGED
@@ -36,7 +36,9 @@ class CommandsTest < MiniTest::Spec
|
|
36
36
|
cmd.call(["b"], output).must_equal "git add ../lib/new.rb && git commit "
|
37
37
|
end
|
38
38
|
|
39
|
-
|
39
|
+
# FIXME: this test is useless as -m didn't work in earlier versions of nit.
|
40
|
+
# "awesome work" is passed in as 'awesome work', without any additional quotes from thor.
|
41
|
+
it { cmd.call(["-m", "awesome work", "b"], output).must_equal "git add ../lib/new.rb && git commit -m \"awesome work\"" }
|
40
42
|
|
41
43
|
# TODO: test nit commit -a
|
42
44
|
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/test/lines_test.rb
CHANGED
data/test/nit_test.rb
CHANGED
@@ -19,11 +19,22 @@ class NitTest < MiniTest::Spec
|
|
19
19
|
|
20
20
|
def nit(args)
|
21
21
|
output = ""
|
22
|
+
|
23
|
+
Dir.chdir "test/dummies/" do
|
24
|
+
`rm -rf stage`
|
25
|
+
`mkdir stage`
|
26
|
+
`cp -R git stage/.git`
|
27
|
+
`cp files/* stage/`
|
28
|
+
end
|
29
|
+
|
22
30
|
Dir.chdir "test/dummies/stage" do
|
23
|
-
`cp -R git .git`
|
24
31
|
output = `../../../bin/nit #{args}`
|
25
|
-
`rm -rf .git`
|
26
32
|
end
|
33
|
+
|
34
|
+
Dir.chdir "test/dummies/" do
|
35
|
+
`rm -rf stage`
|
36
|
+
end
|
37
|
+
|
27
38
|
output
|
28
39
|
end
|
29
40
|
end
|
@@ -39,6 +50,20 @@ class ArbitraryGitCommandsTest < NitTest
|
|
39
50
|
it { nit(" diff b").must_match "a\/staged.rb" }
|
40
51
|
|
41
52
|
it { nit(" diff --raw b").must_equal ":100644 100644 e69de29... 0000000... M\tstaged.rb\n" }
|
53
|
+
|
54
|
+
# commit:
|
55
|
+
it "allows strings after -m" do # TODO: implement that for all commands?
|
56
|
+
output = nit(' co -m "fixing it" a')
|
57
|
+
output.must_match "] fixing it\n"
|
58
|
+
output.must_match "1 file changed" # TODO: check if correct file was commited.
|
59
|
+
end
|
60
|
+
|
61
|
+
# it "allows -m after file indices" do
|
62
|
+
# output = nit(' co ab -m add something 4 u')
|
63
|
+
# puts output
|
64
|
+
# output.must_match "] add #999\n"
|
65
|
+
# output.must_match "2 files changed" # TODO: check if correct file was commited.
|
66
|
+
# end
|
42
67
|
end
|
43
68
|
|
44
69
|
class NitWithCharIndexerTest < NitTest
|
data/test/status_test.rb
CHANGED
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,71 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Sutterer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 0.18.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 0.18.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.3'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: minitest
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 5.2.0
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 5.2.0
|
69
69
|
description: Improving your Git workflow since 2013.
|
70
70
|
email:
|
71
71
|
- apotonick@gmail.com
|
@@ -74,7 +74,7 @@ executables:
|
|
74
74
|
extensions: []
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
|
-
- .gitignore
|
77
|
+
- ".gitignore"
|
78
78
|
- CHANGES.md
|
79
79
|
- Gemfile
|
80
80
|
- LICENSE.txt
|
@@ -99,34 +99,33 @@ files:
|
|
99
99
|
- nit.gemspec
|
100
100
|
- test/commands_test.rb
|
101
101
|
- test/config_test.rb
|
102
|
-
- test/dummies/
|
103
|
-
- test/dummies/
|
104
|
-
- test/dummies/
|
105
|
-
- test/dummies/
|
106
|
-
- test/dummies/
|
107
|
-
- test/dummies/
|
108
|
-
- test/dummies/
|
109
|
-
- test/dummies/
|
110
|
-
- test/dummies/
|
111
|
-
- test/dummies/
|
112
|
-
- test/dummies/
|
113
|
-
- test/dummies/
|
114
|
-
- test/dummies/
|
115
|
-
- test/dummies/
|
116
|
-
- test/dummies/
|
117
|
-
- test/dummies/
|
118
|
-
- test/dummies/
|
119
|
-
- test/dummies/
|
120
|
-
- test/dummies/
|
121
|
-
- test/dummies/
|
122
|
-
- test/dummies/
|
123
|
-
- test/dummies/
|
124
|
-
- test/dummies/
|
125
|
-
- test/dummies/
|
126
|
-
- test/dummies/
|
127
|
-
- test/dummies/
|
128
|
-
- test/dummies/
|
129
|
-
- test/dummies/stage/staged.rb
|
102
|
+
- test/dummies/files/brandnew.rb
|
103
|
+
- test/dummies/files/new.rb
|
104
|
+
- test/dummies/files/on_stage.rb
|
105
|
+
- test/dummies/files/staged.rb
|
106
|
+
- test/dummies/git/COMMIT_EDITMSG
|
107
|
+
- test/dummies/git/HEAD
|
108
|
+
- test/dummies/git/config
|
109
|
+
- test/dummies/git/description
|
110
|
+
- test/dummies/git/hooks/applypatch-msg.sample
|
111
|
+
- test/dummies/git/hooks/commit-msg.sample
|
112
|
+
- test/dummies/git/hooks/post-update.sample
|
113
|
+
- test/dummies/git/hooks/pre-applypatch.sample
|
114
|
+
- test/dummies/git/hooks/pre-commit.sample
|
115
|
+
- test/dummies/git/hooks/pre-rebase.sample
|
116
|
+
- test/dummies/git/hooks/prepare-commit-msg.sample
|
117
|
+
- test/dummies/git/hooks/update.sample
|
118
|
+
- test/dummies/git/index
|
119
|
+
- test/dummies/git/info/exclude
|
120
|
+
- test/dummies/git/logs/HEAD
|
121
|
+
- test/dummies/git/logs/refs/heads/master
|
122
|
+
- test/dummies/git/objects/0f/e4f83176db6842cd95f439f1edad3cb8483b4e
|
123
|
+
- test/dummies/git/objects/5c/0d92dd14afeb4c2bcd11bc3f072390be598a73
|
124
|
+
- test/dummies/git/objects/60/bd895ee4a908b754f1980491c0e0852c29a8cd
|
125
|
+
- test/dummies/git/objects/b7/5ac79d08245a3a8a662520dd90f80be097cc44
|
126
|
+
- test/dummies/git/objects/c1/172bf75d73a630c467f1e1448c44d9188fe23e
|
127
|
+
- test/dummies/git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391
|
128
|
+
- test/dummies/git/refs/heads/master
|
130
129
|
- test/files_test.rb
|
131
130
|
- test/ignore_test.rb
|
132
131
|
- test/lines_test.rb
|
@@ -143,51 +142,50 @@ require_paths:
|
|
143
142
|
- lib
|
144
143
|
required_ruby_version: !ruby/object:Gem::Requirement
|
145
144
|
requirements:
|
146
|
-
- -
|
145
|
+
- - ">="
|
147
146
|
- !ruby/object:Gem::Version
|
148
147
|
version: '0'
|
149
148
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
149
|
requirements:
|
151
|
-
- -
|
150
|
+
- - ">="
|
152
151
|
- !ruby/object:Gem::Version
|
153
152
|
version: '0'
|
154
153
|
requirements: []
|
155
154
|
rubyforge_project:
|
156
|
-
rubygems_version: 2.
|
155
|
+
rubygems_version: 2.2.1
|
157
156
|
signing_key:
|
158
157
|
specification_version: 4
|
159
158
|
summary: Nit improves your git workflows.
|
160
159
|
test_files:
|
161
160
|
- test/commands_test.rb
|
162
161
|
- test/config_test.rb
|
163
|
-
- test/dummies/
|
164
|
-
- test/dummies/
|
165
|
-
- test/dummies/
|
166
|
-
- test/dummies/
|
167
|
-
- test/dummies/
|
168
|
-
- test/dummies/
|
169
|
-
- test/dummies/
|
170
|
-
- test/dummies/
|
171
|
-
- test/dummies/
|
172
|
-
- test/dummies/
|
173
|
-
- test/dummies/
|
174
|
-
- test/dummies/
|
175
|
-
- test/dummies/
|
176
|
-
- test/dummies/
|
177
|
-
- test/dummies/
|
178
|
-
- test/dummies/
|
179
|
-
- test/dummies/
|
180
|
-
- test/dummies/
|
181
|
-
- test/dummies/
|
182
|
-
- test/dummies/
|
183
|
-
- test/dummies/
|
184
|
-
- test/dummies/
|
185
|
-
- test/dummies/
|
186
|
-
- test/dummies/
|
187
|
-
- test/dummies/
|
188
|
-
- test/dummies/
|
189
|
-
- test/dummies/
|
190
|
-
- test/dummies/stage/staged.rb
|
162
|
+
- test/dummies/files/brandnew.rb
|
163
|
+
- test/dummies/files/new.rb
|
164
|
+
- test/dummies/files/on_stage.rb
|
165
|
+
- test/dummies/files/staged.rb
|
166
|
+
- test/dummies/git/COMMIT_EDITMSG
|
167
|
+
- test/dummies/git/HEAD
|
168
|
+
- test/dummies/git/config
|
169
|
+
- test/dummies/git/description
|
170
|
+
- test/dummies/git/hooks/applypatch-msg.sample
|
171
|
+
- test/dummies/git/hooks/commit-msg.sample
|
172
|
+
- test/dummies/git/hooks/post-update.sample
|
173
|
+
- test/dummies/git/hooks/pre-applypatch.sample
|
174
|
+
- test/dummies/git/hooks/pre-commit.sample
|
175
|
+
- test/dummies/git/hooks/pre-rebase.sample
|
176
|
+
- test/dummies/git/hooks/prepare-commit-msg.sample
|
177
|
+
- test/dummies/git/hooks/update.sample
|
178
|
+
- test/dummies/git/index
|
179
|
+
- test/dummies/git/info/exclude
|
180
|
+
- test/dummies/git/logs/HEAD
|
181
|
+
- test/dummies/git/logs/refs/heads/master
|
182
|
+
- test/dummies/git/objects/0f/e4f83176db6842cd95f439f1edad3cb8483b4e
|
183
|
+
- test/dummies/git/objects/5c/0d92dd14afeb4c2bcd11bc3f072390be598a73
|
184
|
+
- test/dummies/git/objects/60/bd895ee4a908b754f1980491c0e0852c29a8cd
|
185
|
+
- test/dummies/git/objects/b7/5ac79d08245a3a8a662520dd90f80be097cc44
|
186
|
+
- test/dummies/git/objects/c1/172bf75d73a630c467f1e1448c44d9188fe23e
|
187
|
+
- test/dummies/git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391
|
188
|
+
- test/dummies/git/refs/heads/master
|
191
189
|
- test/files_test.rb
|
192
190
|
- test/ignore_test.rb
|
193
191
|
- test/lines_test.rb
|
@@ -1 +0,0 @@
|
|
1
|
-
.nit
|