Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #41 from jenkinsci/jruby-fix-for-thor

Backport JRuby fix to Thor.
  • Loading branch information...
commit 25a26c39a0e7056239c121d9405f9c97d0c3c6f5 2 parents 31966e9 + baf6d55
@cowboyd cowboyd authored
View
13 ruby-tools/cli/lib/jenkins/cli.rb
@@ -4,6 +4,19 @@
require 'jenkins/cli/formatting'
require 'jenkins/remote'
+# Until a new version (>= 0.14.6 & 0.15.0rc2) is released, this backports a fix
+# for JRuby argument handling:
+# https://github.com/wycats/thor/commit/33490a59ed297eb798381f1c86cbaa3608413eaf
+class Thor
+ class Task
+ def sans_backtrace(backtrace, caller) #:nodoc:
+ saned = backtrace.reject { |frame| frame =~ FILE_REGEXP || (frame =~ /\.java:/ && RUBY_PLATFORM =~ /java/) }
+ saned -= caller
+ end
+ end
+end
+
+
module Jenkins
class CLI < Thor
include CLI::Formatting
View
14 ruby-tools/jpi/lib/jenkins/plugin/cli.rb
@@ -5,6 +5,18 @@
require 'jenkins/plugin/cli/new'
require 'jenkins/plugin/cli/generate'
+# Until a new version (>= 0.14.6 & 0.15.0rc2) is released, this backports a fix
+# for JRuby argument handling:
+# https://github.com/wycats/thor/commit/33490a59ed297eb798381f1c86cbaa3608413eaf
+class Thor
+ class Task
+ def sans_backtrace(backtrace, caller) #:nodoc:
+ saned = backtrace.reject { |frame| frame =~ FILE_REGEXP || (frame =~ /\.java:/ && RUBY_PLATFORM =~ /java/) }
+ saned -= caller
+ end
+ end
+end
+
module Jenkins
class Plugin
@@ -63,4 +75,4 @@ def spec
end
end
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.