種類
ライブラリ
- English (11)
- ビルトイン (1230)
- base64 (11)
- benchmark (33)
- bigdecimal (7)
-
cgi
/ core (374) -
cgi
/ html (517) -
cgi
/ session (11) -
cgi
/ util (11) - csv (198)
- date (11)
- dbm (22)
- drb (11)
-
drb
/ acl (11) - e2mmap (12)
- erb (11)
- etc (165)
- fiddle (11)
- forwardable (11)
- gdbm (11)
- getoptlong (33)
- ipaddr (11)
- irb (11)
-
irb
/ context (220) -
irb
/ ext / save-history (11) - json (418)
-
json
/ add / bigdecimal (11) -
json
/ add / complex (11) -
json
/ add / date (11) -
json
/ add / date _ time (11) -
json
/ add / exception (11) -
json
/ add / ostruct (11) -
json
/ add / range (11) -
json
/ add / rational (11) -
json
/ add / regexp (11) -
json
/ add / struct (11) -
json
/ add / symbol (11) -
json
/ add / time (11) - kconv (143)
- logger (12)
-
minitest
/ unit (5) - mkmf (77)
-
net
/ ftp (33) -
net
/ http (110) -
net
/ imap (187) -
net
/ pop (11) -
net
/ smtp (11) - nkf (22)
- objspace (11)
- open-uri (70)
- openssl (396)
- optparse (495)
- pathname (11)
- psych (121)
- rake (99)
-
rake
/ packagetask (11) -
rake
/ rdoctask (11) -
rake
/ testtask (11) - rbconfig (44)
- rdoc (22)
-
rdoc
/ context (66) -
rdoc
/ generator / json _ index (11) -
rdoc
/ generator / ri (11) -
rdoc
/ markup (11) - readline (44)
- rexml (11)
-
rexml
/ document (165) - ripper (11)
-
ripper
/ filter (11) -
ripper
/ lexer (11) - rubygems (33)
-
rubygems
/ command (33) -
rubygems
/ commands / unpack _ command (11) -
rubygems
/ config _ file (33) -
rubygems
/ platform (11) -
rubygems
/ security (11) -
rubygems
/ specification (407) -
rubygems
/ user _ interaction (55) -
rubygems
/ version (33) - socket (121)
- stringio (22)
- strscan (33)
- syslog (11)
-
syslog
/ logger (11) - time (22)
- uri (44)
-
webrick
/ accesslog (11) -
webrick
/ config (11) -
webrick
/ httpauth / authenticator (22) -
webrick
/ httprequest (11) -
webrick
/ httpresponse (110) -
webrick
/ httpstatus (11) -
webrick
/ httpversion (11) - win32ole (11)
-
yaml
/ dbm (11) - zlib (77)
クラス
- ACL (11)
-
ARGF
. class (33) - Addrinfo (11)
- Array (44)
- BasicSocket (33)
-
Benchmark
:: Tms (11) - BigDecimal (18)
- Binding (6)
- CGI (33)
-
CGI
:: Session (11) - CSV (154)
-
CSV
:: Table (22) - Class (11)
- Complex (11)
- DBM (22)
-
DRb
:: DRbRemoteError (11) - Date (11)
- DateTime (22)
- ERB (11)
-
Encoding
:: Converter (143) -
Encoding
:: InvalidByteSequenceError (22) -
Encoding
:: UndefinedConversionError (22) - Exception (73)
-
Fiddle
:: Function (11) - GDBM (11)
-
Gem
:: Command (33) -
Gem
:: Commands :: UnpackCommand (11) -
Gem
:: ConfigFile (33) -
Gem
:: Platform (11) -
Gem
:: Security :: Policy (11) -
Gem
:: Specification (407) -
Gem
:: StreamUI (44) -
Gem
:: Version (22) - GetoptLong (33)
- IO (55)
- IPAddr (11)
-
IRB
:: Context (220) -
JSON
:: Parser (11) -
JSON
:: State (110) - Logger (11)
-
Logger
:: Application (1) - Method (11)
-
MiniTest
:: Unit (3) - Module (132)
-
Net
:: FTP (33) -
Net
:: HTTP (11) -
Net
:: HTTPResponse (88) -
Net
:: IMAP (11) -
Net
:: IMAP :: BodyTypeBasic (22) -
Net
:: IMAP :: BodyTypeMessage (22) -
Net
:: IMAP :: BodyTypeText (22) -
Net
:: IMAP :: ContentDisposition (22) -
Net
:: IMAP :: ContinuationRequest (11) -
Net
:: IMAP :: ResponseCode (11) -
Net
:: IMAP :: ResponseText (11) -
Net
:: IMAP :: TaggedResponse (33) -
Net
:: IMAP :: UntaggedResponse (22) -
Net
:: POP3 (11) -
Net
:: SMTP (11) - Object (135)
-
OpenSSL
:: ASN1 :: ObjectId (11) -
OpenSSL
:: Config (99) -
OpenSSL
:: OCSP :: Response (33) -
OpenSSL
:: SSL :: SSLContext (44) -
OpenSSL
:: SSL :: Session (44) -
OpenSSL
:: X509 :: Extension (55) -
OpenSSL
:: X509 :: ExtensionFactory (33) -
OpenSSL
:: X509 :: StoreContext (33) - OpenStruct (11)
- OptionParser (385)
-
OptionParser
:: ParseError (66) - Pathname (11)
- Proc (11)
-
Psych
:: Nodes :: Node (22) -
Psych
:: SyntaxError (11) -
Psych
:: Visitors :: YAMLTree (11) -
RDoc
:: Context (22) -
RDoc
:: Context :: Section (44) -
RDoc
:: Generator :: JsonIndex (11) -
RDoc
:: Generator :: RI (11) -
RDoc
:: Markup (11) -
RDoc
:: Options (198) -
REXML
:: Declaration (11) -
REXML
:: Document (33) -
REXML
:: Element (11) -
REXML
:: Instruction (22) -
REXML
:: NotationDecl (44) -
REXML
:: ParseException (11) -
REXML
:: XMLDecl (44) -
Rake
:: Application (33) -
Rake
:: InvocationChain (11) -
Rake
:: InvocationChain :: EmptyInvocationChain (11) -
Rake
:: PackageTask (11) -
Rake
:: RDocTask (11) -
Rake
:: Task (11) -
Rake
:: TestTask (11) - Range (11)
- Rational (33)
- Regexp (44)
- Ripper (22)
- RubyVM (11)
-
RubyVM
:: InstructionSequence (128) - SignalException (11)
- Socket (22)
-
Socket
:: Option (33) - String (217)
- StringIO (22)
- StringScanner (33)
- Struct (11)
- Symbol (43)
-
Syslog
:: Logger (11) -
Thread
:: Backtrace :: Location (66) - Time (55)
- UDPSocket (11)
-
URI
:: Generic (11) -
URI
:: LDAP (11) - UnboundMethod (22)
-
WEBrick
:: HTTPRequest (11) -
WEBrick
:: HTTPResponse (110) -
WEBrick
:: HTTPVersion (11) - WIN32OLE (11)
-
YAML
:: DBM (11) -
Zlib
:: Deflate (22) -
Zlib
:: Inflate (11)
モジュール
- Base64 (11)
- Benchmark (22)
-
CGI
:: HtmlExtension (517) -
CGI
:: QueryExtension (352) - Etc (165)
- Exception2MessageMapper (12)
-
File
:: Constants (11) - Forwardable (11)
- Gem (33)
-
Gem
:: InstallUpdateOptions (11) -
Gem
:: UserInteraction (11) - IRB (11)
- JSON (110)
-
JSON
:: Generator :: GeneratorMethods :: Array (11) -
JSON
:: Generator :: GeneratorMethods :: FalseClass (11) -
JSON
:: Generator :: GeneratorMethods :: Float (11) -
JSON
:: Generator :: GeneratorMethods :: Hash (11) -
JSON
:: Generator :: GeneratorMethods :: Integer (11) -
JSON
:: Generator :: GeneratorMethods :: NilClass (11) -
JSON
:: Generator :: GeneratorMethods :: Object (11) -
JSON
:: Generator :: GeneratorMethods :: String (33) -
JSON
:: Generator :: GeneratorMethods :: String :: Extend (11) -
JSON
:: Generator :: GeneratorMethods :: TrueClass (11) - Kconv (132)
- Kernel (141)
-
MiniTest
:: Assertions (2) - NKF (22)
-
Net
:: HTTPHeader (11) - ObjectSpace (11)
- OpenSSL (33)
-
OpenSSL
:: Buffering (11) - OpenURI (11)
-
OpenURI
:: Meta (22) -
OpenURI
:: OpenRead (22) -
OptionParser
:: Arguable (44) - Psych (55)
- RDoc (22)
-
Rake
:: TaskManager (11) - RbConfig (44)
- Readline (44)
-
Socket
:: Constants (11) - Syslog (11)
- URI (29)
-
WEBrick
:: AccessLog (11) -
WEBrick
:: Config (11) -
WEBrick
:: HTTPAuth :: Authenticator (22) -
WEBrick
:: HTTPStatus (11) - Zlib (44)
キーワード
-
$ ERROR _ POSITION (11) -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - === (11)
-
BENCHMARK
_ VERSION (11) - CAPTION (22)
-
COMMON
_ LOG _ FORMAT (11) -
CONSTANT
_ MODIFIERS (11) - Context (11)
- Converter (11)
-
DEFAULT
_ CONFIG _ FILE (11) -
DEFAULT
_ VERSION (11) - DEPRECATED (11)
- DESCRIPTION (11)
- DESTDIR (11)
- Extend (22)
-
FORWARDABLE
_ VERSION (11) - Filter (11)
- Float (6)
- HeaderConverters (11)
-
IDNAME
_ IVARS (11) -
INSTRUCTION
_ NAMES (11) - Integer (6)
- LIBDIR (11)
-
LIBYAML
_ VERSION (11) -
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 4 . 0 (8) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) -
NEWS for Ruby 3
. 1 . 0 (3) -
NI
_ NUMERICSERV (11) -
NKF
_ VERSION (11) -
NOPRINTING
_ IVARS (11) -
NO
_ INSPECTING _ IVARS (11) - NULL (11)
-
OPENSSL
_ LIBRARY _ VERSION (11) -
OPENSSL
_ VERSION (11) -
RFC822
_ MONTHS (11) -
RSTRING
_ LEN (11) -
RUBY
_ DESCRIPTION (11) -
RUBY
_ ENGINE _ VERSION (9) -
RUBY
_ REVISION (5) -
RUBY
_ VERSION (11) - ResponseField (11)
- ResponseInfoField (11)
- Revision (22)
- RubyGemsPackageVersion (11)
- RubyGemsVersion (11)
- Rubyの起動 (11)
-
SC
_ 2 _ VERSION (11) -
SC
_ ASYNCHRONOUS _ IO (11) -
SC
_ CLOCK _ SELECTION (11) -
SC
_ JOB _ CONTROL (11) -
SC
_ MEMORY _ PROTECTION (11) -
SC
_ MONOTONIC _ CLOCK (11) -
SC
_ NPROCESSORS _ CONF (11) -
SC
_ NPROCESSORS _ ONLN (11) -
SC
_ SYNCHRONIZED _ IO (11) -
SC
_ THREAD _ DESTRUCTOR _ ITERATIONS (11) -
SC
_ THREAD _ SAFE _ FUNCTIONS (11) -
SC
_ VERSION (11) -
SC
_ XOPEN _ VERSION (11) -
SEARCH
_ INDEX _ FILE (11) - SPECIAL (11)
-
SYSTEM
_ WIDE _ CONFIG _ FILE (11) - TOPDIR (11)
- VERSION (173)
- Version (33)
-
ZLIB
_ VERSION (11) - [] (44)
-
_ _ inspect _ _ (11) -
_ _ to _ s _ _ (11) -
_ dump (11) - a (22)
-
absolute
_ path (22) - accept (11)
-
accept
_ charset (11) -
accept
_ encoding (11) -
accept
_ language (11) -
add
_ value (11) - alert (11)
-
alert
_ error (11) -
alert
_ warning (11) -
allocation
_ sourcefile (11) -
ap
_ name (11) -
ap
_ name= (11) - appname (1)
-
arg
_ config (11) -
array
_ nl (11) -
ascii
_ only? (11) -
asciicompat
_ encoding (22) - ask (22)
-
auth
_ type (11) - autoload (22)
- autoload? (22)
- autorequire (11)
- backtrace (11)
- base (11)
-
base
_ label (22) - bindir (11)
- binread (22)
- blockquote (22)
- body (22)
- byteindex (2)
-
ca
_ file (11) -
ca
_ path (11) -
cache
_ control (11) - canonname (11)
- capitalize (16)
- capitalize! (8)
- cgi (11)
- charset (11)
- checkbox (22)
-
checkbox
_ group (22) - ciphers (11)
- clone (33)
- code (11)
- comment (11)
- compile (11)
-
compile
_ option (11) -
completion
_ append _ character (11) -
completion
_ append _ character= (11) -
completion
_ case _ fold (11) - concat (30)
-
config
_ file _ name (11) - confstr (11)
- connect (11)
-
const
_ defined? (11) -
const
_ get (11) -
const
_ set (11) -
const
_ source _ location (5) - content (22)
-
content
_ encoding (11) -
content
_ id (33) -
content
_ length (11) -
content
_ length= (11) -
content
_ type (55) - context (11)
- convert (11)
-
create
_ body (11) -
create
_ ext _ from _ string (11) -
create
_ extension (22) -
create
_ header (11) -
create
_ id (11) - css (11)
- data (11)
- decode64 (11)
-
decode
_ www _ form _ component (11) -
default
_ argv (11) -
default
_ executable (11) -
define
_ singleton _ method (22) - deflate (22)
-
deprecate
_ constant (9) - desc (11)
- description (55)
-
destination
_ encoding _ name (22) -
dir
_ config (11) - disasm (22)
- disassemble (22)
- downcase (16)
- downcase! (8)
-
dsp
_ type (11) - dump (33)
- dup (22)
- email (11)
-
enable
_ config (22) - encode (33)
- encode! (22)
-
encode
_ www _ form _ component (11) - entity (11)
- environment (11)
- error= (11)
-
error
_ bytes (11) -
error
_ char (11) -
error
_ string (11) -
exception
_ details (1) - executable (11)
- executables (11)
- extensions (22)
-
extra
_ accessor _ flags (11) -
extra
_ rdoc _ files (11) -
fast
_ generate (11) -
fast
_ unparse (11) - fetch (11)
-
file
_ field (22) -
file
_ name (11) - filename (11)
- files (22)
- filter (33)
-
filter
_ backtrace (11) - finish (11)
- form (44)
- from (11)
-
full
_ gem _ path (11) -
full
_ name (11) -
gateway
_ interface (11) - generate (33)
-
generate
_ line (11) - get (11)
-
get
_ one _ gem _ name (11) -
get
_ one _ optional _ argument (11) -
get
_ option (11) -
get
_ path (11) -
get
_ value (11) - header (11)
- help (11)
- hidden (22)
-
history
_ file (11) - homepage (11)
- host (11)
- html (22)
- hton (11)
-
http
_ version (11) - id (11)
-
image
_ format (11) - img (22)
- indent (11)
- indent= (11)
-
insert
_ output (11) - inspect (88)
-
install
_ update _ defaults _ str (11) -
installation
_ path (11) - instance (22)
- investigation (11)
- irb (11)
-
irb
_ name (11) -
irb
_ name= (11) -
irb
_ path (11) - iseuc (11)
- isjis (11)
- iso8601 (11)
- issjis (11)
- isutf8 (11)
-
json
_ creatable? (11) -
json
_ create (11) - kconv (33)
- keys (11)
- label (22)
-
last
_ description (11) -
last
_ response (11) -
last
_ response _ code (11) - lastresp (11)
- lex (11)
-
lib
_ files (11) -
literal
_ concat _ string (11) -
load
_ from _ binary _ extra _ data (9) -
load
_ modules (11) -
loaded
_ from (11) - location (1)
-
long
_ name (11) -
main
_ page (11) -
mark
_ version (11) - markup (11)
-
marshal
_ version (11) -
module
_ function (19) - msg (11)
-
mu
_ pp (1) -
multipart
_ form (44) -
must
_ C _ version (11) - name (88)
- negotiate (11)
- new (99)
- normalize (11)
-
normalize
_ yaml _ input (11) -
object
_ nl (11) -
object
_ nl= (11) - oid (11)
-
op
_ dir (11) -
op
_ name (11) - open (70)
-
open
_ uri (11) -
option
_ string (11) - order (44)
- order! (44)
-
original
_ dir (11) -
original
_ name (11) -
original
_ platform (11) - out (11)
- param (11)
- params (11)
- parse (22)
- parse! (22)
-
parse
_ csv (11) - partition (11)
-
password
_ field (22) - path (33)
-
path
_ info (11) -
path
_ translated (11) - permute (22)
- permute! (22)
- platform (11)
- pragma (11)
-
pretty
_ generate (11) -
pretty
_ unparse (11) -
private
_ constant (11) -
program
_ name (11) -
prompt
_ c (11) -
prompt
_ i (11) -
prompt
_ n (11) -
prompt
_ s (11) -
psych
_ to _ yaml (11) - public (11)
-
public
_ constant (11) - puke (1)
- putback (22)
-
query
_ string (11) -
radio
_ group (22) -
rake
_ extension (11) - rakefile (11)
-
raw
_ data (33) -
rb
_ check _ convert _ type (11) -
rb
_ compile _ string (11) -
rb
_ eval _ string (11) -
rb
_ eval _ string _ protect (11) -
rb
_ eval _ string _ wrap (11) - rdoc (11)
-
rdoc
_ include (11) - read (11)
-
read
_ body (22) -
read
_ nonblock (44) - reason (22)
-
reason
_ phrase (22) -
recv
_ nonblock (11) -
recvfrom
_ nonblock (22) - recvmsg (11)
-
recvmsg
_ nonblock (11) - referer (11)
- release (11)
-
remote
_ addr (11) -
remote
_ host (11) -
remote
_ ident (11) -
remote
_ user (11) -
remove
_ const (11) - replacement (11)
- replacement= (11)
-
request
_ method (22) -
require
_ path (11) -
require
_ paths (11) - reset (22)
- responses (11)
-
return
_ format (11) - rpartition (11)
- ruby (11)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 3 feature (11) -
ruby 1
. 8 . 4 feature (11) -
rubygems
_ version (11) -
script
_ name (11) -
scrolling
_ list (22) - section (11)
- sections (11)
- select (11)
- sequence (11)
-
server
_ name (11) -
server
_ protocol (11) -
server
_ software (11) -
session
_ id (11) -
session
_ id _ context (11) -
set
_ backtrace (22) -
set
_ dictionary (22) -
set
_ encoding (22) -
signing
_ key (11) - signm (11)
-
singleton
_ class (11) -
singleton
_ method (11) - source (11)
-
source
_ location (39) - space (11)
- space= (11)
-
space
_ before (11) -
space
_ before= (11) -
ssl
_ version (11) -
stand
_ alone? (22) - standalone (11)
-
static
_ path (11) - status (11)
-
status
_ line (11) -
status
_ string (11) - strftime (11)
- submit (22)
- summary (11)
-
summary
_ indent (11) - swapcase (16)
- swapcase! (8)
- sysconfdir (11)
- system (11)
- tag (11)
- target (11)
- template (11)
-
template
_ dir (11) -
test
_ file (11) -
test
_ files (11) -
test
_ suite _ file (11) - text (11)
-
text
_ field (22) - textarea (22)
- title (22)
- title= (11)
-
to
_ a (22) -
to
_ binary (9) -
to
_ csv (22) -
to
_ der (33) -
to
_ json (242) -
to
_ json _ raw (11) -
to
_ json _ raw _ object (11) -
to
_ pem (11) -
to
_ r (11) -
to
_ ruby (11) -
to
_ s (198) -
to
_ text (11) -
to
_ yaml (22) - toeuc (11)
- tojis (11)
- tolocale (11)
- tosjis (11)
- toutf16 (11)
- toutf32 (11)
- toutf8 (11)
-
trusted
_ cert _ path (11) -
try
_ convert (22) - union (11)
-
unmatched
_ alias _ lists (11) - unpack (11)
- unparse (11)
- upcase (16)
- upcase! (8)
-
user
_ agent (11) - value (33)
- ver (11)
- verify (11)
- version (88)
- webcvs (11)
-
with
_ config (22) - write (22)
-
write
_ nonblock (22) - xmlschema (11)
- yaml (11)
-
zlib
_ version (11) - zone (22)
- 正規表現 (11)
検索結果
先頭5件
-
String
# swapcase(*options) -> String (21231.0) -
大文字を小文字に、小文字を大文字に変更した文字列を返します。
...した文字列を返します。
@param options オプションの詳細は String#downcase を参照してください。
//emlist[例][ruby]{
p "ABCxyz".swapcase # => "abcXYZ"
p "Access".swapcase # => "aCCESS"
//}
@see String#swapcase!, String#upcase, String#downcase, String#capitalize... -
String
# encode(**options) -> String (21215.0) -
self を指定したエンコーディングに変換した文字列を作成して返します。引数 を2つ与えた場合、第二引数は変換元のエンコーディングを意味します。さもな くば self のエンコーディングが使われます。 無引数の場合は、Encoding.default_internal が nil でなければそれが変換先のエンコーディングになり、かつ :invalid => :replace と :undef => :replace が指定されたと見なされ、nil ならば変換は行われません。
...す。
@param from_encoding 変換元のエンコーディングを表す文字列か Encoding オブジェクトを指定します。
@param option 変換オプションをキーワード引数で与えます。
@return 変換された文字列
変換オプション
: :inva......例外 Encoding::UndefinedConversionError を投げます。(デフォルト)
: :undef => :replace
変換先のエンコーディングにおいて文字が定義されていない場合に、未定義文字を置換文字で置き換えます。
: :replace => string
前述の :invalid => :repla......行を CRLF 改行に置き換えます。(CRLF は CRCRLF になります)
これ以上細かい指定を行いたい場合は、Encoding::Converter#convert を用いましょう。
//emlist[例][ruby]{
#coding:UTF-8
s = "いろは"
s.encode("EUC-JP")
s.encode(Encoding::UTF_8)
# U+00B7 MIDDLE DO... -
String
# encode(encoding , **options) -> String (21215.0) -
self を指定したエンコーディングに変換した文字列を作成して返します。引数 を2つ与えた場合、第二引数は変換元のエンコーディングを意味します。さもな くば self のエンコーディングが使われます。 無引数の場合は、Encoding.default_internal が nil でなければそれが変換先のエンコーディングになり、かつ :invalid => :replace と :undef => :replace が指定されたと見なされ、nil ならば変換は行われません。
...す。
@param from_encoding 変換元のエンコーディングを表す文字列か Encoding オブジェクトを指定します。
@param option 変換オプションをキーワード引数で与えます。
@return 変換された文字列
変換オプション
: :inva......例外 Encoding::UndefinedConversionError を投げます。(デフォルト)
: :undef => :replace
変換先のエンコーディングにおいて文字が定義されていない場合に、未定義文字を置換文字で置き換えます。
: :replace => string
前述の :invalid => :repla......行を CRLF 改行に置き換えます。(CRLF は CRCRLF になります)
これ以上細かい指定を行いたい場合は、Encoding::Converter#convert を用いましょう。
//emlist[例][ruby]{
#coding:UTF-8
s = "いろは"
s.encode("EUC-JP")
s.encode(Encoding::UTF_8)
# U+00B7 MIDDLE DO... -
String
# encode(encoding , from _ encoding , **options) -> String (21215.0) -
self を指定したエンコーディングに変換した文字列を作成して返します。引数 を2つ与えた場合、第二引数は変換元のエンコーディングを意味します。さもな くば self のエンコーディングが使われます。 無引数の場合は、Encoding.default_internal が nil でなければそれが変換先のエンコーディングになり、かつ :invalid => :replace と :undef => :replace が指定されたと見なされ、nil ならば変換は行われません。
...す。
@param from_encoding 変換元のエンコーディングを表す文字列か Encoding オブジェクトを指定します。
@param option 変換オプションをキーワード引数で与えます。
@return 変換された文字列
変換オプション
: :inva......例外 Encoding::UndefinedConversionError を投げます。(デフォルト)
: :undef => :replace
変換先のエンコーディングにおいて文字が定義されていない場合に、未定義文字を置換文字で置き換えます。
: :replace => string
前述の :invalid => :repla......行を CRLF 改行に置き換えます。(CRLF は CRCRLF になります)
これ以上細かい指定を行いたい場合は、Encoding::Converter#convert を用いましょう。
//emlist[例][ruby]{
#coding:UTF-8
s = "いろは"
s.encode("EUC-JP")
s.encode(Encoding::UTF_8)
# U+00B7 MIDDLE DO... -
String
# parse _ csv(**options) -> [String] (21201.0) -
CSV.parse_line(self, options) と同様です。
...CSV.parse_line(self, options) と同様です。
1 行の CSV 文字列を、文字列の配列に変換するためのショートカットです。
@param options CSV.new と同様のオプションを指定します。
//emlist[][ruby]{
require "csv"
p "Matz,Ruby\n".parse_csv... -
OptionParser
# on(short , desc = "") {|v| . . . } -> self (21187.0) -
オプションを取り扱うためのブロックを自身に登録します。 ブロックはコマンドラインのパース時に、オプションが指定されていれば呼ばれます。
...ます。
opts.on("-r", "--require LIBRARY"){|lib| ...}
これは以下と同値です。
opts.on("-r LIBRARY"){|lib| ...}
opts.on("--require LIBRARY"){|lib| ...}
複数の異なるオプションに同じブロックを一度に登録することもできます。
opt.on('-v', '-vv'){|boo......lean| ...}
opt.on('--require X', '--need', '--dependon'){|x| ... }
@param short ショートオプションを表す文字列を指定します。
そのオプションが引数をとらない場合は、
//emlist{
on("-x"){|boolean| ...}
//}
となります。コマ......とる場合は、
//emlist{
on("-x MANDATORY"){|val| ...}
//}
となります。"MANDATORY" の部分は任意の文字列で構いません。
オプションの引数が必須でない場合は [ ] をつけて、
//emlist{
on("-x [OPTIONAL]"){|val| ...}
//}... -
String
# upcase!(*options) -> self | nil (21154.0) -
全ての小文字を対応する大文字に破壊的に置き換えます。 どの文字がどう置き換えられるかは、オプションの有無や文字列のエンコーディングに依存します。
...ディングに依存します。
@param options オプションの詳細は String#downcase を参照してください。
//emlist[例][ruby]{
buf = "stRIng? STring."
buf.upcase!
p buf # => "STRING? STRING."
//}
@see String#upcase, String#downcase!,
String#swapcase!, String#capitalize!... -
OptionParser
# on(short , *rest) {|v| . . . } -> self (21142.0) -
オプションを取り扱うためのブロックを自身に登録します。 ブロックはコマンドラインのパース時に、オプションが指定されていれば呼ばれます。
...が配列やハッシュに含まれない場合、例外
OptionParser::InvalidArgument が OptionParser#parse 実行時
に発生します。
@param short ショートオプションを表す文字列を指定します。
@param long ロングオプションを表す文字列を指定します。......サマリに表示されるオプションの説明と見なします。
//emlist[][ruby]{
opts.on("--protocol VALUE", [:http, :ftp, :https]){|w|
p w
}
# ruby command --protocol=http #=> :http
opts.on("-c", "--charset VALUE", {"jis" => "iso-2022-jp", "sjis" => "shift_jis"}){|w|
p w
}
# ruby co... -
String
# downcase!(*options) -> self | nil (21142.0) -
全ての大文字を対応する小文字に破壊的に置き換えます。 どの文字がどう置き換えられるかは、オプションの有無や文字列のエンコーディングに依存します。
...ons オプションの詳細は String#downcase を参照してください。
@return self を変更して返します。変更が無かった場合は nil を返します。
//emlist[例][ruby]{
str = "STRing?"
str.downcase!
p str # => "string?"
//}
@see String#downcase, String#upcase!, String......#swapcase!, String#capitalize!... -
OptionParser
# on(short , pat = / . * / , desc = "") {|v| . . . } -> self (21137.0) -
オプションを取り扱うためのブロックを自身に登録します。 ブロックはコマンドラインのパース時に、オプションが指定されていれば呼ばれます。
...与えます。
コマンドに与えられた引数がパターンにマッチしない場合、
例外 OptionParser::InvalidArgument が parse 実行時に投げられます。
opts.on("--username VALUE", /[a-zA-Z0-9_]+/){|name| ...}
# ruby command --username=ruby_user
# ruby command --user......name=ruby.user #=> Error
@param short ショートオプションを表す文字列を指定します。
@param long ロングオプションを表す文字列を指定します。
@param pat オプションの引数に許すパターンを表す正規表現で指定します。
@param desc オ... -
String
# capitalize!(*options) -> self | nil (21130.0) -
文字列先頭の文字を大文字に、残りを小文字に破壊的に変更します。
...文字列先頭の文字を大文字に、残りを小文字に破壊的に変更します。
@param options オプションの詳細は String#downcase を参照してください。
@return capitalize! は self を変更して返しますが、
変更が起こらなかった場合は ni......l を返します。
//emlist[例][ruby]{
str = "foobar"
str.capitalize!
p str # => "Foobar"
str = "fooBAR"
str.capitalize!
p str # => "Foobar"
//}
@see String#capitalize, String#upcase!,
String#downcase!, String#swapcase!...