Skip to content
Browse files

lib/loader.rb: try to require rubygems if direct require failed

  • Loading branch information...
1 parent bc6c11a commit bf9fbac3284e3b22d4f9d219c564739fcbf3e11a @eregon committed
Showing with 14 additions and 4 deletions.
  1. +8 −3 lib/noe/loader.rb
  2. +6 −1 templates/ruby/src/lib/__lower__/loader.rb
View
11 lib/noe/loader.rb
@@ -1,3 +1,8 @@
-require "wlang"
-require "quickl"
-require "highline"
+begin
+ require "wlang"
+ require "quickl"
+ require "highline"
+rescue LoadError
+ require 'rubygems'
+ retry
+end
View
7 templates/ruby/src/lib/__lower__/loader.rb
@@ -1 +1,6 @@
-*{dependencies.select{|dep| dep.groups.include?('runtime')} as dep}{require +{dep.name}}{!{"\n"}}
+begin
+ *{dependencies.select{|dep| dep.groups.include?('runtime')} as dep}{require +{dep.name}}{!{"\n "}}
+rescue LoadError
+ require 'rubygems'
+ retry
+end

0 comments on commit bf9fbac

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