Skip to content

Commit 1a7adfd

Browse files
authored
Merge pull request #595 from Shopify/dv-exec-pr
Replace file operations with Ruby methods.
2 parents 66472d2 + bf29a59 commit 1a7adfd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

job-iteration.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ Gem::Specification.new do |spec|
1616
spec.homepage = "https://github.com/shopify/job-iteration"
1717
spec.license = "MIT"
1818

19-
spec.files = %x(git ls-files -z).split("\x0").reject do |f|
20-
f.match(%r{^(test|spec|features)/})
19+
spec.files = ["CHANGELOG.md", "LICENSE.txt", "README.md", "job-iteration.gemspec"] + Dir.glob("{lib,exe}/**/*", File::FNM_DOTMATCH).reject do |f|
20+
File.directory?(f) || f.match(%r{^(test|spec|features)/})
2121
end
2222
spec.bindir = "exe"
2323
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }

lib/job-iteration/csv_enumerator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def count_of_rows_in_file
5959
# Behaviour of CSV#path changed in Ruby 2.6.3 (returns nil instead of raising NoMethodError)
6060
return unless filepath
6161

62-
count = %x(wc -l < #{filepath}).strip.to_i
62+
count = File.foreach(filepath).count
6363
count -= 1 if @csv.headers
6464
count
6565
end

0 commit comments

Comments
 (0)