Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Psych 4.0.x #134

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crystalball.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'parser'
spec.add_development_dependency 'pry'
spec.add_development_dependency 'pry-byebug'
spec.add_development_dependency 'psych', '~> 4.0.0'
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency 'rubocop', ">= 0.56"
spec.add_development_dependency 'rubocop-rspec'
spec.add_development_dependency 'simplecov'
spec.add_development_dependency 'sqlite3', "~> 1.3.13"
spec.add_development_dependency 'sqlite3', "~> 1.4.2"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An earlier version of sqlite was not building on my Mac, this upgrade was to unblock me from running the setup and the tests.

spec.add_development_dependency 'yard'
end
3 changes: 2 additions & 1 deletion lib/crystalball/extensions/git/lib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ def merge_base(*args)
opts = args.last.is_a?(Hash) ? args.pop : {}

arg_opts = opts.map { |k, v| "--#{k}" if v }.compact + args
command_args = ['merge-base'] + arg_opts.flatten

command('merge-base', arg_opts)
command(*command_args)
end
end
end
2 changes: 1 addition & 1 deletion lib/crystalball/map_storage/yaml_storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def read_files(path)

paths.map do |file|
metadata, *example_groups = file.read.split("---\n").reject(&:empty?).map do |yaml|
YAML.safe_load(yaml, [Symbol])
YAML.safe_load(yaml, permitted_classes: [Symbol])
Copy link
Author

@marksiemers marksiemers Jan 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This version: YAML.safe_load(yaml, [Symbol]) was deprecated by Psych, then removed in version 4.

See commit here: ruby/psych@0767227#diff-659eac8589abc82c9a0ab3699e4e4be4774d9c09c6c9934af5d9dae0d264439cR322

end
example_groups = example_groups.inject(&:merge!)

Expand Down
2 changes: 1 addition & 1 deletion lib/crystalball/rspec/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def config
@config ||= begin
config_src = if config_file
require 'yaml'
YAML.safe_load(config_file.read)
YAML.safe_load(config_file.read, permitted_classes: [Symbol])
else
{}
end
Expand Down
2 changes: 1 addition & 1 deletion spec/rspec/runner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
end

context 'with CRYSTALBALL_CONFIG env variable set' do
let(:expected_config) { YAML.safe_load(Pathname('spec/fixtures/crystalball.yml').read) }
let(:expected_config) { YAML.safe_load(Pathname('spec/fixtures/crystalball.yml').read, permitted_classes: [Symbol]) }

around do |example|
ENV['CRYSTALBALL_CONFIG'] = 'spec/fixtures/crystalball.yml'
Expand Down