lib/skele.rb in skele-0.2.0 vs lib/skele.rb in skele-0.2.1
- old
+ new
@@ -65,12 +65,35 @@
end
return result
end
+ def bundler_installed?
+ # make sure bundler is installed
+ bundler_list = `gem list bundler`
+
+ bundler_list.split("\n").each do |line|
+ if (/^bundler/i).match(line)
+ return true
+ end
+ end
+
+ return false
+ end
+
def bundle_install
if File.exists? @destination + "Gemfile"
- return `bundle install --path=vendor/bundle`
+ bundler_result = ""
+
+ unless bundler_installed?
+ bundler_result += "Bundler wasn't found, so we're installing it\n\n"
+ bundler_result += `gem install bundler`
+ bundler_result += "\n\n"
+ end
+
+ bundler_result += `bundle install --path=vendor/bundle`
+
+ return bundler_result
end
return nil
end
end
\ No newline at end of file