buff-ignore 1.1.1 → 1.2.0
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 +4 -4
- data/.travis.yml +7 -3
- data/CHANGELOG.md +20 -17
- data/README.md +16 -18
- data/buff-ignore.gemspec +1 -0
- data/lib/buff/ignore/ignore_file.rb +3 -0
- data/lib/buff/ignore/version.rb +1 -1
- data/spec/lib/ignore_file_spec.rb +4 -3
- metadata +18 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d955f99f6903c4ee0548c320e655b0ee682b596
|
4
|
+
data.tar.gz: 786a396211ea49e55ddded7a87111a60058cb846
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33217507185b508e26cc22f5b95be2680b086a5098aad0d4967f48129de0906f585c856fb487aa3921d6419581fd08024315501eee5372136dddb4249b941047
|
7
|
+
data.tar.gz: 0129f8eca8407ca62b915661c3541420ee2a2ce867976facec74dca80686f575ab2ef5427ad4bb6f0be173be0a7fcad0e925f7e280118c6174336249a963c2a6
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,33 +1,36 @@
|
|
1
|
-
CHANGELOG
|
2
|
-
=========
|
1
|
+
# CHANGELOG
|
3
2
|
|
3
|
+
## v1.2.0
|
4
|
+
|
5
|
+
- Require Ruby 2.1
|
6
|
+
- Fix the ignore file not being properly loaded
|
7
|
+
|
8
|
+
## v1.1.1
|
4
9
|
|
5
|
-
v1.1.1
|
6
|
-
------
|
7
10
|
- Handle nil file paths
|
8
11
|
|
9
|
-
v1.1.0
|
10
|
-
|
12
|
+
## v1.1.0
|
13
|
+
|
11
14
|
- Make `ignored?` a public function
|
12
15
|
|
13
|
-
v1.0.4
|
14
|
-
|
16
|
+
## v1.0.4
|
17
|
+
|
15
18
|
- **Critical Fix** - strip all values before fnmatching
|
16
19
|
- Accept a `:base` argument and only parse relative to the base
|
17
20
|
|
18
|
-
v1.0.3
|
19
|
-
|
21
|
+
## v1.0.3
|
22
|
+
|
20
23
|
- Use `#to_s` instead of message for a nicer output to the end-user when an ignore file is not found
|
21
24
|
|
22
|
-
v1.0.2
|
23
|
-
|
25
|
+
## v1.0.2
|
26
|
+
|
24
27
|
- Only accept a Pathname or String as the primary argument
|
25
28
|
|
26
|
-
v1.0.1
|
27
|
-
|
29
|
+
## v1.0.1
|
30
|
+
|
28
31
|
- Use `VERSION` constant
|
29
32
|
- Add CHANGELOG
|
30
33
|
|
31
|
-
v1.0.0
|
32
|
-
|
33
|
-
-
|
34
|
+
## v1.0.0
|
35
|
+
|
36
|
+
- _(initial release)_
|
data/README.md
CHANGED
@@ -1,32 +1,31 @@
|
|
1
|
-
Buff Ignore
|
2
|
-
|
3
|
-
[](https://travis-ci.org/sethvargo/buff-ignore)
|
5
|
-
[](https://gemnasium.com/sethvargo/buff-ignore)
|
6
|
-
[](https://codeclimate.com/github/sethvargo/buff-ignore)
|
1
|
+
# Buff Ignore
|
2
|
+
|
3
|
+
[](http://badge.fury.io/rb/buff-ignore) [](https://travis-ci.org/sethvargo/buff-ignore) [](https://gemnasium.com/sethvargo/buff-ignore) [](https://codeclimate.com/github/sethvargo/buff-ignore)
|
7
4
|
|
8
5
|
Buff::Ignore is a Ruby helper library for parsing and managing an ignore file (such as a `.gitignore` or `chefignore`). It uses [`File#fnmatch`](http://www.ruby-doc.org/core-2.0/File.html#method-c-fnmatch). It includes helpful methods for apply ignores to a file list.
|
9
6
|
|
7
|
+
## Installation
|
10
8
|
|
11
|
-
Installation
|
12
|
-
------------
|
13
9
|
Add buff-ignore to your `Gemfile`:
|
14
10
|
|
15
|
-
```
|
11
|
+
```gemfile
|
16
12
|
gem 'buff-ignore'
|
17
13
|
```
|
18
14
|
|
19
15
|
And then execute the `bundle` command to install:
|
20
16
|
|
21
|
-
|
17
|
+
```
|
18
|
+
$ bundle
|
19
|
+
```
|
22
20
|
|
23
21
|
Or install buff-ignore directly:
|
24
22
|
|
25
|
-
|
23
|
+
```
|
24
|
+
$ gem install buff-ignore
|
25
|
+
```
|
26
26
|
|
27
|
+
## Usage
|
27
28
|
|
28
|
-
Usage
|
29
|
-
-----
|
30
29
|
Buff::Ignore is designed to be used as a library. First, you must require it:
|
31
30
|
|
32
31
|
```ruby
|
@@ -39,7 +38,7 @@ Next, create an instance of an ignore file:
|
|
39
38
|
ignore = Buff::Ignore::IgnoreFile.new('/path/to/ignore/file')
|
40
39
|
```
|
41
40
|
|
42
|
-
|
41
|
+
_(If the file does not exist, an exception will be raised)_
|
43
42
|
|
44
43
|
Finally, apply the `ignore` to a list of files:
|
45
44
|
|
@@ -54,17 +53,16 @@ You can also destructively apply changes. This will modify the receiving argumen
|
|
54
53
|
ignore.apply!(list)
|
55
54
|
```
|
56
55
|
|
57
|
-
Contributing
|
58
|
-
|
56
|
+
## Contributing
|
57
|
+
|
59
58
|
1. Fork it
|
60
59
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
61
60
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
62
61
|
4. Push to the branch (`git push origin my-new-feature`)
|
63
62
|
5. Create new Pull Request
|
64
63
|
|
64
|
+
## License & Authors
|
65
65
|
|
66
|
-
License & Authors
|
67
|
-
-----------------
|
68
66
|
- Author: Seth Vargo (sethvargo@gmail.com)
|
69
67
|
|
70
68
|
```text
|
data/buff-ignore.gemspec
CHANGED
@@ -17,6 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ['lib']
|
20
|
+
spec.required_ruby_version = '>= 2.1'
|
20
21
|
|
21
22
|
spec.add_development_dependency 'bundler', '~> 1.3'
|
22
23
|
spec.add_development_dependency 'cane', '~> 2.6'
|
@@ -29,6 +29,9 @@ module Buff
|
|
29
29
|
|
30
30
|
@filepath = File.expand_path(filepath)
|
31
31
|
@options = options
|
32
|
+
if @options[:base].nil?
|
33
|
+
@options[:base] = File.directory?(filepath) ? filepath : File.dirname(filepath)
|
34
|
+
end
|
32
35
|
end
|
33
36
|
|
34
37
|
# Apply the ignore to the list, returning a new list of filtered files
|
data/lib/buff/ignore/version.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Buff::Ignore::IgnoreFile do
|
4
|
-
let(:ignores) { %w(Gemfile *.lock bacon) }
|
5
|
-
let(:path) { '~/fakepath' }
|
4
|
+
let(:ignores) { %w(Gemfile *.lock bacon README.*) }
|
5
|
+
let(:path) { '~/fakepath/fakefile' }
|
6
6
|
|
7
7
|
before do
|
8
8
|
File.stub(:exists?).with(path).and_return(true)
|
@@ -56,7 +56,7 @@ describe Buff::Ignore::IgnoreFile do
|
|
56
56
|
end
|
57
57
|
|
58
58
|
describe '#apply!' do
|
59
|
-
let(:list) { ['Gemfile', 'Gemfile.lock', 'bacon', 'eggs'] }
|
59
|
+
let(:list) { ['Gemfile', 'Gemfile.lock', 'bacon', 'eggs', File.expand_path('~') + '/fakepath/README.md'] }
|
60
60
|
|
61
61
|
it 'removes standard files' do
|
62
62
|
subject.apply!(list)
|
@@ -67,6 +67,7 @@ describe Buff::Ignore::IgnoreFile do
|
|
67
67
|
it 'removes the globs' do
|
68
68
|
subject.apply!(list)
|
69
69
|
expect(list).to_not include('Gemfile.lock')
|
70
|
+
expect(list).to_not include(File.expand_path('~') + '/fakepath/README.md')
|
70
71
|
end
|
71
72
|
|
72
73
|
it 'does not remove a non-matching pattern' do
|
metadata
CHANGED
@@ -1,83 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: buff-ignore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seth Vargo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.3'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: cane
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '2.6'
|
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: '2.6'
|
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: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '2.13'
|
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
68
|
version: '2.13'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: spork
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - ~>
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0.9'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - ~>
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0.9'
|
83
83
|
description: Parse ignore files with Ruby
|
@@ -87,8 +87,8 @@ executables: []
|
|
87
87
|
extensions: []
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
|
-
- .gitignore
|
91
|
-
- .travis.yml
|
90
|
+
- ".gitignore"
|
91
|
+
- ".travis.yml"
|
92
92
|
- CHANGELOG.md
|
93
93
|
- Gemfile
|
94
94
|
- LICENSE
|
@@ -113,17 +113,17 @@ require_paths:
|
|
113
113
|
- lib
|
114
114
|
required_ruby_version: !ruby/object:Gem::Requirement
|
115
115
|
requirements:
|
116
|
-
- -
|
116
|
+
- - ">="
|
117
117
|
- !ruby/object:Gem::Version
|
118
|
-
version: '
|
118
|
+
version: '2.1'
|
119
119
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
120
|
requirements:
|
121
|
-
- -
|
121
|
+
- - ">="
|
122
122
|
- !ruby/object:Gem::Version
|
123
123
|
version: '0'
|
124
124
|
requirements: []
|
125
125
|
rubyforge_project:
|
126
|
-
rubygems_version: 2.
|
126
|
+
rubygems_version: 2.6.6
|
127
127
|
signing_key:
|
128
128
|
specification_version: 4
|
129
129
|
summary: A Ruby library for parsing lists of files and applying pattern matching exclusion
|
@@ -133,4 +133,3 @@ test_files:
|
|
133
133
|
- spec/lib/ignore_file_spec.rb
|
134
134
|
- spec/spec_helper.rb
|
135
135
|
- spec/support/path_helpers.rb
|
136
|
-
has_rdoc:
|