提交 bec08e77 编写于 作者: R Rafael Mendonça França

Merge pull request #16267 from robin850/rbx-yaml

Set Psych as the YAML engine for Rubinius
...@@ -87,6 +87,12 @@ platforms :jruby do ...@@ -87,6 +87,12 @@ platforms :jruby do
end end
end end
platforms :rbx do
# The rubysl-yaml gem doesn't ship with Psych by default
# as it needs libyaml that isn't always available.
gem 'psych', '~> 2.0'
end
# gems that are necessary for ActiveRecord tests with Oracle database # gems that are necessary for ActiveRecord tests with Oracle database
if ENV['ORACLE_ENHANCED'] if ENV['ORACLE_ENHANCED']
platforms :ruby do platforms :ruby do
......
...@@ -114,6 +114,7 @@ def gemfile_entries ...@@ -114,6 +114,7 @@ def gemfile_entries
jbuilder_gemfile_entry, jbuilder_gemfile_entry,
sdoc_gemfile_entry, sdoc_gemfile_entry,
spring_gemfile_entry, spring_gemfile_entry,
psych_gemfile_entry,
@extra_entries].flatten.find_all(&@gem_filter) @extra_entries].flatten.find_all(&@gem_filter)
end end
...@@ -313,6 +314,14 @@ def spring_gemfile_entry ...@@ -313,6 +314,14 @@ def spring_gemfile_entry
GemfileEntry.new('spring', nil, comment, group: :development) GemfileEntry.new('spring', nil, comment, group: :development)
end end
def psych_gemfile_entry
return [] unless defined?(Rubinius)
comment = 'Use Psych as the YAML engine, instead of Syck, so serialized ' \
'data can be read safely from different rubies (see http://git.io/uuLVag)'
GemfileEntry.new('psych', '~> 2.0', comment, platforms: :rbx)
end
def bundle_command(command) def bundle_command(command)
say_status :run, "bundle #{command}" say_status :run, "bundle #{command}"
......
...@@ -488,6 +488,19 @@ def test_gitignore_when_non_sqlite3_db ...@@ -488,6 +488,19 @@ def test_gitignore_when_non_sqlite3_db
end end
end end
def test_psych_gem
run_generator
gem_regex = /gem 'psych',\s+'~> 2.0', \s+platforms: :rbx/
assert_file "Gemfile" do |content|
if defined?(Rubinius)
assert_match(gem_regex, content)
else
assert_no_match(gem_regex, content)
end
end
end
protected protected
def action(*args, &block) def action(*args, &block)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册