From 652cf12c0a196b4719f6517f2fea308d8d556a5f Mon Sep 17 00:00:00 2001 From: Artur Roszczyk Date: Fri, 13 Feb 2015 11:19:31 +0100 Subject: [PATCH] Support Gemfile in ember-cli application Some EmberCLI addons require gems like compass or susy to be installed. There is no need to have these gems in the rails project's Gemfile. This pull request adds the support for Gemfile in the ember-cli application's directory. Tested with: - rvm 1.26.10 - ruby 2.1.3 - rubygems 2.4.5 Caveats: - the ruby version in both ember-cli and rails applications must be identical We can reuse the exec method --- lib/ember-cli/app.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/ember-cli/app.rb b/lib/ember-cli/app.rb index 7738651a..1a1580cd 100644 --- a/lib/ember-cli/app.rb +++ b/lib/ember-cli/app.rb @@ -20,6 +20,7 @@ def compile end def install_dependencies + exec "bundle install" if gemfile_path.exist? exec "#{npm_path} install" end @@ -241,9 +242,14 @@ def env_hash ENV.clone.tap do |vars| vars.store "DISABLE_FINGERPRINTING", "true" vars.store "EXCLUDE_EMBER_ASSETS", excluded_ember_deps + vars.store "BUNDLE_GEMFILE", gemfile_path end end + def gemfile_path + app_path.join('Gemfile') + end + def exec(cmd, options={}) method_name = options.fetch(:method, :system)