ignoring 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ignoring/helpers.rb +13 -16
- data/lib/ignoring/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f9939a215ac11d46bb22f3476f62bd78fabc09c
|
4
|
+
data.tar.gz: 06f0c3edf4b06243707dbe6e12d872be17de4a41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9225550cb1a7fedcb8b793d48bb85d42c8c4fc17eab02649cbf3a094839bbf30b0634b1212661eca7ec91a50ebc1521e902aeac6db363c40a215ab71c3247f6a
|
7
|
+
data.tar.gz: b165a12c96feefb25804da52ee6bcaa490f4d76dd989c34bfff40426555a839ffcda575b3a009a28fc1ca3a255b4bb961d4264d256d1574b8b5ca5e06bbb1a0d
|
data/lib/ignoring/helpers.rb
CHANGED
@@ -29,27 +29,24 @@ module Ignoring
|
|
29
29
|
# @param options the options hash
|
30
30
|
# @param items the items/languages to add
|
31
31
|
def add(options, items)
|
32
|
+
create(options)
|
32
33
|
if options[:global]
|
33
34
|
file = Git.global_config("core.excludesfile")
|
34
35
|
else
|
35
|
-
file = ".gitignore"
|
36
|
+
file = ".gitignore"
|
36
37
|
end
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
items = []
|
44
|
-
languages.each do |lang|
|
45
|
-
items += language_array(lang) || []
|
46
|
-
end
|
38
|
+
combined = File.open(file).read.split("\n")
|
39
|
+
if options[:languages]
|
40
|
+
languages = items
|
41
|
+
items = []
|
42
|
+
languages.each do |lang|
|
43
|
+
items += language_array(lang) || []
|
47
44
|
end
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
45
|
+
end
|
46
|
+
items.each { |item| combined << item if !combined.include? item or item.start_with? "#" or item.empty? }
|
47
|
+
File.open(file, "w") do |file|
|
48
|
+
combined.each do |item|
|
49
|
+
file.puts item
|
53
50
|
end
|
54
51
|
end
|
55
52
|
end
|
data/lib/ignoring/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ignoring
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kristen Mills
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|