diff --git a/bundler/lib/dependabot/bundler/file_fetcher.rb b/bundler/lib/dependabot/bundler/file_fetcher.rb index b1ba09cf3e6..bcbd18add95 100644 --- a/bundler/lib/dependabot/bundler/file_fetcher.rb +++ b/bundler/lib/dependabot/bundler/file_fetcher.rb @@ -45,6 +45,7 @@ def fetch_files fetched_files += child_gemfiles fetched_files += gemspecs fetched_files << ruby_version_file if ruby_version_file + fetched_files << tool_versions_file if tool_versions_file fetched_files += path_gemspecs fetched_files += require_relative_files(fetched_files) @@ -100,9 +101,13 @@ def gemspec_directories def ruby_version_file return unless gemfile - @ruby_version_file ||= - fetch_file_if_present(".ruby-version") - &.tap { |f| f.support_file = true } + @ruby_version_file ||= fetch_support_file(".ruby-version") + end + + def tool_versions_file + return unless gemfile + + @tool_versions_file ||= fetch_support_file(".tool-versions") end def path_gemspecs diff --git a/bundler/lib/dependabot/bundler/file_parser.rb b/bundler/lib/dependabot/bundler/file_parser.rb index bc1b5333a25..e71df450bf6 100644 --- a/bundler/lib/dependabot/bundler/file_parser.rb +++ b/bundler/lib/dependabot/bundler/file_parser.rb @@ -245,10 +245,10 @@ def evaled_gemfiles .reject { |f| f.name.end_with?(".gemspec") } .reject { |f| f.name.end_with?(".specification") } .reject { |f| f.name.end_with?(".lock") } - .reject { |f| f.name.end_with?(".ruby-version") } .reject { |f| f.name == "Gemfile" } .reject { |f| f.name == "gems.rb" } .reject { |f| f.name == "gems.locked" } + .reject(&:support_file?) end def lockfile diff --git a/bundler/lib/dependabot/bundler/file_parser/file_preparer.rb b/bundler/lib/dependabot/bundler/file_parser/file_preparer.rb index b8d21c1a36c..9545646b51b 100644 --- a/bundler/lib/dependabot/bundler/file_parser/file_preparer.rb +++ b/bundler/lib/dependabot/bundler/file_parser/file_preparer.rb @@ -28,6 +28,7 @@ def prepared_dependency_files *evaled_gemfiles, lockfile, ruby_version_file, + tool_versions_file, *imported_ruby_files, *specification_files ].compact @@ -47,10 +48,10 @@ def evaled_gemfiles .reject { |f| f.name.end_with?(".gemspec") } .reject { |f| f.name.end_with?(".specification") } .reject { |f| f.name.end_with?(".lock") } - .reject { |f| f.name.end_with?(".ruby-version") } .reject { |f| f.name == "Gemfile" } .reject { |f| f.name == "gems.rb" } .reject { |f| f.name == "gems.locked" } + .reject(&:support_file?) end def specification_files @@ -70,6 +71,10 @@ def ruby_version_file dependency_files.find { |f| f.name == ".ruby-version" } end + def tool_versions_file + dependency_files.find { |f| f.name == ".tool-versions" } + end + def imported_ruby_files dependency_files .select { |f| f.name.end_with?(".rb") } diff --git a/bundler/lib/dependabot/bundler/file_updater.rb b/bundler/lib/dependabot/bundler/file_updater.rb index b6fdaa7b0a7..056566cee7e 100644 --- a/bundler/lib/dependabot/bundler/file_updater.rb +++ b/bundler/lib/dependabot/bundler/file_updater.rb @@ -127,10 +127,10 @@ def evaled_gemfiles .reject { |f| f.name.end_with?(".gemspec") } .reject { |f| f.name.end_with?(".specification") } .reject { |f| f.name.end_with?(".lock") } - .reject { |f| f.name.end_with?(".ruby-version") } .reject { |f| f.name == "Gemfile" } .reject { |f| f.name == "gems.rb" } .reject { |f| f.name == "gems.locked" } + .reject(&:support_file?) end def updated_gemfile_content(file) diff --git a/bundler/lib/dependabot/bundler/file_updater/lockfile_updater.rb b/bundler/lib/dependabot/bundler/file_updater/lockfile_updater.rb index 1fb2984905f..12831f64456 100644 --- a/bundler/lib/dependabot/bundler/file_updater/lockfile_updater.rb +++ b/bundler/lib/dependabot/bundler/file_updater/lockfile_updater.rb @@ -96,6 +96,7 @@ def write_temporary_dependency_files write_gemspecs(top_level_gemspecs) write_ruby_version_file + write_tool_versions_file write_gemspecs(path_gemspecs) write_specification_files write_imported_ruby_files @@ -115,6 +116,14 @@ def write_ruby_version_file File.write(path, ruby_version_file.content) end + def write_tool_versions_file + return unless tool_versions_file + + path = tool_versions_file.name + FileUtils.mkdir_p(Pathname.new(path).dirname) + File.write(path, tool_versions_file.content) + end + def write_gemspecs(files) files.each do |file| path = file.name @@ -160,6 +169,10 @@ def ruby_version_file dependency_files.find { |f| f.name == ".ruby-version" } end + def tool_versions_file + dependency_files.find { |f| f.name == ".tool-versions" } + end + def post_process_lockfile(lockfile_body) lockfile_body = reorder_git_dependencies(lockfile_body) replace_lockfile_ending(lockfile_body) @@ -269,7 +282,6 @@ def evaled_gemfiles .reject { |f| f.name.end_with?(".gemspec") } .reject { |f| f.name.end_with?(".specification") } .reject { |f| f.name.end_with?(".lock") } - .reject { |f| f.name.end_with?(".ruby-version") } .reject { |f| f.name == "Gemfile" } .reject { |f| f.name == "gems.rb" } .reject { |f| f.name == "gems.locked" } diff --git a/bundler/lib/dependabot/bundler/update_checker/file_preparer.rb b/bundler/lib/dependabot/bundler/update_checker/file_preparer.rb index 04a9c93b406..929a2f3de6a 100644 --- a/bundler/lib/dependabot/bundler/update_checker/file_preparer.rb +++ b/bundler/lib/dependabot/bundler/update_checker/file_preparer.rb @@ -94,6 +94,7 @@ def prepared_dependency_files files += [ lockfile, ruby_version_file, + tool_versions_file, *imported_ruby_files, *specification_files ].compact @@ -130,10 +131,10 @@ def evaled_gemfiles .reject { |f| f.name.end_with?(".gemspec") } .reject { |f| f.name.end_with?(".specification") } .reject { |f| f.name.end_with?(".lock") } - .reject { |f| f.name.end_with?(".ruby-version") } .reject { |f| f.name == "Gemfile" } .reject { |f| f.name == "gems.rb" } .reject { |f| f.name == "gems.locked" } + .reject(&:support_file?) end def lockfile @@ -154,6 +155,10 @@ def ruby_version_file dependency_files.find { |f| f.name == ".ruby-version" } end + def tool_versions_file + dependency_files.find { |f| f.name == ".tool-versions" } + end + def path_gemspecs all = dependency_files.select { |f| f.name.end_with?(".gemspec") } all - top_level_gemspecs diff --git a/bundler/spec/dependabot/bundler/file_fetcher_spec.rb b/bundler/spec/dependabot/bundler/file_fetcher_spec.rb index 1bedd51e356..b039b4bb5cd 100644 --- a/bundler/spec/dependabot/bundler/file_fetcher_spec.rb +++ b/bundler/spec/dependabot/bundler/file_fetcher_spec.rb @@ -40,6 +40,14 @@ body: fixture("github", "ruby_version_content.json"), headers: { "content-type" => "application/json" } ) + + stub_request(:get, File.join(url, ".tool-versions?ref=sha")) + .with(headers: { "Authorization" => "token token" }) + .to_return( + status: 200, + body: fixture("github", "tool_versions_content.json"), + headers: { "content-type" => "application/json" } + ) end context "with a directory" do @@ -163,6 +171,40 @@ end end + context "with a .tool-versions file" do + before do + stub_request(:get, url + "?ref=sha") + .with(headers: { "Authorization" => "token token" }) + .to_return( + status: 200, + body: fixture("github", "contents_ruby_tool_versions.json"), + headers: { "content-type" => "application/json" } + ) + + stub_request(:get, url + "Gemfile?ref=sha") + .with(headers: { "Authorization" => "token token" }) + .to_return( + status: 200, + body: fixture("github", "gemfile_with_ruby_tool_versions_content.json"), + headers: { "content-type" => "application/json" } + ) + + stub_request(:get, url + "Gemfile.lock?ref=sha") + .with(headers: { "Authorization" => "token token" }) + .to_return( + status: 200, + body: fixture("github", "gemfile_lock_content.json"), + headers: { "content-type" => "application/json" } + ) + end + + it "fetches the tool-versions file" do + expect(file_fetcher_instance.files.count).to eq(3) + expect(file_fetcher_instance.files.map(&:name)) + .to include(".tool-versions") + end + end + context "with a gems.rb rather than a Gemfile" do before do stub_request(:get, url + "?ref=sha") diff --git a/bundler/spec/dependabot/bundler/file_parser/file_preparer_spec.rb b/bundler/spec/dependabot/bundler/file_parser/file_preparer_spec.rb index 597b2ef6b66..80b98ab8c96 100644 --- a/bundler/spec/dependabot/bundler/file_parser/file_preparer_spec.rb +++ b/bundler/spec/dependabot/bundler/file_parser/file_preparer_spec.rb @@ -56,6 +56,16 @@ its(:content) { is_expected.to eq("2.2.0\n") } end + describe "the updated tool versions file" do + subject do + prepared_dependency_files.find { |f| f.name == ".tool-versions" } + end + + let(:dependency_files) { bundler_project_dependency_files("tool_versions_file") } + + its(:content) { is_expected.to eq("ruby 2.2.0\n") } + end + describe "the updated .specification file" do subject do prepared_dependency_files.find { |f| f.name == "plugins/example/.specification" } diff --git a/bundler/spec/dependabot/bundler/file_updater_spec.rb b/bundler/spec/dependabot/bundler/file_updater_spec.rb index 0153bdcdbfc..44222f7e1e7 100644 --- a/bundler/spec/dependabot/bundler/file_updater_spec.rb +++ b/bundler/spec/dependabot/bundler/file_updater_spec.rb @@ -537,6 +537,24 @@ end end + context "when the Gemfile loads a .tool-versions file" do + let(:project_name) { "tool_versions_file" } + let(:updater) do + described_class.new( + dependency_files: dependency_files, + dependencies: [dependency], + credentials: [{ + "type" => "git_source", + "host" => "github.com" + }] + ) + end + + it "locks the updated gem to the latest version" do + expect(file.content).to include "business (1.5.0)" + end + end + context "when the Gemfile.lock didn't have a BUNDLED WITH line" do let(:project_name) { "no_bundled_with" } diff --git a/bundler/spec/dependabot/bundler/update_checker/latest_version_finder_spec.rb b/bundler/spec/dependabot/bundler/update_checker/latest_version_finder_spec.rb index 79840794b84..1824b64c95b 100644 --- a/bundler/spec/dependabot/bundler/update_checker/latest_version_finder_spec.rb +++ b/bundler/spec/dependabot/bundler/update_checker/latest_version_finder_spec.rb @@ -213,6 +213,12 @@ its([:version]) { is_expected.to eq(Gem::Version.new("1.5.0")) } end + context "when the Gemfile loads a .tool-versions file" do + let(:dependency_files) { bundler_project_dependency_files("tool_versions_file") } + + its([:version]) { is_expected.to eq(Gem::Version.new("1.5.0")) } + end + context "with a gemspec and a Gemfile" do let(:dependency_files) { bundler_project_dependency_files("gemfile_small_example") } diff --git a/bundler/spec/fixtures/github/contents_ruby_tool_versions.json b/bundler/spec/fixtures/github/contents_ruby_tool_versions.json new file mode 100644 index 00000000000..0d00573fd27 --- /dev/null +++ b/bundler/spec/fixtures/github/contents_ruby_tool_versions.json @@ -0,0 +1,450 @@ +[ + { + "name": ".codeclimate.yml", + "path": ".codeclimate.yml", + "sha": "6393602fac96cfe31d64f89476014124b4a13b85", + "size": 416, + "url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/.codeclimate.yml?ref=develop", + "html_url": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/.codeclimate.yml", + "git_url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/6393602fac96cfe31d64f89476014124b4a13b85", + "download_url": "https://raw.githubusercontent.com/CityOfNewYork/NYCOpenRecords/develop/.codeclimate.yml", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/.codeclimate.yml?ref=develop", + "git": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/6393602fac96cfe31d64f89476014124b4a13b85", + "html": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/.codeclimate.yml" + } + }, + { + "name": ".coveragerc", + "path": ".coveragerc", + "sha": "be7fdc86067d0924f3e1e92c1a3ed92d9486fcbb", + "size": 646, + "url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/.coveragerc?ref=develop", + "html_url": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/.coveragerc", + "git_url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/be7fdc86067d0924f3e1e92c1a3ed92d9486fcbb", + "download_url": "https://raw.githubusercontent.com/CityOfNewYork/NYCOpenRecords/develop/.coveragerc", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/.coveragerc?ref=develop", + "git": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/be7fdc86067d0924f3e1e92c1a3ed92d9486fcbb", + "html": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/.coveragerc" + } + }, + { + "name": ".csslintrc", + "path": ".csslintrc", + "sha": "aacba956e5bbede1c195ce554fcad3e200b24ff8", + "size": 107, + "url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/.csslintrc?ref=develop", + "html_url": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/.csslintrc", + "git_url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/aacba956e5bbede1c195ce554fcad3e200b24ff8", + "download_url": "https://raw.githubusercontent.com/CityOfNewYork/NYCOpenRecords/develop/.csslintrc", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/.csslintrc?ref=develop", + "git": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/aacba956e5bbede1c195ce554fcad3e200b24ff8", + "html": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/.csslintrc" + } + }, + { + "name": ".env.example", + "path": ".env.example", + "sha": "d9f599b33ecd834ea88979dcc3daf4fcafacf4e7", + "size": 2617, + "url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/.env.example?ref=develop", + "html_url": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/.env.example", + "git_url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/d9f599b33ecd834ea88979dcc3daf4fcafacf4e7", + "download_url": "https://raw.githubusercontent.com/CityOfNewYork/NYCOpenRecords/develop/.env.example", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/.env.example?ref=develop", + "git": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/d9f599b33ecd834ea88979dcc3daf4fcafacf4e7", + "html": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/.env.example" + } + }, + { + "name": ".eslintignore", + "path": ".eslintignore", + "sha": "96212a3593bac8c93f624b77185a8d11018efd96", + "size": 16, + "url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/.eslintignore?ref=develop", + "html_url": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/.eslintignore", + "git_url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/96212a3593bac8c93f624b77185a8d11018efd96", + "download_url": "https://raw.githubusercontent.com/CityOfNewYork/NYCOpenRecords/develop/.eslintignore", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/.eslintignore?ref=develop", + "git": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/96212a3593bac8c93f624b77185a8d11018efd96", + "html": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/.eslintignore" + } + }, + { + "name": ".eslintrc.yml", + "path": ".eslintrc.yml", + "sha": "a6a0ce9c44238e06ff55ca335a66a4e16810da38", + "size": 6056, + "url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/.eslintrc.yml?ref=develop", + "html_url": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/.eslintrc.yml", + "git_url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/a6a0ce9c44238e06ff55ca335a66a4e16810da38", + "download_url": "https://raw.githubusercontent.com/CityOfNewYork/NYCOpenRecords/develop/.eslintrc.yml", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/.eslintrc.yml?ref=develop", + "git": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/a6a0ce9c44238e06ff55ca335a66a4e16810da38", + "html": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/.eslintrc.yml" + } + }, + { + "name": ".gitignore", + "path": ".gitignore", + "sha": "93923ac3a463bd17d0aefca2de9d2810f243d747", + "size": 1073, + "url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/.gitignore?ref=develop", + "html_url": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/.gitignore", + "git_url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/93923ac3a463bd17d0aefca2de9d2810f243d747", + "download_url": "https://raw.githubusercontent.com/CityOfNewYork/NYCOpenRecords/develop/.gitignore", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/.gitignore?ref=develop", + "git": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/93923ac3a463bd17d0aefca2de9d2810f243d747", + "html": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/.gitignore" + } + }, + { + "name": ".tool-versions", + "path": ".tool-versions", + "sha": "8530aba7e822a670ff20de2c717391ebaf15c501", + "size": 11, + "url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/.tool-versions?ref=develop", + "html_url": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/.tool-versions", + "git_url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/8530aba7e822a670ff20de2c717391ebaf15c501", + "download_url": "https://raw.githubusercontent.com/CityOfNewYork/NYCOpenRecords/develop/.tool-versions", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/.tool-versions?ref=develop", + "git": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/8530aba7e822a670ff20de2c717391ebaf15c501", + "html": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/.tool-versions" + } + }, + { + "name": "LICENSE.md", + "path": "LICENSE.md", + "sha": "8dada3edaf50dbc082c9a125058f25def75e625a", + "size": 11357, + "url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/LICENSE.md?ref=develop", + "html_url": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/LICENSE.md", + "git_url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/8dada3edaf50dbc082c9a125058f25def75e625a", + "download_url": "https://raw.githubusercontent.com/CityOfNewYork/NYCOpenRecords/develop/LICENSE.md", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/LICENSE.md?ref=develop", + "git": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/8dada3edaf50dbc082c9a125058f25def75e625a", + "html": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/LICENSE.md" + } + }, + { + "name": "Procfile", + "path": "Procfile", + "sha": "72e4ef1be7c64eb0f874344bc8a6cf859bd39e00", + "size": 26, + "url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/Procfile?ref=develop", + "html_url": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/Procfile", + "git_url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/72e4ef1be7c64eb0f874344bc8a6cf859bd39e00", + "download_url": "https://raw.githubusercontent.com/CityOfNewYork/NYCOpenRecords/develop/Procfile", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/Procfile?ref=develop", + "git": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/72e4ef1be7c64eb0f874344bc8a6cf859bd39e00", + "html": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/Procfile" + } + }, + { + "name": "README.md", + "path": "README.md", + "sha": "01aae7d562fe164d2cee644e8ef5fba82d2b8e81", + "size": 1589, + "url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/README.md?ref=develop", + "html_url": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/README.md", + "git_url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/01aae7d562fe164d2cee644e8ef5fba82d2b8e81", + "download_url": "https://raw.githubusercontent.com/CityOfNewYork/NYCOpenRecords/develop/README.md", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/README.md?ref=develop", + "git": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/01aae7d562fe164d2cee644e8ef5fba82d2b8e81", + "html": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/README.md" + } + }, + { + "name": "Vagrantfile.example", + "path": "Vagrantfile.example", + "sha": "54be29ea9e1e2ecdbfa642656cded8b3cb85c910", + "size": 4329, + "url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/Vagrantfile.example?ref=develop", + "html_url": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/Vagrantfile.example", + "git_url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/54be29ea9e1e2ecdbfa642656cded8b3cb85c910", + "download_url": "https://raw.githubusercontent.com/CityOfNewYork/NYCOpenRecords/develop/Vagrantfile.example", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/Vagrantfile.example?ref=develop", + "git": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/54be29ea9e1e2ecdbfa642656cded8b3cb85c910", + "html": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/Vagrantfile.example" + } + }, + { + "name": "app", + "path": "app", + "sha": "f9e84e24364972f3aa4f92b869a622db1f260fa1", + "size": 0, + "url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/app?ref=develop", + "html_url": "https://github.com/CityOfNewYork/NYCOpenRecords/tree/develop/app", + "git_url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/trees/f9e84e24364972f3aa4f92b869a622db1f260fa1", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/app?ref=develop", + "git": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/trees/f9e84e24364972f3aa4f92b869a622db1f260fa1", + "html": "https://github.com/CityOfNewYork/NYCOpenRecords/tree/develop/app" + } + }, + { + "name": "build_scripts", + "path": "build_scripts", + "sha": "be8e80f054e47f0c9a6fc9cfe5061346c6f8b2d0", + "size": 0, + "url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/build_scripts?ref=develop", + "html_url": "https://github.com/CityOfNewYork/NYCOpenRecords/tree/develop/build_scripts", + "git_url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/trees/be8e80f054e47f0c9a6fc9cfe5061346c6f8b2d0", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/build_scripts?ref=develop", + "git": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/trees/be8e80f054e47f0c9a6fc9cfe5061346c6f8b2d0", + "html": "https://github.com/CityOfNewYork/NYCOpenRecords/tree/develop/build_scripts" + } + }, + { + "name": "celery_worker.py", + "path": "celery_worker.py", + "sha": "c84c73c1f1c1aa42550a08ae4f32dc955ced5f18", + "size": 279, + "url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/celery_worker.py?ref=develop", + "html_url": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/celery_worker.py", + "git_url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/c84c73c1f1c1aa42550a08ae4f32dc955ced5f18", + "download_url": "https://raw.githubusercontent.com/CityOfNewYork/NYCOpenRecords/develop/celery_worker.py", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/celery_worker.py?ref=develop", + "git": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/c84c73c1f1c1aa42550a08ae4f32dc955ced5f18", + "html": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/celery_worker.py" + } + }, + { + "name": "config.py", + "path": "config.py", + "sha": "2886556fc4844e708472a99a85b42b4f5b51d509", + "size": 8250, + "url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/config.py?ref=develop", + "html_url": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/config.py", + "git_url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/2886556fc4844e708472a99a85b42b4f5b51d509", + "download_url": "https://raw.githubusercontent.com/CityOfNewYork/NYCOpenRecords/develop/config.py", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/config.py?ref=develop", + "git": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/2886556fc4844e708472a99a85b42b4f5b51d509", + "html": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/config.py" + } + }, + { + "name": "crontab", + "path": "crontab", + "sha": "1e2c1da613e8272df6ece759565524c93bc76780", + "size": 300, + "url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/crontab?ref=develop", + "html_url": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/crontab", + "git_url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/1e2c1da613e8272df6ece759565524c93bc76780", + "download_url": "https://raw.githubusercontent.com/CityOfNewYork/NYCOpenRecords/develop/crontab", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/crontab?ref=develop", + "git": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/1e2c1da613e8272df6ece759565524c93bc76780", + "html": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/crontab" + } + }, + { + "name": "data", + "path": "data", + "sha": "7bceca86ff0e88cb53c8828d441f5e0725776395", + "size": 0, + "url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/data?ref=develop", + "html_url": "https://github.com/CityOfNewYork/NYCOpenRecords/tree/develop/data", + "git_url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/trees/7bceca86ff0e88cb53c8828d441f5e0725776395", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/data?ref=develop", + "git": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/trees/7bceca86ff0e88cb53c8828d441f5e0725776395", + "html": "https://github.com/CityOfNewYork/NYCOpenRecords/tree/develop/data" + } + }, + { + "name": "gunicorn_config.py", + "path": "gunicorn_config.py", + "sha": "7b1a455133c2e78611550e45e8d2072d5c5c4ad7", + "size": 2504, + "url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/gunicorn_config.py?ref=develop", + "html_url": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/gunicorn_config.py", + "git_url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/7b1a455133c2e78611550e45e8d2072d5c5c4ad7", + "download_url": "https://raw.githubusercontent.com/CityOfNewYork/NYCOpenRecords/develop/gunicorn_config.py", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/gunicorn_config.py?ref=develop", + "git": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/7b1a455133c2e78611550e45e8d2072d5c5c4ad7", + "html": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/gunicorn_config.py" + } + }, + { + "name": "jobs.py", + "path": "jobs.py", + "sha": "79f2957e2c94e44786f6ca3dfc7384aaceb80c0a", + "size": 6213, + "url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/jobs.py?ref=develop", + "html_url": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/jobs.py", + "git_url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/79f2957e2c94e44786f6ca3dfc7384aaceb80c0a", + "download_url": "https://raw.githubusercontent.com/CityOfNewYork/NYCOpenRecords/develop/jobs.py", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/jobs.py?ref=develop", + "git": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/79f2957e2c94e44786f6ca3dfc7384aaceb80c0a", + "html": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/jobs.py" + } + }, + { + "name": "magic", + "path": "magic", + "sha": "6342094c1d4b1af948867ffba67cf0b866e5613c", + "size": 659195, + "url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/magic?ref=develop", + "html_url": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/magic", + "git_url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/6342094c1d4b1af948867ffba67cf0b866e5613c", + "download_url": "https://raw.githubusercontent.com/CityOfNewYork/NYCOpenRecords/develop/magic", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/magic?ref=develop", + "git": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/6342094c1d4b1af948867ffba67cf0b866e5613c", + "html": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/magic" + } + }, + { + "name": "manage.py", + "path": "manage.py", + "sha": "a0b80d4c7b5fd7e50d6dcb5bcbdcd995b8da27f0", + "size": 15323, + "url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/manage.py?ref=develop", + "html_url": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/manage.py", + "git_url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/a0b80d4c7b5fd7e50d6dcb5bcbdcd995b8da27f0", + "download_url": "https://raw.githubusercontent.com/CityOfNewYork/NYCOpenRecords/develop/manage.py", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/manage.py?ref=develop", + "git": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/a0b80d4c7b5fd7e50d6dcb5bcbdcd995b8da27f0", + "html": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/manage.py" + } + }, + { + "name": "migrations", + "path": "migrations", + "sha": "da206a9809330d01f4800718bca2a20c05038b44", + "size": 0, + "url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/migrations?ref=develop", + "html_url": "https://github.com/CityOfNewYork/NYCOpenRecords/tree/develop/migrations", + "git_url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/trees/da206a9809330d01f4800718bca2a20c05038b44", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/migrations?ref=develop", + "git": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/trees/da206a9809330d01f4800718bca2a20c05038b44", + "html": "https://github.com/CityOfNewYork/NYCOpenRecords/tree/develop/migrations" + } + }, + { + "name": "Gemfile", + "path": "Gemfile", + "sha": "88b4e0a1c8093fae2b4fa52534035f9f85ed0956", + "size": 2433, + "url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/Gemfile?ref=develop", + "html_url": "https://github.com/CityOfNewYork/NYCOpenRecords/tree/develop/Gemfile", + "git_url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/trees/88b4e0a1c8093fae2b4fa52534035f9f85ed0956", + "download_url": "https://raw.githubusercontent.com/CityOfNewYork/NYCOpenRecords/develop/Gemfile", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/Gemfile?ref=develop", + "git": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/trees/88b4e0a1c8093fae2b4fa52534035f9f85ed0956", + "html": "https://github.com/CityOfNewYork/NYCOpenRecords/tree/develop/Gemfile" + } + }, + { + "name": "Gemfile.lock", + "path": "Gemfile.lock", + "sha": "d429264c8c2f0f306a422900c2f41123e07c31b4", + "size": 2433, + "url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/Gemfile.lock?ref=develop", + "html_url": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/Gemfile.lock", + "git_url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/d429264c8c2f0f306a422900c2f41123e07c31b4", + "download_url": "https://raw.githubusercontent.com/CityOfNewYork/NYCOpenRecords/develop/Gemfile.lock", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/Gemfile.lock?ref=develop", + "git": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/d429264c8c2f0f306a422900c2f41123e07c31b4", + "html": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/Gemfile.lock" + } + }, + { + "name": "tests", + "path": "tests", + "sha": "88b4e0a1c8093fae2b4fa52534035f9f85ed0956", + "size": 0, + "url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/tests?ref=develop", + "html_url": "https://github.com/CityOfNewYork/NYCOpenRecords/tree/develop/tests", + "git_url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/trees/88b4e0a1c8093fae2b4fa52534035f9f85ed0956", + "download_url": null, + "type": "dir", + "_links": { + "self": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/tests?ref=develop", + "git": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/trees/88b4e0a1c8093fae2b4fa52534035f9f85ed0956", + "html": "https://github.com/CityOfNewYork/NYCOpenRecords/tree/develop/tests" + } + }, + { + "name": "todo.txt", + "path": "todo.txt", + "sha": "3e369beef1c9e64f0c10735d35aa8ad755daddc6", + "size": 1147, + "url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/todo.txt?ref=develop", + "html_url": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/todo.txt", + "git_url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/3e369beef1c9e64f0c10735d35aa8ad755daddc6", + "download_url": "https://raw.githubusercontent.com/CityOfNewYork/NYCOpenRecords/develop/todo.txt", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/todo.txt?ref=develop", + "git": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/3e369beef1c9e64f0c10735d35aa8ad755daddc6", + "html": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/todo.txt" + } + }, + { + "name": "update_definitions.sh", + "path": "update_definitions.sh", + "sha": "fbde266ea5ebd519b94d18f8f78ab825b02766df", + "size": 7877, + "url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/update_definitions.sh?ref=develop", + "html_url": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/update_definitions.sh", + "git_url": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/fbde266ea5ebd519b94d18f8f78ab825b02766df", + "download_url": "https://raw.githubusercontent.com/CityOfNewYork/NYCOpenRecords/develop/update_definitions.sh", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/contents/update_definitions.sh?ref=develop", + "git": "https://api.github.com/repos/CityOfNewYork/NYCOpenRecords/git/blobs/fbde266ea5ebd519b94d18f8f78ab825b02766df", + "html": "https://github.com/CityOfNewYork/NYCOpenRecords/blob/develop/update_definitions.sh" + } + } +] diff --git a/bundler/spec/fixtures/github/gemfile_with_ruby_tool_versions_content.json b/bundler/spec/fixtures/github/gemfile_with_ruby_tool_versions_content.json new file mode 100644 index 00000000000..7d70e6d503b --- /dev/null +++ b/bundler/spec/fixtures/github/gemfile_with_ruby_tool_versions_content.json @@ -0,0 +1,18 @@ +{ + "name": "Gemfile", + "path": "Gemfile", + "sha": "dbce0c9e2e7efd19139c2c0aeb0110e837812c2f", + "size": 291, + "url": "https://api.github.com/repos/gocardless/bump/contents/Gemfile?ref=master", + "html_url": "https://github.com/gocardless/bump/blob/master/Gemfile", + "git_url": "https://api.github.com/repos/gocardless/bump/git/blobs/dbce0c9e2e7efd19139c2c0aeb0110e837812c2f", + "download_url": "https://raw.githubusercontent.com/gocardless/bump/master/Gemfile?token=ABF4KfGg6a7sE1n1i2rrhUvqAKRhIkPiks5WD8X5wA%3D%3D", + "type": "file", + "content": "c291cmNlICJodHRwczovL3J1YnlnZW1zLm9yZyIKCnJ1YnkgRmlsZS5vcGVu\nKCcudG9vbC12ZXJzaW9ucycsICdyYicpLm1hdGNoKCJydWJ5ICguKikKIilb\nMV0KCmdlbSAiYnVtcC1jb3JlIgpnZW0gInN0YXRlc21hbiIsIGdpdDogImh0\ndHBzOi8vZ2l0aHViLmNvbS9nb2NhcmRsZXNzL3N0YXRlc21hbi5naXQiCg==\n", + "encoding": "base64", + "_links": { + "self": "https://api.github.com/repos/gocardless/bump/contents/Gemfile?ref=master", + "git": "https://api.github.com/repos/gocardless/bump/git/blobs/dbce0c9e2e7efd19139c2c0aeb0110e837812c2f", + "html": "https://github.com/gocardless/bump/blob/master/Gemfile" + } +} diff --git a/bundler/spec/fixtures/github/tool_versions_content.json b/bundler/spec/fixtures/github/tool_versions_content.json new file mode 100644 index 00000000000..77f6f7414b0 --- /dev/null +++ b/bundler/spec/fixtures/github/tool_versions_content.json @@ -0,0 +1,18 @@ +{ + "name": ".tool-versions", + "path": ".tool-versions", + "sha": "005119baaa0653ca59d923010341d8341daa8c43", + "size": 6, + "url": "https://api.github.com/repos/gocardless/bump/contents/.tool-versions?ref=master", + "html_url": "https://github.com/gocardless/bump/blob/master/.tool-versions", + "git_url": "https://api.github.com/repos/gocardless/bump/git/blobs/005119baaa0653ca59d923010341d8341daa8c43", + "download_url": "https://raw.githubusercontent.com/gocardless/bump/master/.tool-versions", + "type": "file", + "content": "cnVieSAyLjQuMQo=\n", + "encoding": "base64", + "_links": { + "self": "https://api.github.com/repos/gocardless/bump/contents/.tool-versions?ref=master", + "git": "https://api.github.com/repos/gocardless/bump/git/blobs/005119baaa0653ca59d923010341d8341daa8c43", + "html": "https://github.com/gocardless/bump/blob/master/.tool-versions" + } +} diff --git a/bundler/spec/fixtures/projects/bundler1/tool_versions_file/.gitignore b/bundler/spec/fixtures/projects/bundler1/tool_versions_file/.gitignore new file mode 100644 index 00000000000..48238a337f5 --- /dev/null +++ b/bundler/spec/fixtures/projects/bundler1/tool_versions_file/.gitignore @@ -0,0 +1 @@ +!.tool-versions diff --git a/bundler/spec/fixtures/projects/bundler1/tool_versions_file/.tool-versions b/bundler/spec/fixtures/projects/bundler1/tool_versions_file/.tool-versions new file mode 100644 index 00000000000..7e1bff11200 --- /dev/null +++ b/bundler/spec/fixtures/projects/bundler1/tool_versions_file/.tool-versions @@ -0,0 +1 @@ +ruby 2.2.0 diff --git a/bundler/spec/fixtures/projects/bundler1/tool_versions_file/Gemfile b/bundler/spec/fixtures/projects/bundler1/tool_versions_file/Gemfile new file mode 100644 index 00000000000..34c4cf9e8f9 --- /dev/null +++ b/bundler/spec/fixtures/projects/bundler1/tool_versions_file/Gemfile @@ -0,0 +1,6 @@ +source "https://rubygems.org" + +ruby File.open('.tool-versions', 'rb') { |f| f.read.match(/ruby (.*)\n/)[1] } + +gem "business", "~> 1.4.0" +gem "statesman", "~> 1.2.0" diff --git a/bundler/spec/fixtures/projects/bundler1/tool_versions_file/Gemfile.lock b/bundler/spec/fixtures/projects/bundler1/tool_versions_file/Gemfile.lock new file mode 100644 index 00000000000..65d23b6c746 --- /dev/null +++ b/bundler/spec/fixtures/projects/bundler1/tool_versions_file/Gemfile.lock @@ -0,0 +1,15 @@ +GEM + remote: https://rubygems.org/ + specs: + business (1.4.0) + statesman (1.2.1) + +PLATFORMS + ruby + +DEPENDENCIES + business (~> 1.4.0) + statesman (~> 1.2.0) + +BUNDLED WITH + 1.10.6 diff --git a/bundler/spec/fixtures/projects/bundler2/tool_versions_file/.gitignore b/bundler/spec/fixtures/projects/bundler2/tool_versions_file/.gitignore new file mode 100644 index 00000000000..48238a337f5 --- /dev/null +++ b/bundler/spec/fixtures/projects/bundler2/tool_versions_file/.gitignore @@ -0,0 +1 @@ +!.tool-versions diff --git a/bundler/spec/fixtures/projects/bundler2/tool_versions_file/.tool-versions b/bundler/spec/fixtures/projects/bundler2/tool_versions_file/.tool-versions new file mode 100644 index 00000000000..7e1bff11200 --- /dev/null +++ b/bundler/spec/fixtures/projects/bundler2/tool_versions_file/.tool-versions @@ -0,0 +1 @@ +ruby 2.2.0 diff --git a/bundler/spec/fixtures/projects/bundler2/tool_versions_file/Gemfile b/bundler/spec/fixtures/projects/bundler2/tool_versions_file/Gemfile new file mode 100644 index 00000000000..34c4cf9e8f9 --- /dev/null +++ b/bundler/spec/fixtures/projects/bundler2/tool_versions_file/Gemfile @@ -0,0 +1,6 @@ +source "https://rubygems.org" + +ruby File.open('.tool-versions', 'rb') { |f| f.read.match(/ruby (.*)\n/)[1] } + +gem "business", "~> 1.4.0" +gem "statesman", "~> 1.2.0" diff --git a/bundler/spec/fixtures/projects/bundler2/tool_versions_file/Gemfile.lock b/bundler/spec/fixtures/projects/bundler2/tool_versions_file/Gemfile.lock new file mode 100644 index 00000000000..3fa0fb21893 --- /dev/null +++ b/bundler/spec/fixtures/projects/bundler2/tool_versions_file/Gemfile.lock @@ -0,0 +1,15 @@ +GEM + remote: https://rubygems.org/ + specs: + business (1.4.0) + statesman (1.2.1) + +PLATFORMS + ruby + +DEPENDENCIES + business (~> 1.4.0) + statesman (~> 1.2.0) + +BUNDLED WITH + 2.2.0 diff --git a/bundler/spec/spec_helper.rb b/bundler/spec/spec_helper.rb index 3cf36e5d400..6e76d874e91 100644 --- a/bundler/spec/spec_helper.rb +++ b/bundler/spec/spec_helper.rb @@ -27,6 +27,9 @@ def self.bundler_version def bundler_project_dependency_files(project, directory: "/") project_dependency_files(File.join("bundler#{PackageManagerHelper.bundler_version}", project), directory: directory) + .each do |dep| + dep.support_file = dep.name.end_with?(".ruby-version", ".tool-versions") + end end def bundler_project_dependency_file(project, filename:)