aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-08-15 16:59:08 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-08-17 17:08:50 +0900
commit6a299906b4bebe1c86bc50a565f47348e735cb8e (patch)
treeb1781ecdf119fd8ba2c5c8d1f8c8314aed26dea1
parent19dabfbe574f9a8298054eb417d299ec5fc18412 (diff)
downloadruby-6a299906b4bebe1c86bc50a565f47348e735cb8e.tar.gz
[bundler/bundler] Extract a `lib_tracked_files` path helper
https://github.com/bundler/bundler/commit/028dc46f5a
-rw-r--r--spec/bundler/quality_spec.rb4
-rw-r--r--spec/bundler/support/path.rb4
2 files changed, 4 insertions, 4 deletions
diff --git a/spec/bundler/quality_spec.rb b/spec/bundler/quality_spec.rb
index 922a99480c..85d0084e9a 100644
--- a/spec/bundler/quality_spec.rb
+++ b/spec/bundler/quality_spec.rb
@@ -170,7 +170,6 @@ RSpec.describe "The library itself" do
error_messages = []
exempt = /vendor|vcr_cassettes/
Dir.chdir(root) do
- lib_tracked_files = ruby_core? ? `git ls-files -z -- lib/bundler lib/bundler.rb` : `git ls-files -z -- lib`
lib_tracked_files.split("\x0").each do |filename|
next if filename =~ exempt
error_messages << check_for_expendable_words(filename)
@@ -200,7 +199,6 @@ RSpec.describe "The library itself" do
Dir.chdir(root) do
key_pattern = /([a-z\._-]+)/i
- lib_tracked_files = ruby_core? ? `git ls-files -z -- lib/bundler lib/bundler.rb` : `git ls-files -z -- lib`
lib_tracked_files.split("\x0").each do |filename|
each_line(filename) do |line, number|
line.scan(/Bundler\.settings\[:#{key_pattern}\]/).flatten.each {|s| all_settings[s] << "referenced at `#{filename}:#{number.succ}`" }
@@ -267,7 +265,6 @@ RSpec.describe "The library itself" do
lib/bundler/vlad.rb
lib/bundler/templates/gems.rb
]
- lib_tracked_files = ruby_core? ? `git ls-files -z -- lib/bundler lib/bundler.rb` : `git ls-files -z -- lib`
files_to_require = lib_tracked_files.split("\x0").grep(/\.rb$/) - exclusions
files_to_require.reject! {|f| f.start_with?("lib/bundler/vendor") }
files_to_require.map! {|f| f.chomp(".rb") }
@@ -289,7 +286,6 @@ RSpec.describe "The library itself" do
Dir.chdir(root) do
exempt = %r{templates/|vendor/}
all_bad_requires = []
- lib_tracked_files = ruby_core? ? `git ls-files -z -- lib/bundler lib/bundler.rb` : `git ls-files -z -- lib`
lib_tracked_files.split("\x0").each do |filename|
next if filename =~ exempt
each_line(filename) do |line, number|
diff --git a/spec/bundler/support/path.rb b/spec/bundler/support/path.rb
index 70ce645c0a..3b18cd2da8 100644
--- a/spec/bundler/support/path.rb
+++ b/spec/bundler/support/path.rb
@@ -29,6 +29,10 @@ module Spec
@tracked_files ||= ruby_core? ? `git ls-files -z -- lib/bundler lib/bundler.rb spec/bundler` : `git ls-files -z`
end
+ def lib_tracked_files
+ @lib_tracked_files ||= ruby_core? ? `git ls-files -z -- lib/bundler lib/bundler.rb` : `git ls-files -z -- lib`
+ end
+
def tmp(*path)
root.join("tmp", *path)
end