generators/rhoconnect.rb in rhoconnect-4.0.0 vs generators/rhoconnect.rb in rhoconnect-4.0.1
- old
+ new
@@ -122,12 +122,24 @@
Executing 'bundle install' for the first time in your freshly baked application!
bundle install --gemfile=#{destination_root}/#{name}/Gemfile
_RUN_BUNDLER
- puts running_bundler_first_time
- system("bundle install --gemfile=#{destination_root}/#{name}/Gemfile")
- puts install_gems_note
+ gem_name, gem_ver_reqs = 'rhoconnect', gem_version
+ found_gspec = Gem::Specification.find_by_name(gem_name, gem_ver_reqs)
+ puts found_gspec
+ if found_gspec
+ puts running_bundler_first_time
+ system("bundle install --gemfile=#{destination_root}/#{name}/Gemfile")
+ puts install_gems_note
+ end
+ rescue Exception => e
+ warning_msg = "\n" +
+ "*** Warning: Generatior failed to run bundler. ***\n" +
+ "*** Install required version of rhoconnect gem, or explicitly ***\n" +
+ "*** define in Gemfile the source to the gem using :path option. ***\n" +
+ "\n"
+ puts warning_msg
end
end
class RubyAppGenerator < AppGenerator
install_app_options(self)