nit 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f516d5091e63c8591e12facb8e6971d19116c8bc
4
- data.tar.gz: c76c5d753527a5568bce39965197aa5c1ddf34cc
3
+ metadata.gz: 8ce40cb00fbd0507889d52bf61b057450c613caa
4
+ data.tar.gz: 560e59c303756db72f2ceab112c9b59c35dd608e
5
5
  SHA512:
6
- metadata.gz: 1f3392cec82272850b8dd83bf405deb84c85e3c00746fc744e4d2b371675f91f782a32f7f75c094d1ceb51e918f5b132f45fdafff002768047de43a3e9e65c5a
7
- data.tar.gz: afd638bc8f316a9982ae688137edaec506807d7a42935e69689eed73e0e0a58a272333ce054aa191a2b1b5014976b8f6d92a2480d60ef969a448317fd66bf994
6
+ metadata.gz: 7b9f0619293a6c4ae41ac59b8448a17000dab8aff956ed69e424831a234b79d124a463946e9b0531046860cf74f113514ab93ad02a2727067d781854046df6db
7
+ data.tar.gz: 5875f64c730b320ae5b3bb6c716c80f479cd899a034b72ef6ab41410310a19acb506b89b758ecba685a39acda2066f3711c31234f954a7446fc113058d27062c
data/CHANGES.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ## 0.0.5
2
2
 
3
-
3
+ * Make nit compatible with a git upgrade where the status command doesn't prepend lines with a hash (#) anymore (as seen in git 1.8.5.2).
4
4
 
5
5
  ## 0.0.4
6
6
 
@@ -31,8 +31,8 @@ module Nit
31
31
  #private
32
32
  def file_patterns
33
33
  {
34
- modified: /#\tmodified:(.+)/,
35
- new: /#\t((?!modified:).+)/
34
+ modified: /#?\tmodified:(.+)/,
35
+ new: /#?\t((?!modified:).+)/
36
36
  }
37
37
  end
38
38
  end
@@ -1,3 +1,3 @@
1
1
  module Nit
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -18,7 +18,7 @@ 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", "~> 0.18.1"
21
+ spec.add_dependency "thor", '~> 0.18', '>= 0.18.1'
22
22
 
23
23
  spec.add_development_dependency "bundler", "~> 1.3"
24
24
  spec.add_development_dependency "rake"
@@ -25,6 +25,8 @@ class NitTest < MiniTest::Spec
25
25
  `mkdir stage`
26
26
  `cp -R git stage/.git`
27
27
  `cp files/* stage/`
28
+
29
+ yield if block_given?
28
30
  end
29
31
 
30
32
  Dir.chdir "test/dummies/stage" do
@@ -58,6 +60,19 @@ class ArbitraryGitCommandsTest < NitTest
58
60
  output.must_match "1 file changed" # TODO: check if correct file was commited.
59
61
  end
60
62
 
63
+ # FIXME: with one changed, one new file!!!
64
+ it "what" do
65
+ output = nit(' ') do
66
+ `touch stage/new_file`
67
+ `cd stage && git add stage/new_file`
68
+ end
69
+ puts output
70
+ output.must_match "] fixing it\n"
71
+ end
72
+
73
+
74
+
75
+
61
76
  # it "allows -m after file indices" do
62
77
  # output = nit(' co ab -m add something 4 u')
63
78
  # puts output
@@ -20,6 +20,15 @@ class StatusTest < MiniTest::Spec
20
20
  console.must_match "[3] new.rb"
21
21
  console.must_match "[5] db/migrate/"
22
22
  end
23
+
24
+ it "processes `git status` without #" do
25
+ console = subject.call([], output)
26
+ console.must_match "modified: [0] on_stage.rb"
27
+ console.must_match "modified: [1] staged.rb"
28
+ console.must_match "[2] brandnew.rb"
29
+ console.must_match "[3] new.rb"
30
+ console.must_match "[5] db/migrate/"
31
+ end
23
32
  end
24
33
 
25
34
  describe "char indexing" do
@@ -21,4 +21,24 @@ MiniTest::Spec.class_eval do
21
21
  no changes added to commit (use "git add" and/or "git commit -a")
22
22
  EOF
23
23
  end
24
+
25
+ let (:hashless_output) do <<-EOF
26
+ On branch master
27
+ Changes not staged for commit:
28
+ (use "git add <file>..." to update what will be committed)
29
+ (use "git checkout -- <file>..." to discard changes in working directory)
30
+
31
+ \tmodified: on_stage.rb
32
+ \tmodified: staged.rb
33
+
34
+ Untracked files:
35
+ (use "git add <file>..." to include in what will be committed)
36
+
37
+ \tbrandnew.rb
38
+ \tnew.rb
39
+ \t../lib/new.rb
40
+ \tdb/migrate/
41
+ no changes added to commit (use "git add" and/or "git commit -a")
42
+ EOF
43
+ end
24
44
  end
metadata CHANGED
@@ -1,20 +1,23 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sutterer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-21 00:00:00.000000000 Z
11
+ date: 2014-03-13 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
+ - !ruby/object:Gem::Version
19
+ version: '0.18'
20
+ - - ">="
18
21
  - !ruby/object:Gem::Version
19
22
  version: 0.18.1
20
23
  type: :runtime
@@ -22,6 +25,9 @@ dependencies:
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
27
  - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '0.18'
30
+ - - ">="
25
31
  - !ruby/object:Gem::Version
26
32
  version: 0.18.1
27
33
  - !ruby/object:Gem::Dependency