data/ore/templates/bin/bin/[name].erb in ore-0.9.3 vs data/ore/templates/bin/bin/[name].erb in ore-0.9.4
- old
+ new
@@ -1,21 +1,16 @@
#!/usr/bin/env ruby
-<%- if (bundler? && (git? || hg?)) -%>
-root_dir = File.expand_path(File.join(File.dirname(__FILE__),'..'))
-if File.directory?(File.join(root_dir,'.git'))
- Dir.chdir(root_dir) do |path|
- require 'bundler'
-
+<%- if (bundler? && (git? || hg? || svn?)) -%>
+root = File.expand_path(File.join(File.dirname(__FILE__),'..'))
+if File.directory?(File.join(root,'.<%= @scm %>'))
+ Dir.chdir(root) do
begin
- Bundler.setup(:default)
- rescue Bundler::BundlerError => e
+ require 'bundler/setup'
+ rescue LoadError => e
warn e.message
- warn "Run `bundle install` to install missing gems"
- exit e.status_code
+ warn "Run `gem install bundler` to install Bundler"
+ exit -1
end
end
-
- lib_dir = File.join(root_dir,'lib')
- $LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir)
end
<%- end -%>