summaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
Diffstat (limited to 'sample')
-rw-r--r--sample/biorhythm.rb10
-rw-r--r--sample/drb/darray.rb2
-rw-r--r--sample/drb/darrayc.rb4
-rw-r--r--sample/drb/dbiff.rb4
-rw-r--r--sample/drb/dchatc.rb4
-rw-r--r--sample/drb/dchats.rb2
-rw-r--r--sample/drb/dhasen.rb4
-rw-r--r--sample/drb/dhasenc.rb2
-rw-r--r--sample/drb/dlogc.rb2
-rw-r--r--sample/drb/dlogd.rb2
-rw-r--r--sample/drb/dqin.rb2
-rw-r--r--sample/drb/dqout.rb2
-rw-r--r--sample/drb/dqueue.rb2
-rw-r--r--sample/drb/drbc.rb2
-rw-r--r--sample/drb/drbch.rb2
-rw-r--r--sample/drb/drbm.rb6
-rw-r--r--sample/drb/drbmc.rb2
-rw-r--r--sample/drb/drbs-acl.rb6
-rw-r--r--sample/drb/drbs.rb4
-rw-r--r--sample/drb/extserv_test.rb12
-rw-r--r--sample/drb/holderc.rb2
-rw-r--r--sample/drb/holders.rb6
-rw-r--r--sample/drb/http0.rb6
-rw-r--r--sample/drb/http0serv.rb12
-rw-r--r--sample/drb/name.rb16
-rw-r--r--sample/drb/namec.rb2
-rw-r--r--sample/drb/old_tuplespace.rb6
-rw-r--r--sample/drb/ring_echo.rb2
-rw-r--r--sample/drb/simpletuple.rb6
-rw-r--r--sample/drb/speedc.rb2
-rw-r--r--sample/drb/speeds.rb4
-rw-r--r--sample/from.rb2
-rw-r--r--sample/fullpath.rb2
-rw-r--r--sample/list2.rb2
-rw-r--r--sample/list3.rb2
-rw-r--r--sample/openssl/certstore.rb2
-rw-r--r--sample/openssl/smime_write.rb2
-rwxr-xr-xsample/rss/re_read.rb4
-rw-r--r--sample/svr.rb2
-rw-r--r--sample/test.rb22
-rw-r--r--sample/trojan.rb2
41 files changed, 91 insertions, 91 deletions
diff --git a/sample/biorhythm.rb b/sample/biorhythm.rb
index 7a8da7d..bd7c39f 100644
--- a/sample/biorhythm.rb
+++ b/sample/biorhythm.rb
@@ -1,13 +1,13 @@
#!/usr/local/bin/ruby
#
-# biorhythm.rb -
+# biorhythm.rb -
# $Release Version: $
# $Revision$
# by Yasuo OHBA(STAFS Development Room)
#
# --
#
-#
+#
#
# probably based on:
@@ -91,7 +91,7 @@ display_period = options[:days]
if ausgabeart == "v"
print_header(bd.year, bd.month, bd.day, dd - bd, bd.strftime("%a"))
print "\n"
-
+
phys, emot, geist = get_position(dd - bd)
printf "Biorhythm: %04d.%02d.%02d\n", dd.year, dd.month, dd.day
printf "Physical: %d%%\n", phys
@@ -104,10 +104,10 @@ else
print " -------------------------+-------------------------\n"
print " Bad Condition | Good Condition\n"
print " -------------------------+-------------------------\n"
-
+
(dd - bd).step(dd - bd + display_period) do |z|
phys, emot, geist = get_position(z)
-
+
printf "%04d.%02d.%02d : ", dd.year, dd.month, dd.day
p = (phys / 2.0 + 0.5).to_i
e = (emot / 2.0 + 0.5).to_i
diff --git a/sample/drb/darray.rb b/sample/drb/darray.rb
index 95ee01f..d2ac395 100644
--- a/sample/drb/darray.rb
+++ b/sample/drb/darray.rb
@@ -1,6 +1,6 @@
=begin
distributed Ruby --- Array
- Copyright (c) 1999-2001 Masatoshi SEKI
+ Copyright (c) 1999-2001 Masatoshi SEKI
=end
require 'drb/drb'
diff --git a/sample/drb/darrayc.rb b/sample/drb/darrayc.rb
index b181d22..579e115 100644
--- a/sample/drb/darrayc.rb
+++ b/sample/drb/darrayc.rb
@@ -1,6 +1,6 @@
=begin
distributed Ruby --- Array client
- Copyright (c) 1999-2001 Masatoshi SEKI
+ Copyright (c) 1999-2001 Masatoshi SEKI
=end
require 'drb/drb'
@@ -19,7 +19,7 @@ p a
puts "# find"
p ro.find { |x| x.kind_of? String }
-
+
puts "# each, break"
ro.each do |x|
next if x == "five"
diff --git a/sample/drb/dbiff.rb b/sample/drb/dbiff.rb
index 8faef50..b50edc0 100644
--- a/sample/drb/dbiff.rb
+++ b/sample/drb/dbiff.rb
@@ -18,13 +18,13 @@ class Biff
def run
last = Time.now
while true
- begin
+ begin
sleep(@interval)
current = File::mtime(@filename)
if current > last
changed
begin
- notify_observers(@filename, current)
+ notify_observers(@filename, current)
rescue Error
end
last = current
diff --git a/sample/drb/dchatc.rb b/sample/drb/dchatc.rb
index b506f5b..2b8ddbf 100644
--- a/sample/drb/dchatc.rb
+++ b/sample/drb/dchatc.rb
@@ -1,12 +1,12 @@
=begin
distributed Ruby --- chat client
- Copyright (c) 1999-2000 Masatoshi SEKI
+ Copyright (c) 1999-2000 Masatoshi SEKI
=end
require 'drb/drb'
class ChatClient
- include DRbUndumped
+ include DRbUndumped
def initialize(name)
@name = name
diff --git a/sample/drb/dchats.rb b/sample/drb/dchats.rb
index 012dfee..ccb2c7c 100644
--- a/sample/drb/dchats.rb
+++ b/sample/drb/dchats.rb
@@ -1,6 +1,6 @@
=begin
distributed Ruby --- chat server
- Copyright (c) 1999-2000 Masatoshi SEKI
+ Copyright (c) 1999-2000 Masatoshi SEKI
=end
require 'thread'
require 'drb/drb'
diff --git a/sample/drb/dhasen.rb b/sample/drb/dhasen.rb
index fb1724a..651b9c6 100644
--- a/sample/drb/dhasen.rb
+++ b/sample/drb/dhasen.rb
@@ -1,13 +1,13 @@
=begin
distributed Ruby --- dRuby Sample Server --- chasen server
- Copyright (c) 1999-2001 Masatoshi SEKI
+ Copyright (c) 1999-2001 Masatoshi SEKI
=end
=begin
How to play.
Terminal 1
- | % ruby dhasen.rb
+ | % ruby dhasen.rb
| druby://yourhost:7640
Terminal 2
diff --git a/sample/drb/dhasenc.rb b/sample/drb/dhasenc.rb
index 2774feb..44e58ce 100644
--- a/sample/drb/dhasenc.rb
+++ b/sample/drb/dhasenc.rb
@@ -1,7 +1,7 @@
# -*- encoding: euc-jp -*-
=begin
distributed Ruby --- dRuby Sample Client -- chasen client
- Copyright (c) 1999-2001 Masatoshi SEKI
+ Copyright (c) 1999-2001 Masatoshi SEKI
=end
require 'drb/drb'
diff --git a/sample/drb/dlogc.rb b/sample/drb/dlogc.rb
index c75bc7b..3939a71 100644
--- a/sample/drb/dlogc.rb
+++ b/sample/drb/dlogc.rb
@@ -1,6 +1,6 @@
=begin
distributed Ruby --- Log test
- Copyright (c) 1999-2001 Masatoshi SEKI
+ Copyright (c) 1999-2001 Masatoshi SEKI
=end
require 'drb/drb'
diff --git a/sample/drb/dlogd.rb b/sample/drb/dlogd.rb
index 9f9aa2f..fef7ca0 100644
--- a/sample/drb/dlogd.rb
+++ b/sample/drb/dlogd.rb
@@ -1,6 +1,6 @@
=begin
distributed Ruby --- Log server
- Copyright (c) 1999-2000 Masatoshi SEKI
+ Copyright (c) 1999-2000 Masatoshi SEKI
=end
require 'drb/drb'
diff --git a/sample/drb/dqin.rb b/sample/drb/dqin.rb
index 3ba1caa..4751335 100644
--- a/sample/drb/dqin.rb
+++ b/sample/drb/dqin.rb
@@ -1,6 +1,6 @@
=begin
distributed Ruby --- store
- Copyright (c) 1999-2000 Masatoshi SEKI
+ Copyright (c) 1999-2000 Masatoshi SEKI
=end
require 'drb/drb'
diff --git a/sample/drb/dqout.rb b/sample/drb/dqout.rb
index 4700e55..f2b0b4a 100644
--- a/sample/drb/dqout.rb
+++ b/sample/drb/dqout.rb
@@ -1,6 +1,6 @@
=begin
distributed Ruby --- fetch
- Copyright (c) 1999-2000 Masatoshi SEKI
+ Copyright (c) 1999-2000 Masatoshi SEKI
=end
require 'drb/drb'
diff --git a/sample/drb/dqueue.rb b/sample/drb/dqueue.rb
index a5a4365..1c8878c 100644
--- a/sample/drb/dqueue.rb
+++ b/sample/drb/dqueue.rb
@@ -1,6 +1,6 @@
=begin
distributed Ruby --- Queue
- Copyright (c) 1999-2000 Masatoshi SEKI
+ Copyright (c) 1999-2000 Masatoshi SEKI
=end
require 'thread'
diff --git a/sample/drb/drbc.rb b/sample/drb/drbc.rb
index 00132b4..50a86c3 100644
--- a/sample/drb/drbc.rb
+++ b/sample/drb/drbc.rb
@@ -1,6 +1,6 @@
=begin
distributed Ruby --- dRuby Sample Client
- Copyright (c) 1999-2000 Masatoshi SEKI
+ Copyright (c) 1999-2000 Masatoshi SEKI
=end
require 'drb/drb'
diff --git a/sample/drb/drbch.rb b/sample/drb/drbch.rb
index 495ff1c..07fdcd5 100644
--- a/sample/drb/drbch.rb
+++ b/sample/drb/drbch.rb
@@ -1,6 +1,6 @@
=begin
distributed Ruby --- dRuby Sample Client
- Copyright (c) 1999-2000 Masatoshi SEKI
+ Copyright (c) 1999-2000 Masatoshi SEKI
=end
require 'drb/drb'
diff --git a/sample/drb/drbm.rb b/sample/drb/drbm.rb
index 74a15a4..3390608 100644
--- a/sample/drb/drbm.rb
+++ b/sample/drb/drbm.rb
@@ -1,13 +1,13 @@
=begin
multiple DRbServer
- Copyright (c) 1999-2002 Masatoshi SEKI
+ Copyright (c) 1999-2002 Masatoshi SEKI
=end
=begin
How to play.
Terminal 1
- | % ruby drbm.rb
+ | % ruby drbm.rb
| druby://yourhost:7640 druby://yourhost:7641
Terminal 2
@@ -24,7 +24,7 @@ class Hoge
def initialize(s)
@str = s
end
-
+
def to_s
@str
end
diff --git a/sample/drb/drbmc.rb b/sample/drb/drbmc.rb
index c654fce..fd19140 100644
--- a/sample/drb/drbmc.rb
+++ b/sample/drb/drbmc.rb
@@ -1,6 +1,6 @@
=begin
multiple DRbServer client
- Copyright (c) 1999-2002 Masatoshi SEKI
+ Copyright (c) 1999-2002 Masatoshi SEKI
=end
require 'drb/drb'
diff --git a/sample/drb/drbs-acl.rb b/sample/drb/drbs-acl.rb
index 151dd94..71c4f7b 100644
--- a/sample/drb/drbs-acl.rb
+++ b/sample/drb/drbs-acl.rb
@@ -1,13 +1,13 @@
=begin
distributed Ruby --- dRuby Sample Server
- Copyright (c) 1999-2000 Masatoshi SEKI
+ Copyright (c) 1999-2000 Masatoshi SEKI
=end
=begin
How to play.
Terminal 1
- | % ruby drbs.rb
+ | % ruby drbs.rb
| druby://yourhost:7640
Terminal 2
@@ -41,7 +41,7 @@ if __FILE__ == $0
acl = ACL.new(%w(deny all
allow 192.168.1.*
allow localhost))
-
+
DRb.install_acl(acl)
DRb.start_service(nil, DRbEx.new)
diff --git a/sample/drb/drbs.rb b/sample/drb/drbs.rb
index b76e283..5a913d9 100644
--- a/sample/drb/drbs.rb
+++ b/sample/drb/drbs.rb
@@ -1,13 +1,13 @@
=begin
distributed Ruby --- dRuby Sample Server
- Copyright (c) 1999-2000,2002 Masatoshi SEKI
+ Copyright (c) 1999-2000,2002 Masatoshi SEKI
=end
=begin
How to play.
Terminal 1
- | % ruby drbs.rb
+ | % ruby drbs.rb
| druby://yourhost:7640
Terminal 2
diff --git a/sample/drb/extserv_test.rb b/sample/drb/extserv_test.rb
index 83d871a..2c4f485 100644
--- a/sample/drb/extserv_test.rb
+++ b/sample/drb/extserv_test.rb
@@ -1,11 +1,11 @@
=begin
dRuby sample
- Copyright (c) 2000 Masatoshi SEKI
+ Copyright (c) 2000 Masatoshi SEKI
= How to play
* Terminal 1
-
+
% ruby -I. extserv_test.rb server
druby://yourhost:12345
@@ -26,11 +26,11 @@ end
class Foo
include DRbUndumped
-
+
def initialize(str)
@str = str
end
-
+
def hello(it)
"#{it}: #{self}"
end
@@ -55,7 +55,7 @@ when 'server'
DRb::ExtServManager.command['itest1'] = "ruby -I. #{$0} itest1"
DRb::ExtServManager.command['itest2'] = "ruby -I. #{$0} itest2"
-
+
s = DRb::ExtServManager.new
DRb.start_service(ARGV.shift, s)
puts DRb.uri
@@ -72,7 +72,7 @@ else
t2 = s.service('itest2').front
puts t2
puts t1.hello(t2)
- if (cmd == 'quit')
+ if (cmd == 'quit')
s.service('itest1').stop_service
s.service('itest2').stop_service
end
diff --git a/sample/drb/holderc.rb b/sample/drb/holderc.rb
index 8dd72eb..e627916 100644
--- a/sample/drb/holderc.rb
+++ b/sample/drb/holderc.rb
@@ -11,7 +11,7 @@ DRb.start_service()
ro = DRbObject.new(nil, there)
ary = []
-10.times do
+10.times do
ary.push(ro.gen)
end
diff --git a/sample/drb/holders.rb b/sample/drb/holders.rb
index 2d9974f..293426f 100644
--- a/sample/drb/holders.rb
+++ b/sample/drb/holders.rb
@@ -14,7 +14,7 @@
% ruby holderc.rb druby://yourhost:1234
=end
-
+
require 'drb/drb'
@@ -36,11 +36,11 @@ end
class DRbEx4
include DRbUndumped
-
+
def initialize
@curr = 1
end
-
+
def gen
begin
@curr += 1
diff --git a/sample/drb/http0.rb b/sample/drb/http0.rb
index 7649925..d4c9f6b 100644
--- a/sample/drb/http0.rb
+++ b/sample/drb/http0.rb
@@ -46,14 +46,14 @@ module DRb
def close; end
def alive?; false; end
-
+
def send_request(ref, msg_id, *arg, &b)
stream = StrStream.new
@msg.send_request(stream, ref, msg_id, *arg, &b)
@reply_stream = StrStream.new
post(@uri, stream.buf)
end
-
+
def recv_reply
@msg.recv_reply(@reply_stream)
end
@@ -66,7 +66,7 @@ module DRb
http.post(path, data, {'Content-Type'=>'application/octetstream;'}) do |str|
sio.write(str)
if @config[:load_limit] < sio.buf.size
- raise TypeError, 'too large packet'
+ raise TypeError, 'too large packet'
end
end
@reply_stream = sio
diff --git a/sample/drb/http0serv.rb b/sample/drb/http0serv.rb
index 100d126..8318123 100644
--- a/sample/drb/http0serv.rb
+++ b/sample/drb/http0serv.rb
@@ -5,7 +5,7 @@ require 'thread'
module DRb
module HTTP0
-
+
def self.open_server(uri, config)
unless /^http:/ =~ uri
raise(DRbBadScheme, uri) unless uri =~ /^http:/
@@ -20,7 +20,7 @@ module DRb
@drb = drb
@queue = Queue.new
end
-
+
def do_POST(req, res)
@req = req
@res = res
@@ -28,7 +28,7 @@ module DRb
@res.body = @queue.pop
@res['content-type'] = 'application/octet-stream;'
end
-
+
def req_body
@req.body
end
@@ -36,7 +36,7 @@ module DRb
def reply(body)
@queue.push(body)
end
-
+
def close
@queue.push('')
end
@@ -78,7 +78,7 @@ module DRb
s.start
end
end
-
+
class ServerSide
def initialize(callback, config)
@callback = callback
@@ -86,7 +86,7 @@ module DRb
@msg = DRbMessage.new(@config)
@req_stream = StrStream.new(@callback.req_body)
end
-
+
def close
@callback.close if @callback
@callback = nil
diff --git a/sample/drb/name.rb b/sample/drb/name.rb
index 86b478f..9527d47 100644
--- a/sample/drb/name.rb
+++ b/sample/drb/name.rb
@@ -1,12 +1,12 @@
=begin
distributed Ruby --- NamedObject Sample
- Copyright (c) 2000-2001 Masatoshi SEKI
+ Copyright (c) 2000-2001 Masatoshi SEKI
=end
=begin
How to play.
-* start server
+* start server
Terminal 1
| % ruby name.rb druby://yourhost:7640
| druby://yourhost:7640
@@ -28,9 +28,9 @@ How to play.
| druby://yourhost:7640
| [return] to exit
-* continue client
+* continue client
Terminal 2
- type [return]
+ type [return]
| 1
| 2
=end
@@ -44,7 +44,7 @@ module DRbNamedObject
def drb_name=(name)
@drb_name = name
- Thread.exclusive do
+ Thread.exclusive do
raise(IndexError, name) if DRbNAMEDICT[name]
DRbNAMEDICT[name] = self
end
@@ -62,7 +62,7 @@ class DRbNamedIdConv < DRb::DRbIdConv
def to_id(obj)
if obj.kind_of? DRbNamedObject
- return obj.drb_name
+ return obj.drb_name
else
return super
end
@@ -98,7 +98,7 @@ class Front
@name['seq'] = seq
@name['mutex'] = mutex
end
-
+
def [](k)
@name[k]
end
@@ -108,7 +108,7 @@ if __FILE__ == $0
uri = ARGV.shift
name_conv = DRbNamedIdConv.new
-
+
DRb.install_id_conv(name_conv)
DRb.start_service(uri, Front.new)
puts DRb.uri
diff --git a/sample/drb/namec.rb b/sample/drb/namec.rb
index f6db6f3..98b9d0e 100644
--- a/sample/drb/namec.rb
+++ b/sample/drb/namec.rb
@@ -1,6 +1,6 @@
=begin
distributed Ruby --- NamedObject Sample Client
- Copyright (c) 2000-2001 Masatoshi SEKI
+ Copyright (c) 2000-2001 Masatoshi SEKI
=end
require 'drb/drb'
diff --git a/sample/drb/old_tuplespace.rb b/sample/drb/old_tuplespace.rb
index 3e13b92..0da9fa8 100644
--- a/sample/drb/old_tuplespace.rb
+++ b/sample/drb/old_tuplespace.rb
@@ -82,7 +82,7 @@ class TupleSpace
end
end
return nil unless found
-
+
@que[sz].delete_at(i)
return x
@@ -167,7 +167,7 @@ if __FILE__ == $0
def client(ts, n)
Thread.start {
ac = Object.new
- tuples = (1..10).collect { |i|
+ tuples = (1..10).collect { |i|
['req', ac, i * 10 + n]
}
ts.out(*tuples)
@@ -201,7 +201,7 @@ if __FILE__ == $0
clients.push(client(ts, n))
end
- (1..3).each do
+ (1..3).each do
watcher(ts)
end
diff --git a/sample/drb/ring_echo.rb b/sample/drb/ring_echo.rb
index 0633aa8..3b743ca 100644
--- a/sample/drb/ring_echo.rb
+++ b/sample/drb/ring_echo.rb
@@ -8,7 +8,7 @@ class RingEcho
def initialize(name)
@name = name
end
-
+
def echo(str)
"#{@name}: #{str}"
end
diff --git a/sample/drb/simpletuple.rb b/sample/drb/simpletuple.rb
index 3ae9208..1b9b7a3 100644
--- a/sample/drb/simpletuple.rb
+++ b/sample/drb/simpletuple.rb
@@ -13,7 +13,7 @@ class SimpleTupleSpace
@waiting.taint
self.taint
end
-
+
def out(key, obj)
Thread.critical = true
@hash[key] ||= []
@@ -48,7 +48,7 @@ class SimpleTupleSpace
Thread.critical = false
end
end
-end
+end
if __FILE__ == $0
ts = SimpleTupleSpace.new
@@ -75,7 +75,7 @@ if __FILE__ == $0
}
end
- 3.times do
+ 3.times do
servers.push(server(ts))
end
diff --git a/sample/drb/speedc.rb b/sample/drb/speedc.rb
index 14d526d..64b8a65 100644
--- a/sample/drb/speedc.rb
+++ b/sample/drb/speedc.rb
@@ -11,7 +11,7 @@ when /^tcpromp:/, /^unixromp:/
foo = client.resolve("foo")
when /^druby:/
require 'drb/drb'
-
+
DRb.start_service
foo = DRbObject.new(nil, uri)
end
diff --git a/sample/drb/speeds.rb b/sample/drb/speeds.rb
index 76b4b29..7984059 100644
--- a/sample/drb/speeds.rb
+++ b/sample/drb/speeds.rb
@@ -3,7 +3,7 @@ class Foo
def initialize
@i = 0
end
-
+
def foo(i)
@i = i
i + i
@@ -24,7 +24,7 @@ when /^tcpromp:/, /^unixromp:/
when /^druby:/
require 'drb/drb'
-
+
DRb.start_service(uri, Foo.new)
end
diff --git a/sample/from.rb b/sample/from.rb
index aa93e67..918745e 100644
--- a/sample/from.rb
+++ b/sample/from.rb
@@ -36,7 +36,7 @@ def get_mailfile(user)
file = user
unless user
file = ENV['MAIL']
- user = ENV['USER'] || ENV['USERNAME'] || ENV['LOGNAME']
+ user = ENV['USER'] || ENV['USERNAME'] || ENV['LOGNAME']
end
if file == nil or !File.exist?(file)
diff --git a/sample/fullpath.rb b/sample/fullpath.rb
index 8472e5d..112ca58 100644
--- a/sample/fullpath.rb
+++ b/sample/fullpath.rb
@@ -3,7 +3,7 @@
if ARGV[0] =~ /-p/
ARGV.shift
- path = ARGV.shift
+ path = ARGV.shift
end
if path == nil
diff --git a/sample/list2.rb b/sample/list2.rb
index 914cb89..1d71aff 100644
--- a/sample/list2.rb
+++ b/sample/list2.rb
@@ -9,7 +9,7 @@ class Point
sprintf("%d@%d", @x, @y)
end
end
-
+
list1 = [10, 20, Point.new(2, 3), Point.new(4, 5)]
list2 = [20, Point.new(4, 5), list1]
print("list1:\n", list1.join("\n"), "\n")
diff --git a/sample/list3.rb b/sample/list3.rb
index 1d756fd..1d9f04b 100644
--- a/sample/list3.rb
+++ b/sample/list3.rb
@@ -11,7 +11,7 @@ class Point
sprintf("%d@%d", @x, @y)
end
end
-
+
list1 = [10, 20, Point.new(2, 3), Point.new(4, 5)]
list2 = [20, Point.new(4, 5), list1]
print("list1: ", list1.inspect, "\n")
diff --git a/sample/openssl/certstore.rb b/sample/openssl/certstore.rb
index bbc637f..c0bc21b 100644
--- a/sample/openssl/certstore.rb
+++ b/sample/openssl/certstore.rb
@@ -48,7 +48,7 @@ class CertStore
case guess_cert_type(cert)
when CERT_TYPE_SELF_SIGNED
true
- when CERT_TYPE_OTHER
+ when CERT_TYPE_OTHER
true
else
false
diff --git a/sample/openssl/smime_write.rb b/sample/openssl/smime_write.rb
index 535b3d6..5a5236c 100644
--- a/sample/openssl/smime_write.rb
+++ b/sample/openssl/smime_write.rb
@@ -20,4 +20,4 @@ smime0 = PKCS7::write_smime(p7sig)
rcpt = X509::Certificate.new(File::read(rcpt_file))
p7enc = PKCS7::encrypt([rcpt], smime0)
-print PKCS7::write_smime(p7enc)
+print PKCS7::write_smime(p7enc)
diff --git a/sample/rss/re_read.rb b/sample/rss/re_read.rb
index ee54a18..c386ab2 100755
--- a/sample/rss/re_read.rb
+++ b/sample/rss/re_read.rb
@@ -24,7 +24,7 @@ ARGV.each do |fname|
File.open(fname) do |f|
source = f.read
end
-
+
rss = nil
read = false
begin
@@ -44,7 +44,7 @@ ARGV.each do |fname|
rescue RSS::Error
error($!) if verbose
end
-
+
if rss.nil?
puts "Invalid feed: #{fname}"
elsif !read
diff --git a/sample/svr.rb b/sample/svr.rb
index f4f29eb..eb49ccf 100644
--- a/sample/svr.rb
+++ b/sample/svr.rb
@@ -26,7 +26,7 @@ loop do
s.close
socks.delete(s)
# single thread gets may block whole service
- elsif str = s.gets
+ elsif str = s.gets
s.write(str)
end
end
diff --git a/sample/test.rb b/sample/test.rb
index 496856e..4e934f1 100644
--- a/sample/test.rb
+++ b/sample/test.rb
@@ -21,7 +21,7 @@ def test_ok(cond,n=1)
else
STDERR.print "F"
printf "not ok %s %d -- %s\n", $what, $testnum, where
- $failed+=1
+ $failed+=1
end
STDOUT.flush
STDERR.flush
@@ -657,7 +657,7 @@ $string = "this must be handled no.3"
begin
begin
raise "exception in rescue clause"
- rescue
+ rescue
raise $string
end
test_ok(false)
@@ -671,7 +671,7 @@ end
begin
begin
raise "this must be handled no.4"
- ensure
+ ensure
raise "exception in ensure clause"
end
test_ok(false)
@@ -741,7 +741,7 @@ test_ok($x[1,3] == [1, 2, 3])
$x[0, 2] = 10
test_ok($x[0] == 10 && $x[1] == 2)
-
+
$x[0, 0] = -1
test_ok($x[0] == -1 && $x[1] == 10)
@@ -817,7 +817,7 @@ $x = {1=>2, 2=>4, 3=>6}
test_ok($x[1] == 2)
-test_ok(begin
+test_ok(begin
for k,v in $x
raise if k*2 != v
end
@@ -1164,7 +1164,7 @@ def proc_return4
end
test_ok(proc_return4() == 42)
-def ljump_test(state, proc, *args)
+def ljump_test(state, proc, *args)
x = state
begin
proc.call(*args)
@@ -1362,7 +1362,7 @@ class ITER_TEST4 < ITER_TEST3
end
end
-ITER_TEST4.new.foo(44){55}
+ITER_TEST4.new.foo(44){55}
class ITER_TEST5
def tt(aa)
@@ -1628,8 +1628,8 @@ test_ok(-265419172580680477752431643787347.to_s(36) == "-justanotherrubyhacker")
a = []
(0..255).each {|n|
- ch = [n].pack("C")
- a.push ch if /a#{Regexp.quote ch}b/x =~ "ab"
+ ch = [n].pack("C")
+ a.push ch if /a#{Regexp.quote ch}b/x =~ "ab"
}
test_ok(a.size == 0)
@@ -1960,7 +1960,7 @@ end
test_ok(bar.test2 == "test2")
test_ok(bar.test == "test")
-test_ok(foo.test == "test")
+test_ok(foo.test == "test")
begin
foo.test2
@@ -2054,7 +2054,7 @@ class Gods
def self.ruler1 # <= per method definition style
@@rule
- end
+ end
class << self # <= multiple method definition style
def ruler2
@@rule
diff --git a/sample/trojan.rb b/sample/trojan.rb
index 3a35ac2..2be9567 100644
--- a/sample/trojan.rb
+++ b/sample/trojan.rb
@@ -5,7 +5,7 @@ path = ENV['PATH'].split(File::PATH_SEPARATOR)
for dir in path
if File.directory?(dir)
for f in d = Dir.open(dir)
- fpath = File.join(dir, f)
+ fpath = File.join(dir, f)
if File.file?(fpath) && (File.stat(fpath).mode & 022) != 0
printf("file %s is writable from other users\n", fpath)
end