Skip to content

Commit

Permalink
Merge pull request #3980 from rubygems/no_bundler_gemspec_rewrite
Browse files Browse the repository at this point in the history
Remove old workaround for non-git environments
  • Loading branch information
deivid-rodriguez committed Oct 2, 2020
2 parents 21536b3 + f811599 commit da6a681
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
19 changes: 18 additions & 1 deletion .github/workflows/install-rubygems.yml
Expand Up @@ -9,7 +9,7 @@ on:
- 3.2

jobs:
install_rubygems:
install_rubygems_ubuntu:
runs-on: ubuntu-18.04
strategy:
fail-fast: false
Expand Down Expand Up @@ -52,3 +52,20 @@ jobs:
run: if grep -q 'GET http' output.txt; then false; else true; fi
working-directory: ./bundler
timeout-minutes: 10

install_rubygems_windows:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.1
bundler: none
- name: Install rubygems
run: ruby setup.rb
shell: bash
- name: Check installation didn't modify gemspec line feeds
run: ruby -Ilib -e'exit 1 if File.readlines("bundler/bundler.gemspec").first.end_with?("\r\n")'
shell: bash
timeout-minutes: 10
4 changes: 0 additions & 4 deletions lib/rubygems/commands/setup_command.rb
Expand Up @@ -394,10 +394,6 @@ def install_default_bundler_gem(bin_dir)
specs_dir = File.join(options[:destdir], specs_dir) unless Gem.win_platform?
mkdir_p specs_dir, :mode => 0755

# Workaround for non-git environment.
gemspec = File.open('bundler/bundler.gemspec', 'rb'){|f| f.read.gsub(/`git ls-files -z`/, "''") }
File.open('bundler/bundler.gemspec', 'w'){|f| f.write gemspec }

bundler_spec = Gem::Specification.load("bundler/bundler.gemspec")
bundler_spec.files = Dir.chdir("bundler") { Dir["{*.md,{lib,exe,man}/**/*}"] }
bundler_spec.executables -= %w[bundler bundle_ruby]
Expand Down

0 comments on commit da6a681

Please sign in to comment.