donald 0.1.6 → 0.1.7

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.
data/lib/donald/git.rb CHANGED
@@ -1,32 +1,13 @@
1
1
  module Donald
2
2
  class Git
3
- CONFLICTED_TYPES = ['unmerged', 'both modified', 'both added']
4
-
5
- def conflicted_files
6
- files = []
7
-
8
- status.each_line do |line|
9
- file = conflicted_file(line)
10
- files << file unless file.nil?
11
- end
12
-
13
- files
3
+ def unmerged_files
4
+ ls_files.split("\n")
14
5
  end
15
6
 
16
7
  private
17
8
 
18
- def status
19
- `git status`
20
- end
21
-
22
- def conflicted_file(line)
23
- CONFLICTED_TYPES.each do |conflicted_type|
24
- if line.match /#{conflicted_type}: (.*)/
25
- return $1.strip
26
- end
27
- end
28
-
29
- nil
9
+ def ls_files
10
+ `git ls-files --unmerged | cut -f2 | sort -u`
30
11
  end
31
12
  end
32
13
  end
@@ -6,7 +6,7 @@ module Donald
6
6
  end
7
7
 
8
8
  def start
9
- files = Donald::Git.new.conflicted_files
9
+ files = Donald::Git.new.unmerged_files
10
10
 
11
11
  if files.any?
12
12
  print_files files
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: donald
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 6
10
- version: 0.1.6
9
+ - 7
10
+ version: 0.1.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bruno Grasselli
@@ -29,7 +29,6 @@ extra_rdoc_files: []
29
29
 
30
30
  files:
31
31
  - README.textile
32
- - LICENSE
33
32
  - bin/donald
34
33
  - lib/donald.rb
35
34
  - lib/donald/git.rb
data/LICENSE DELETED
@@ -1,23 +0,0 @@
1
- (The MIT License)
2
-
3
- Copyright © 2010
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- ‘Software’), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
-