Permalink
Browse files

Auto merge of #4916 - bundler:seg-remove-pysched-yaml, r=indirect

Remove psyched_yaml

Closes #4825
See #4856
  • Loading branch information...
2 parents 447d519 + 7428308 commit 16fcbf7652c314b794a9d71a82655eda357a85fe @homu homu committed Sep 30, 2016
View
@@ -17,7 +17,6 @@ Lint/Eval:
Lint/HandleExceptions:
Exclude:
- 'lib/bundler/installer.rb'
- - 'lib/bundler/psyched_yaml.rb'
- 'lib/bundler/vendored_persistent.rb'
# Offense count: 1
@@ -122,7 +121,6 @@ Style/ConditionalAssignment:
- 'lib/bundler/cli/platform.rb'
- 'lib/bundler/dsl.rb'
- 'lib/bundler/lazy_specification.rb'
- - 'lib/bundler/psyched_yaml.rb'
- 'lib/bundler/rubygems_integration.rb'
- 'lib/bundler/source/git.rb'
- 'lib/bundler/source/rubygems.rb'
View
@@ -386,10 +386,8 @@ def reset!
private
def eval_yaml_gemspec(path, contents)
- # If the YAML is invalid, Syck raises an ArgumentError, and Psych
- # raises a Psych::SyntaxError. See psyched_yaml.rb for more info.
Gem::Specification.from_yaml(contents)
- rescue YamlLibrarySyntaxError, ArgumentError, Gem::EndOfYAMLException, Gem::Exception
+ rescue Psych::SyntaxError, ArgumentError, Gem::EndOfYAMLException, Gem::Exception
eval_gemspec(path, contents)
end
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-# Psych could be a gem, so try to ask for it
-begin
- gem "psych"
-rescue LoadError
-end if defined?(gem)
-
-# Psych could be in the stdlib
-# but it's too late if Syck is already loaded
-begin
- require "psych" unless defined?(Syck)
-rescue LoadError
- # Apparently Psych wasn't available. Oh well.
-end
-
-# At least load the YAML stdlib, whatever that may be
-require "yaml" unless defined?(YAML.dump)
-
-module Bundler
- # On encountering invalid YAML,
- # Psych raises Psych::SyntaxError
- if defined?(::Psych::SyntaxError)
- YamlLibrarySyntaxError = ::Psych::SyntaxError
- else # Syck raises ArgumentError
- YamlLibrarySyntaxError = ::ArgumentError
- end
-end
@@ -80,13 +80,12 @@ def platforms
end
def configuration
- require "bundler/psyched_yaml"
Gem.configuration
rescue Gem::SystemExitException, LoadError => e
Bundler.ui.error "#{e.class}: #{e.message}"
Bundler.ui.trace e
raise
- rescue YamlLibrarySyntaxError => e
+ rescue Psych::SyntaxError => e
raise YamlSyntaxError.new(e, "Your RubyGems configuration, which is " \
"usually located in ~/.gemrc, contains invalid YAML syntax.")
end
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-require "spec_helper"
-require "bundler/psyched_yaml"
-
-describe "Bundler::YamlLibrarySyntaxError" do
- it "is raised on YAML parse errors" do
- expect { YAML.parse "{foo" }.to raise_error(Bundler::YamlLibrarySyntaxError)
- end
-end
@@ -118,7 +118,7 @@
gem 'require_ruby'
G
- expect(out).to_not include("Gem::InstallError: require_ruby requires Ruby version > 9000")
+ expect(out).to_not match(/Gem::(InstallError|RuntimeRequirementNotMetError): require_ruby requires Ruby version > 9000/)
end
end
end
@@ -48,8 +48,16 @@
gem 'capybara', '~> 2.2.0'
gem 'rack-cache', '1.2.0' # last version that works on Ruby 1.9
G
- bundle :lock
- expect(lockfile).to include("rails (3.2.22.4)")
+ bundle! :lock
+ rails_version = ruby(<<-R)
+ require 'rubygems'
+ require 'bundler'
+ fetcher = Bundler::Fetcher.new(Bundler::Source::Rubygems::Remote.new(URI('https://rubygems.org')))
+ index = fetcher.specs(%w(rails), nil)
+ rails = index.search(Gem::Dependency.new("rails", "~> 3.0")).last
+ puts rails.version
+ R
+ expect(lockfile).to include("rails (#{rails_version})")
expect(lockfile).to include("capybara (2.2.1)")
end
View
@@ -2,7 +2,6 @@
$:.unshift File.expand_path("..", __FILE__)
$:.unshift File.expand_path("../../lib", __FILE__)
-require "bundler/psyched_yaml"
require "fileutils"
require "uri"
require "digest/sha1"

0 comments on commit 16fcbf7

Please sign in to comment.