diff options
author | Robin Dupret <robin.dupret@gmail.com> | 2014-07-23 19:24:16 +0200 |
---|---|---|
committer | Robin Dupret <robin.dupret@gmail.com> | 2014-07-23 20:05:14 +0200 |
commit | 558f8aa2ee80ee8cb859f0da9714dc93294c856b (patch) | |
tree | d921522068b5380133ad426183d66c8003f9a551 /railties/lib | |
parent | 8c48a708243236491e33290e3b5676dc27a64c05 (diff) | |
download | rails-558f8aa2ee80ee8cb859f0da9714dc93294c856b.tar.gz rails-558f8aa2ee80ee8cb859f0da9714dc93294c856b.tar.bz2 rails-558f8aa2ee80ee8cb859f0da9714dc93294c856b.zip |
Set Psych as the YAML engine for Rubinius
Since the rubysl-yaml gem doesn't ship with Psych by default because of
its dependency on libyaml, on Rubinius, the default engine is Syck.
However, if we want to be able to run the application safely on
different rubies, we need to make people using Rubinius rely on Psych.
See http://git.io/uuLVag for further information.
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/generators/app_base.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index 20e512a7ff..c93ed10d6a 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -114,6 +114,7 @@ module Rails jbuilder_gemfile_entry, sdoc_gemfile_entry, spring_gemfile_entry, + psych_gemfile_entry, @extra_entries].flatten.find_all(&@gem_filter) end @@ -313,6 +314,14 @@ module Rails GemfileEntry.new('spring', nil, comment, group: :development) 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) say_status :run, "bundle #{command}" |