fast_ignore 0.10.1 → 0.13.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.
@@ -1,3 +0,0 @@
1
- env
2
- euo
3
- usr
@@ -1,9 +0,0 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- cache: bundler
5
- rvm:
6
- - 2.4
7
- - 2.5
8
- - 2.6
9
- - 2.7
data/Gemfile DELETED
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
-
7
- # Specify your gem's dependencies in fast_ignore.gemspec
8
-
9
- gemspec
data/Rakefile DELETED
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler/gem_tasks'
4
- require 'rspec/core/rake_task'
5
- require 'rubocop/rake_task'
6
- require 'spellr/rake_task'
7
- require 'leftovers/rake_task'
8
-
9
- RuboCop::RakeTask.new
10
- RSpec::Core::RakeTask.new(:spec)
11
- Spellr::RakeTask.generate_task
12
- Leftovers::RakeTask.generate_task
13
-
14
- task default: [:spec, :rubocop, :spellr, :leftovers]
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'bundler/setup'
5
- require 'fast_ignore'
6
-
7
- require 'pry'
8
- Pry.start
data/bin/ls DELETED
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env ruby --disable-all
2
- # frozen_string_literal: true
3
-
4
- require_relative '../lib/fast_ignore'
5
-
6
- puts FastIgnore.new(relative: true, argv_rules: ARGV).to_a
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
data/bin/time DELETED
@@ -1,18 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'open3'
5
- RUNS = 30
6
- SCRIPT = "time #{__dir__}/ls"
7
- Dir.chdir ARGV[0] do
8
- times = Array.new(RUNS).map do
9
- run_times = Open3.capture3(SCRIPT)[1]
10
- puts run_times.lstrip
11
- run_times.scan(/(?:\d+(?:.\d+)?)/)
12
- end
13
-
14
- puts format(
15
- "\e[1mAverage:\n\e[32m%0.2f real %0.2f user %0.2f sys\e[0m", # rubocop:disable Style/FormatStringToken
16
- *times.transpose.map { |n| (n.map(&:to_f).sum / RUNS) }
17
- )
18
- end
@@ -1,41 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- lib = File.expand_path('lib', __dir__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'fast_ignore/version'
6
-
7
- Gem::Specification.new do |spec|
8
- spec.name = 'fast_ignore'
9
- spec.version = FastIgnore::VERSION
10
- spec.authors = ['Dana Sherson']
11
- spec.email = ['robot@dana.sh']
12
-
13
- spec.summary = 'Parse gitignore files, quickly'
14
- spec.homepage = 'https://github.com/robotdana/fast_ignore'
15
- spec.license = 'MIT'
16
-
17
- spec.required_ruby_version = '~> 2.4'
18
-
19
- if spec.respond_to?(:metadata)
20
- spec.metadata['homepage_uri'] = spec.homepage
21
- spec.metadata['source_code_uri'] = 'https://github.com/robotdana/fast_ignore'
22
- spec.metadata['changelog_uri'] = 'https://github.com/robotdana/fast_ignore/blob/master/CHANGELOG.md'
23
- end
24
-
25
- # Specify which files should be added to the gem when it is released.
26
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
27
- spec.files = Dir.chdir(File.expand_path(__dir__)) do
28
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
29
- end
30
- spec.require_paths = ['lib']
31
-
32
- spec.add_development_dependency 'bundler', '>= 1.17'
33
- spec.add_development_dependency 'leftovers', '>= 0.2.2'
34
- spec.add_development_dependency 'pry', '> 0'
35
- spec.add_development_dependency 'rake', '>= 12.3.3'
36
- spec.add_development_dependency 'rspec', '~> 3.0'
37
- spec.add_development_dependency 'rubocop', '>= 0.74.0'
38
- spec.add_development_dependency 'rubocop-rspec', '~> 1'
39
- spec.add_development_dependency 'simplecov', '~> 0.18.5'
40
- spec.add_development_dependency 'spellr', '>= 0.8.1'
41
- end
@@ -1,56 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # This is a backport of ruby 2.5's delete_prefix/delete_suffix methods
4
- class FastIgnore
5
- module Backports
6
- module DeletePrefixSuffix
7
- refine ::String do
8
- # delete_prefix!(prefix) -> self or nil
9
- # Deletes leading prefix from str, returning nil if no change was made.
10
- #
11
- # "hello".delete_prefix!("hel") #=> "lo"
12
- # "hello".delete_prefix!("llo") #=> nil
13
- def delete_prefix!(str)
14
- return unless start_with?(str)
15
-
16
- slice!(0..(str.length - 1))
17
- self
18
- end
19
-
20
- # delete_suffix!(suffix) -> self or nil
21
- # Deletes trailing suffix from str, returning nil if no change was made.
22
- #
23
- # "hello".delete_suffix!("llo") #=> "he"
24
- # "hello".delete_suffix!("hel") #=> nil
25
- def delete_suffix!(str)
26
- return unless end_with?(str)
27
-
28
- slice!(-str.length..-1)
29
- self
30
- end
31
-
32
- # delete_prefix(prefix) -> new_str click to toggle source
33
- # Returns a copy of str with leading prefix deleted.
34
- #
35
- # "hello".delete_prefix("hel") #=> "lo"
36
- # "hello".delete_prefix("llo") #=> "hello"
37
- def delete_prefix(str)
38
- s = dup
39
- s.delete_prefix!(str)
40
- s
41
- end
42
-
43
- # delete_suffix(suffix) -> new_str
44
- # Returns a copy of str with trailing suffix deleted.
45
- #
46
- # "hello".delete_suffix("llo") #=> "he"
47
- # "hello".delete_suffix("hel") #=> "hello"
48
- def delete_suffix(str) # leftovers:allowed
49
- s = dup
50
- s.delete_suffix!(str)
51
- s
52
- end
53
- end
54
- end
55
- end
56
- end
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # This is a backport of ruby 2.5's each_child method
4
- class FastIgnore
5
- module Backports
6
- module DirEachChild
7
- refine ::Dir.singleton_class do
8
- def each_child(path, &block)
9
- Dir.entries(path).each do |entry|
10
- next if entry == '.' || entry == '..'
11
-
12
- block.call entry
13
- end
14
- end
15
- end
16
- end
17
- end
18
- end