From af74b1c00a66c327da54cb00fe772fb3e79f3102 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Thu, 7 Jul 2011 14:24:23 +0200 Subject: [PATCH] Syntax updates for ruby 1.9 compatibility Patch supplied by Stefan Ritter . --- pws | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pws b/pws index 4bf3682..b81da23 100755 --- a/pws +++ b/pws @@ -665,8 +665,8 @@ class Ed def initialize() ARGV.options do |opts| opts.on_tail("-h", "--help" , "Display this help screen") { help(opts) } - opts.on_tail("-n", "--new" , "Edit new file") { |@new| } - opts.on_tail("-f", "--force" , "Spawn an editor even if the file is probably not readable") { |@force| } + opts.on_tail("-n", "--new" , "Edit new file") { |new| @new=new } + opts.on_tail("-f", "--force" , "Spawn an editor even if the file is probably not readable") { |force| @force=force } opts.parse! end help(ARGV.options, 1, STDERR) if ARGV.length != 1 @@ -757,13 +757,13 @@ end def parse_command case ARGV.shift - when 'ls': Ls.new - when 'ed': Ed.new - when 'update-keyring': KeyringUpdater.new - when 'help': + when 'ls' then Ls.new + when 'ed' then Ed.new + when 'update-keyring' then KeyringUpdater.new + when 'help' then case ARGV.length - when 0: help - when 1: + when 0 then help + when 1 then ARGV.push "--help" parse_command else help(1, STDERR) -- 2.39.5