Skip to content
Browse files

Merge pull request #12795 from arunagw/plateform-dependent-gems

Added platform dependent gems
  • Loading branch information...
2 parents 3a45cf6 + e259afe commit b683ec623a261bae075c49aa35ff348e0920c795 @rafaelfranca rafaelfranca committed Nov 7, 2013
Showing with 16 additions and 0 deletions.
  1. +9 −0 railties/lib/rails/generators/app_base.rb
  2. +7 −0 railties/test/generators/app_generator_test.rb
View
9 railties/lib/rails/generators/app_base.rb
@@ -110,6 +110,7 @@ def gemfile_entries
javascript_gemfile_entry,
jbuilder_gemfile_entry,
sdoc_gemfile_entry,
+ platform_dependent_gemfile_entry,
@extra_entries].flatten.find_all(&@gem_filter)
end
@@ -316,6 +317,14 @@ def assets_gemfile_entry
gems
end
+ def platform_dependent_gemfile_entry
+ gems = []
+ if RUBY_ENGINE == 'rbx'
+ gems << GemfileEntry.version('rubysl', nil)
+ end
+ gems
+ end
+
def jbuilder_gemfile_entry
comment = 'Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder'
GemfileEntry.version('jbuilder', '~> 1.2', comment)
View
7 railties/test/generators/app_generator_test.rb
@@ -305,6 +305,13 @@ def test_inclusion_of_javascript_runtime
end
end
+ def test_inclusion_of_plateform_dependent_gems
+ run_generator([destination_root])
+ if RUBY_ENGINE == 'rbx'
+ assert_gem 'rubysl'
+ end
+ end
+
def test_creation_of_a_test_directory
run_generator
assert_file 'test'

0 comments on commit b683ec6

Please sign in to comment.
Something went wrong with that request. Please try again.