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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bdb459e554cc1b86198b4ef682c01a61f36b1fae
4
- data.tar.gz: e9bebbe76d6193af39d6132f8085c0be7a72bdd9
3
+ metadata.gz: 8f9939a215ac11d46bb22f3476f62bd78fabc09c
4
+ data.tar.gz: 06f0c3edf4b06243707dbe6e12d872be17de4a41
5
5
  SHA512:
6
- metadata.gz: 965fac07386308714173f98972bdbe67e9e893591bbdce8f10f6ab0995ff0eadfdf8be33551c641340c2340ad02afdbc23354ca1b07b11f051eb7e16e39653b9
7
- data.tar.gz: 8fb9db967c5bb7f3e41118be782ebafb56d1908dd49bc47f7107331384b9ae1a51dc1788da2a328cae0150c3235beb3f92962a83c7da43bc26ebed25c3c0886e
6
+ metadata.gz: 9225550cb1a7fedcb8b793d48bb85d42c8c4fc17eab02649cbf3a094839bbf30b0634b1212661eca7ec91a50ebc1521e902aeac6db363c40a215ab71c3247f6a
7
+ data.tar.gz: b165a12c96feefb25804da52ee6bcaa490f4d76dd989c34bfff40426555a839ffcda575b3a009a28fc1ca3a255b4bb961d4264d256d1574b8b5ca5e06bbb1a0d
@@ -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" if File.exist?(".gitignore")
36
+ file = ".gitignore"
36
37
  end
37
- if file.empty? or file.nil?
38
- puts "No gitignore. run create first." if file.empty?
39
- else
40
- combined = File.open(file).read.split("\n")
41
- if options[:languages]
42
- languages = items
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
- items.each { |item| combined << item if !combined.include? item or item.start_with? "#" or item.empty? }
49
- File.open(file, "w") do |file|
50
- combined.each do |item|
51
- file.puts item
52
- end
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
@@ -1,3 +1,3 @@
1
1
  module Ignoring
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
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.1
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-21 00:00:00.000000000 Z
11
+ date: 2014-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler