Skip to content
This repository
Browse code

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

Backport JRuby fix to Thor.
  • Loading branch information...
commit 25a26c39a0e7056239c121d9405f9c97d0c3c6f5 2 parents 31966e9 + baf6d55
Charles Lowell cowboyd authored
13 ruby-tools/cli/lib/jenkins/cli.rb
@@ -4,6 +4,19 @@
4 4 require 'jenkins/cli/formatting'
5 5 require 'jenkins/remote'
6 6
  7 +# Until a new version (>= 0.14.6 & 0.15.0rc2) is released, this backports a fix
  8 +# for JRuby argument handling:
  9 +# https://github.com/wycats/thor/commit/33490a59ed297eb798381f1c86cbaa3608413eaf
  10 +class Thor
  11 + class Task
  12 + def sans_backtrace(backtrace, caller) #:nodoc:
  13 + saned = backtrace.reject { |frame| frame =~ FILE_REGEXP || (frame =~ /\.java:/ && RUBY_PLATFORM =~ /java/) }
  14 + saned -= caller
  15 + end
  16 + end
  17 +end
  18 +
  19 +
7 20 module Jenkins
8 21 class CLI < Thor
9 22 include CLI::Formatting
14 ruby-tools/jpi/lib/jenkins/plugin/cli.rb
@@ -5,6 +5,18 @@
5 5 require 'jenkins/plugin/cli/new'
6 6 require 'jenkins/plugin/cli/generate'
7 7
  8 +# Until a new version (>= 0.14.6 & 0.15.0rc2) is released, this backports a fix
  9 +# for JRuby argument handling:
  10 +# https://github.com/wycats/thor/commit/33490a59ed297eb798381f1c86cbaa3608413eaf
  11 +class Thor
  12 + class Task
  13 + def sans_backtrace(backtrace, caller) #:nodoc:
  14 + saned = backtrace.reject { |frame| frame =~ FILE_REGEXP || (frame =~ /\.java:/ && RUBY_PLATFORM =~ /java/) }
  15 + saned -= caller
  16 + end
  17 + end
  18 +end
  19 +
8 20
9 21 module Jenkins
10 22 class Plugin
@@ -63,4 +75,4 @@ def spec
63 75
64 76 end
65 77 end
66   -end
  78 +end

0 comments on commit 25a26c3

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