You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-ruby/rexical/files/rexical-1.0.4-ruby187.patch

38 lines
1.2 KiB

From 0def37146dce8b2795443b04237e4e345dbaf59c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Diego=20Elio=20'Flameeyes'=20Petten=C3=B2?= <flameeyes@gmail.com>
Date: Fri, 15 Jan 2010 14:54:45 +0100
Subject: [PATCH] Make rexcmd.rb compatible with both MRI 1.8.7 and 1.9.
As it was, rex only worked fine with JRuby 1.4.0 on Gentoo, and not with
either MRI implementation. With this change, OPTIONS (which is a string) is
used properly and works with all three implementations.
---
lib/rexical/rexcmd.rb | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/rexical/rexcmd.rb b/lib/rexical/rexcmd.rb
index 844bbf6..30b3300 100644
--- a/lib/rexical/rexcmd.rb
+++ b/lib/rexical/rexcmd.rb
@@ -63,7 +63,7 @@ EOT
def initialize
@status = 2
@cmd = File.basename($0, ".rb")
- tmp = OPTIONS.collect do |line|
+ tmp = OPTIONS.lines.collect do |line|
next if /\A\s*\z/ === line
disp, sopt, lopt, takearg, doc = line.strip.split(/\s+/, 5)
a = []
@@ -109,7 +109,7 @@ Usage: #{@cmd} [options] <grammar file>
Options:
EOT
- OPTIONS.each do |line|
+ OPTIONS.each_line do |line|
next if line.strip.empty?
if /\A\s*\z/ === line
f.puts
--
1.6.6