lib/dtc_rake/util.rb in dtc_rake-1.0.0 vs lib/dtc_rake/util.rb in dtc_rake-1.1.0

- old
+ new

@@ -28,9 +28,23 @@ def check_jruby! error(".war files must be built using JRuby!") unless RUBY_PLATFORM == "java" end module_function :check_jruby! + def check_bundler! + string = `bundler -v` + if string =~ /\d+\.\d+.\d+/ + version = string.match(/\d+\.\d+.\d+/).to_s + version_parts = version.split('.') + if version_parts[1].to_i > 15 + error("Unable to build war files with bundler #{version}.\nBundler version must be lower than 1.16.X.") + end + else + warning("Unknown version of bundler.\nYour bundler is not work correctly or dtc_rake isn't able to check version on your platform.") + end + end + module_function :check_bundler! + def upload_pack(attrs) file = attrs[:file] artifact_uri = attrs[:appbox_uri] || DtcRake::Product.instance.appbox_uri attachment_code = attrs[:attachment_code] credentials = attrs[:credentials]