Skip to content

Commit

Permalink
* lib: remove trailing spaces.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed May 18, 2011
1 parent 48553e9 commit 7dd49ed
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 54 deletions.
2 changes: 1 addition & 1 deletion lib/README
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ irb.rb interactive ruby
logger.rb simple logging utility
mathn.rb extended math operation (obsolete)
matrix.rb matrix calculation library
minitest/unit minimal drop-in replacement for test-unit
minitest/unit minimal drop-in replacement for test-unit
mkmf.rb Makefile maker
monitor.rb exclusive region monitor for thread
mutex_m.rb mutex mixin
Expand Down
4 changes: 2 additions & 2 deletions lib/benchmark.rb
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def realtime(&blk) # :yield:
# A Job is a sequence of labelled blocks to be processed by the
# Benchmark.bmbm method. It is of little direct interest to the user.
#
class Job
class Job
#
# Returns an initialized Job instance.
# Usually, one doesn't call this method directly, as new
Expand Down Expand Up @@ -380,7 +380,7 @@ class Tms

# Default caption, see also Benchmark::CAPTION
CAPTION = " user system total real\n"

# Default format string, see also Benchmark::FORMAT
FORMAT = "%10.6u %10.6y %10.6t %10.6r\n"

Expand Down
12 changes: 6 additions & 6 deletions lib/irb/lc/help-message
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# -*- coding: US-ASCII -*-
#
# irb/lc/help-message.rb -
# irb/lc/help-message.rb -
# $Release Version: 0.9.6$
# $Revision$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
#
#
#
Usage: irb.rb [options] [programfile] [arguments]
-f Suppress read of ~/.irbrc
-f Suppress read of ~/.irbrc
-m Bc mode (load mathn, fraction or matrix are available)
-d Set $DEBUG to true (same as `ruby -d')
-r load-module Same as `ruby -r'
Expand All @@ -27,14 +27,14 @@ Usage: irb.rb [options] [programfile] [arguments]
--prompt-mode prompt-mode
Switch prompt mode. Pre-defined prompt modes are
`default', `simple', `xmp' and `inf-ruby'
--inf-ruby-mode Use prompt appropriate for inf-ruby-mode on emacs.
Suppresses --readline.
--inf-ruby-mode Use prompt appropriate for inf-ruby-mode on emacs.
Suppresses --readline.
--simple-prompt Simple prompt mode
--noprompt No prompt mode
--tracer Display trace for each execution of commands.
--back-trace-limit n
Display backtrace top n and tail n. The default
value is 16.
value is 16.
--irb_debug n Set internal debug level to n (not for popular use)
-v, --version Print the version of irb
# vim:fileencoding=us-ascii
12 changes: 6 additions & 6 deletions lib/irb/lc/ja/help-message
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-
# irb/lc/ja/help-message.rb -
# irb/lc/ja/help-message.rb -
# $Release Version: 0.9.6$
# $Revision$
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
#
#
#
Usage: irb.rb [options] [programfile] [arguments]
-f ~/.irbrc を読み込まない.
Expand All @@ -18,22 +18,22 @@ Usage: irb.rb [options] [programfile] [arguments]
-E enc ruby -E と同じ.
-w ruby -w と同じ.
-W[level=2] ruby -W と同じ.
--inspect 結果出力にinspectを用いる(bcモード以外はデフォルト).
--inspect 結果出力にinspectを用いる(bcモード以外はデフォルト).
--noinspect 結果出力にinspectを用いない.
--readline readlineライブラリを利用する.
--noreadline readlineライブラリを利用しない.
--noreadline readlineライブラリを利用しない.
--prompt prompt-mode/--prompt-mode prompt-mode
プロンプトモードを切替えます. 現在定義されているプ
ロンプトモードは, default, simple, xmp, inf-rubyが
用意されています.
用意されています.
--inf-ruby-mode emacsのinf-ruby-mode用のプロンプト表示を行なう. 特
に指定がない限り, readlineライブラリは使わなくなる.
--simple-prompt 非常にシンプルなプロンプトを用いるモードです.
--noprompt プロンプト表示を行なわない.
--tracer コマンド実行時にトレースを行なう.
--back-trace-limit n
バックトレース表示をバックトレースの頭から n, 後ろ
からnだけ行なう. デフォルトは16
からnだけ行なう. デフォルトは16
--irb_debug n irbのデバッグデバッグレベルをnに設定する(利用しな
い方が無難でしょう).
-v, --version irbのバージョンを表示する
Expand Down
4 changes: 2 additions & 2 deletions lib/logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
# 4. With severity.
#
# logger.add(Logger::FATAL) { 'Fatal error!' }
#
#
# The block form allows you to create potentially complex log messages,
# but to delay their evaluation until and unless the message is
# logged. For example, if we have the following:
Expand Down Expand Up @@ -209,7 +209,7 @@ class Error < RuntimeError # :nodoc:
end
# not used after 1.2.7. just for compat.
class ShiftingError < Error # :nodoc:
end
end

# Logging severity.
module Severity
Expand Down
28 changes: 14 additions & 14 deletions lib/singleton.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
# This ensures that only one instance of Klass can be created.
#
# a,b = Klass.instance, Klass.instance
#
# a == b
#
# a == b
# # => true
#
# Klass.new
# Klass.new
# # => NoMethodError - new is private ...
#
# The instance is created at upon the first call of Klass.instance().
Expand All @@ -28,11 +28,11 @@
# # ...
# end
#
# ObjectSpace.each_object(OtherKlass){}
# ObjectSpace.each_object(OtherKlass){}
# # => 0
#
# OtherKlass.instance
# ObjectSpace.each_object(OtherKlass){}
# ObjectSpace.each_object(OtherKlass){}
# # => 1
#
#
Expand All @@ -52,40 +52,40 @@
#
# * Overriding Klass._load(str) to call Klass.instance().
#
# * Overriding Klass#clone and Klass#dup to raise TypeErrors to prevent
# * Overriding Klass#clone and Klass#dup to raise TypeErrors to prevent
# cloning or duping.
#
# == Singleton and Marshal
#
# By default Singleton's #_dump(depth) returns the empty string. Marshalling by
# default will strip state information, e.g. instance variables and taint
# state, from the instance. Classes using Singleton can provide custom
# _load(str) and _dump(depth) methods to retain some of the previous state of
# default will strip state information, e.g. instance variables and taint
# state, from the instance. Classes using Singleton can provide custom
# _load(str) and _dump(depth) methods to retain some of the previous state of
# the instance.
#
# require 'singleton'
#
#
# class Example
# include Singleton
# attr_accessor :keep, :strip
# def _dump(depth)
# # this strips the @strip information from the instance
# Marshal.dump(@keep, depth)
# end
#
#
# def self._load(str)
# instance.keep = Marshal.load(str)
# instance
# end
# end
#
#
# a = Example.instance
# a.keep = "keep this"
# a.strip = "get rid of this"
# a.taint
#
#
# stored_state = Marshal.dump(a)
#
#
# a.keep = nil
# a.strip = nil
# b = Marshal.load(stored_state)
Expand Down
46 changes: 23 additions & 23 deletions lib/xmlrpc/README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ use the client and implement a server.
* REXML (REXMLStreamParser)
* xml-scan (XMLScanStreamParser)
* Fastest parser is Expat's XMLStreamParser!

* General
* possible to choose between XMLParser module (Expat wrapper) and REXML/NQXML (pure Ruby) parsers
* Marshalling Ruby objects to Hashs and reconstruct them later from a Hash
Expand All @@ -70,7 +70,7 @@ use the client and implement a server.
=== Client

require "xmlrpc/client"

# Make an object to represent the XML-RPC server.
server = XMLRPC::Client.new( "xmlrpc-c.sourceforge.net", "/api/sample.php")

Expand All @@ -86,7 +86,7 @@ use the client and implement a server.

There are two possible ways, of handling a fault-structure:

==== by catching a XMLRPC::FaultException exception
==== by catching a XMLRPC::FaultException exception

require "xmlrpc/client"

Expand All @@ -107,7 +107,7 @@ There are two possible ways, of handling a fault-structure:
puts e.faultCode
puts e.faultString
end

==== by calling "call2" which returns a boolean

require "xmlrpc/client"
Expand All @@ -128,7 +128,7 @@ There are two possible ways, of handling a fault-structure:
puts result.faultCode
puts result.faultString
end

=== Client using Proxy

You can create a +Proxy+ object onto which you can call methods. This way it
Expand All @@ -137,7 +137,7 @@ looks nicer. Both forms, _call_ and _call2_ are supported through _proxy_ and
given to each XML-RPC call using that Proxy.

require "xmlrpc/client"

# Make an object to represent the XML-RPC server.
server = XMLRPC::Client.new( "xmlrpc-c.sourceforge.net", "/api/sample.php")

Expand Down Expand Up @@ -167,7 +167,7 @@ can be mixed:
s.add_handler("sample.sumAndDifference") do |a,b|
{ "sum" => a + b, "difference" => a - b }
end

s.serve

==== Java-like (handler classes)
Expand All @@ -181,8 +181,8 @@ can be mixed:
{ "sum" => a + b, "difference" => a - b }
end
end
# NOTE: Security Hole (read below)!!!

# NOTE: Security Hole (read below)!!!
s.add_handler("sample", MyHandler.new)
s.serve

Expand All @@ -195,17 +195,17 @@ To return a fault-structure you have to raise an FaultException e.g.:

From Brian Candler:

Above code sample has an extremely nasty security hole, in that you can now call
any method of 'MyHandler' remotely, including methods inherited from Object
and Kernel! For example, in the client code, you can use
puts server.call("sample.send","`","ls")
(backtick being the method name for running system processes). Needless to
say, 'ls' can be replaced with something else.

The version which binds proc objects (or the version presented below in the next section)
doesn't have this problem, but people may be tempted to use the second version because it's
Above code sample has an extremely nasty security hole, in that you can now call
any method of 'MyHandler' remotely, including methods inherited from Object
and Kernel! For example, in the client code, you can use

puts server.call("sample.send","`","ls")

(backtick being the method name for running system processes). Needless to
say, 'ls' can be replaced with something else.

The version which binds proc objects (or the version presented below in the next section)
doesn't have this problem, but people may be tempted to use the second version because it's
so nice and 'Rubyesque'. I think it needs a big red disclaimer.


Expand All @@ -225,7 +225,7 @@ A solution is to undef insecure methods or to use (({XMLRPC::iPIMethods})) as sh

# ...

This adds only public instance methods explicitly declared in class MyHandler
This adds only public instance methods explicitly declared in class MyHandler
(and not those inherited from any other class).

==== With interface declarations
Expand Down Expand Up @@ -271,7 +271,7 @@ XML parser, then you have to call the <i>set_parser</i> method of
<tt>XMLRPC::BasicServer</tt> or by editing xmlrpc/config.rb.

Client Example:

# ...
server = XMLRPC::Client.new( "xmlrpc-c.sourceforge.net", "/api/sample.php")
server.set_parser(XMLRPC::XMLParser::XMLParser.new)
Expand All @@ -283,7 +283,7 @@ Server Example:
s = XMLRPC::CGIServer.new
s.set_parser(XMLRPC::XMLParser::XMLStreamParser.new)
# ...

or:

# ...
Expand Down

0 comments on commit 7dd49ed

Please sign in to comment.