Skip to content

Commit

Permalink
Added platform dependent gems
Browse files Browse the repository at this point in the history
See #12475

If people are on rbx they will get the desired gem
  • Loading branch information
arunagw committed Nov 7, 2013
1 parent 1c47225 commit e259afe
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions railties/lib/rails/generators/app_base.rb
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions railties/test/generators/app_generator_test.rb
Expand Up @@ -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'
Expand Down

0 comments on commit e259afe

Please sign in to comment.