ライブラリ
- ビルトイン (1080)
- abbrev (11)
- benchmark (11)
- bigdecimal (22)
-
cgi
/ core (352) -
cgi
/ html (44) - csv (55)
- date (22)
- dbm (77)
- gdbm (66)
-
irb
/ ext / save-history (11) - json (22)
-
json
/ add / date (11) -
json
/ add / date _ time (11) -
json
/ add / symbol (11) - logger (22)
- mkmf (11)
-
net
/ ftp (83) -
net
/ http (231) -
net
/ imap (396) -
net
/ smtp (11) - open-uri (11)
- openssl (561)
- optparse (22)
- pathname (11)
- pp (33)
- prettyprint (11)
- psych (231)
- rake (55)
- resolv (33)
-
rexml
/ document (264) -
ripper
/ lexer (22) -
rubygems
/ command (11) -
rubygems
/ commands / dependency _ command (33) -
rubygems
/ dependency (22) -
rubygems
/ indexer (22) -
rubygems
/ package / tar _ header (11) -
rubygems
/ package / tar _ input (11) -
rubygems
/ package / tar _ reader / entry (33) -
rubygems
/ requirement (11) -
rubygems
/ source _ info _ cache (33) -
rubygems
/ specification (44) - scanf (36)
- sdbm (77)
- shell (6)
-
shell
/ command-processor (6) -
shell
/ filter (6) -
shell
/ system-command (24) - shellwords (11)
- socket (66)
- stringio (179)
- strscan (66)
-
syslog
/ logger (11) - uri (33)
-
webrick
/ httprequest (66) -
webrick
/ httpresponse (22) -
webrick
/ log (22) -
win32
/ registry (33) - win32ole (231)
-
yaml
/ dbm (88) - zlib (44)
クラス
-
ARGF
. class (9) - Array (129)
- BasicSocket (22)
-
Benchmark
:: Tms (11) - BigDecimal (22)
- CSV (33)
-
CSV
:: Table (11) - DBM (77)
- Date (33)
- DateTime (11)
- Encoding (11)
-
Encoding
:: Converter (11) -
Encoding
:: InvalidByteSequenceError (33) - Enumerator (22)
-
File
:: Stat (11) - GDBM (66)
-
Gem
:: Command (11) -
Gem
:: Commands :: DependencyCommand (33) -
Gem
:: Dependency (22) -
Gem
:: Indexer (22) -
Gem
:: Package :: TarHeader (11) -
Gem
:: Package :: TarInput (11) -
Gem
:: Package :: TarReader :: Entry (33) -
Gem
:: Requirement (11) -
Gem
:: SourceInfoCache (33) -
Gem
:: Specification (44) - IO (45)
-
IRB
:: Context (11) -
JSON
:: State (11) - Logger (11)
-
Logger
:: Formatter (11) - MatchData (11)
- Module (87)
-
Net
:: FTP (11) -
Net
:: FTP :: MLSxEntry (72) -
Net
:: HTTP (66) -
Net
:: HTTPGenericRequest (11) -
Net
:: HTTPResponse (44) -
Net
:: IMAP (11) -
Net
:: IMAP :: BodyTypeBasic (99) -
Net
:: IMAP :: BodyTypeMessage (99) -
Net
:: IMAP :: BodyTypeMultipart (55) -
Net
:: IMAP :: BodyTypeText (99) -
Net
:: IMAP :: ContentDisposition (11) -
Net
:: IMAP :: Envelope (11) -
Net
:: IMAP :: MailboxList (11) -
Net
:: SMTP (11) - Object (91)
-
OpenSSL
:: Cipher (11) -
OpenSSL
:: PKCS7 (22) -
OpenSSL
:: PKCS7 :: RecipientInfo (11) -
OpenSSL
:: PKey :: DH (77) -
OpenSSL
:: PKey :: DSA (110) -
OpenSSL
:: PKey :: EC (55) -
OpenSSL
:: PKey :: EC :: Group (55) -
OpenSSL
:: PKey :: PKey (11) -
OpenSSL
:: PKey :: RSA (143) -
OpenSSL
:: SSL :: SSLSocket (22) -
OpenSSL
:: X509 :: ExtensionFactory (33) -
OpenSSL
:: X509 :: StoreContext (11) - OptionParser (11)
-
OptionParser
:: ParseError (11) - Pathname (11)
- PrettyPrint (11)
-
Psych
:: Nodes :: Alias (11) -
Psych
:: Nodes :: Document (11) -
Psych
:: Nodes :: Mapping (22) -
Psych
:: Nodes :: Node (33) -
Psych
:: Nodes :: Scalar (33) -
Psych
:: Nodes :: Sequence (22) -
Psych
:: ScalarScanner (22) -
Psych
:: SyntaxError (33) -
REXML
:: AttlistDecl (11) -
REXML
:: Attribute (11) -
REXML
:: DocType (77) -
REXML
:: Element (33) -
REXML
:: Entity (99) -
REXML
:: ExternalEntity (11) -
REXML
:: NotationDecl (11) -
Rake
:: EarlyTime (11) -
Rake
:: FileList (22) -
Rake
:: InvocationChain :: EmptyInvocationChain (11) - Random (11)
-
Resolv
:: DNS (33) -
Ripper
:: Lexer (22) -
RubyVM
:: AbstractSyntaxTree :: Node (6) -
RubyVM
:: InstructionSequence (86) - SDBM (77)
- Shell (6)
-
Shell
:: CommandProcessor (6) -
Shell
:: Filter (6) -
Shell
:: SystemCommand (24) - Socket (11)
-
Socket
:: AncillaryData (11) -
Socket
:: Option (11) - String (229)
- StringIO (179)
- StringScanner (66)
- Symbol (360)
- SyntaxError (2)
-
Syslog
:: Logger :: Formatter (11) - Thread (11)
- Time (27)
- UDPSocket (11)
-
URI
:: FTP (11) -
URI
:: Generic (22) - UnboundMethod (22)
-
WEBrick
:: HTTPRequest (66) -
WEBrick
:: HTTPResponse (22) -
WEBrick
:: Log (22) -
WIN32OLE
_ METHOD (22) -
WIN32OLE
_ PARAM (22) -
WIN32OLE
_ TYPE (99) -
WIN32OLE
_ TYPELIB (55) -
WIN32OLE
_ VARIABLE (22) -
WIN32OLE
_ VARIANT (11) -
Win32
:: Registry (33) -
YAML
:: DBM (88) -
Zlib
:: Deflate (22) -
Zlib
:: Inflate (22)
モジュール
-
CGI
:: HtmlExtension (44) -
CGI
:: QueryExtension (352) -
JSON
:: Generator :: GeneratorMethods :: Array (11) - Kernel (45)
-
Net
:: HTTPHeader (110) -
OpenURI
:: Meta (11) -
REXML
:: Namespace (11)
キーワード
- * (33)
- <=> (11)
- =~ (11)
- [] (143)
- abbrev (11)
-
absolute
_ path (11) - accept (11)
-
accept
_ charset (11) -
accept
_ encoding (11) -
accept
_ language (11) -
alias
_ method (3) - anchor (44)
- arguments (11)
- arity (11)
-
array
_ nl (11) -
ascii
_ only? (11) - attr (20)
-
attr
_ accessor (3) -
attr
_ reader (3) -
attr
_ writer (3) -
attribute
_ of (11) -
auth
_ type (11) -
base
_ label (11) - bind (11)
- body (55)
- byteindex (2)
- byterindex (2)
- bytes (47)
- bytesize (11)
- byteslice (33)
- bytesplice (4)
-
cache
_ control (11) - call (22)
- capability (11)
-
capable
_ auth _ types (11) - capitalize (11)
- casecmp (11)
- casecmp? (8)
- charset (9)
- clone (11)
- coerce (11)
- command (6)
-
compute
_ key (11) -
content
_ id (33) -
content
_ type (55) - context (11)
-
create
_ body (11) -
create
_ ext _ from _ string (11) -
create
_ extension (22) - crypt (11)
-
curve
_ name (11) - data (11)
-
datetime
_ format (11) - decrypt (11)
-
define
_ method (22) -
define
_ singleton _ method (22) - delete (33)
- description (33)
-
dest
_ directory (11) -
destination
_ encoding _ name (11) -
dh
_ compute _ key (11) - directory (11)
- disasm (11)
- disassemble (11)
- downcase (11)
-
dsa
_ sign _ asn1 (11) -
dsp
_ type (11) - dummy? (11)
-
dummy
_ makefile (11) - dup (11)
-
each
_ byte (44) -
each
_ key (11) -
each
_ resource (11) - empty? (33)
-
enc
_ key (11) - encoding (44)
-
end
_ with? (5) - entities (11)
- entity (22)
- eos? (11)
-
error
_ bytes (11) - export (55)
- external (11)
-
external
_ id (11) - facts (9)
- fetch (44)
- file (11)
- flush (11)
- form (22)
- format (11)
- from (11)
- fsync (11)
- ftype (40)
-
full
_ name (11) -
gateway
_ interface (11) -
get
_ byte (11) -
get
_ fields (11) - getbyte (33)
- getc (11)
- getresource (11)
- getresources (11)
- gets (11)
- gsub (11)
- guid (22)
- helpfile (11)
- helpstring (11)
-
history
_ file (11) - host (11)
- id2name (11)
-
in
_ reply _ to (11) - index (11)
- inspect (55)
- intern (22)
- invert (11)
- isatty (11)
- join (11)
- key (44)
- keys (44)
- label (11)
- lang (9)
- language (44)
-
latest
_ system _ cache _ file (11) - length (11)
- lex (11)
-
library
_ name (11) -
main
_ type (11) - match (11)
- match? (8)
- md5 (33)
-
media
_ subtype (44) -
media
_ type (53) -
module
_ function (8) -
multipart
_ form (22) - name (76)
- names (11)
- namespace (11)
- namespaces (11)
- ndata (11)
- negotiate (11)
- newline (11)
- next (11)
- normalized (11)
- notify (12)
-
ole
_ type (33) -
ole
_ type _ detail (22) - pack (19)
- param (44)
- params (44)
- parse (11)
-
parse
_ time (11) - path (24)
-
path
_ info (11) -
path
_ translated (11) -
pathmap
_ explode (11) - pathname (9)
- peek (11)
- peep (11)
- perm (9)
- pragma (11)
- prefix (11)
- prefixes (11)
-
pretty
_ inspect (11) -
pretty
_ print (11) -
pretty
_ print _ inspect (11) -
pretty
_ print _ instance _ variables (11) -
print
_ dependencies (11) - private (12)
-
private
_ decrypt (11) -
private
_ encrypt (11) - problem (11)
- progid (11)
- protected (12)
-
proxy
_ address (11) -
proxy
_ basic _ auth (11) -
proxy
_ pass (11) -
proxy
_ uri (11) -
proxy
_ user (11) - proxyaddr (11)
-
psych
_ to _ yaml (11) -
psych
_ y (11) - pubid (11)
- public (23)
-
public
_ decrypt (11) -
public
_ encrypt (11) - putback (11)
- query (22)
-
query
_ string (22) -
query
_ string= (11) -
random
_ key (11) - read (22)
-
read
_ body (22) -
read
_ nonblock (20) -
readagain
_ bytes (11) - readbyte (11)
- readline (11)
-
recvfrom
_ nonblock (11) - recvmsg (11)
-
recvmsg
_ nonblock (11) - ref (11)
- referer (11)
- registry (11)
- reject (11)
-
remote
_ addr (11) -
remote
_ host (11) -
remote
_ ident (11) -
remote
_ user (11) -
request
_ method (11) -
requirements
_ list (11) -
return
_ type (11) -
return
_ type _ detail (11) -
rubygems
_ version (11) - scanf (36)
-
script
_ name (11) - scrub (11)
- scrub! (11)
- seed (11)
- select (44)
-
server
_ name (11) -
server
_ protocol (11) -
server
_ software (11) -
set
_ backtrace (11) -
set
_ dictionary (22) - setbyte (11)
- shelljoin (11)
- shift (22)
- sign (11)
-
signing
_ key (11) - size (11)
- slice (55)
- split (11)
-
src
_ type (11) -
ssl
_ version (11) -
start
_ with? (5) - store (33)
- strftime (22)
-
sub
_ type (11) - subtype (44)
- succ (11)
- summary (22)
-
summary
_ indent (11) - swapcase (11)
- sync (22)
- sync= (11)
- sysread (55)
- syssign (11)
- system (33)
-
system
_ cache _ file (11) - syswrite (33)
- tag (44)
-
tag
_ directives (11) -
thread
_ variable? (11) -
time
_ format (11) -
time
_ format= (11) -
to
_ a (11) -
to
_ binary (9) -
to
_ csv (11) -
to
_ der (55) -
to
_ json (44) -
to
_ pem (77) -
to
_ ruby (11) -
to
_ s (165) -
to
_ sym (22) -
to
_ text (55) -
to
_ yaml (22) - tokenize (11)
-
try
_ file (11) - tty? (11)
- type (9)
- typecode (11)
- typeflag (11)
- ungetbyte (11)
- unique (9)
- unnormalized (11)
- unpack (22)
- upcase (11)
- usage (11)
-
user
_ agent (11) - value (22)
-
values
_ at (33) - vartype (11)
- verify (22)
-
with
_ object (22) -
write
_ nonblock (11) - yaml (11)
-
yield
_ self (14) -
zipped
_ stream (11)
検索結果
先頭5件
-
String
# byterindex(pattern , offset = self . bytesize) -> Integer | nil (27231.0) -
文字列のバイト単位のインデックス offset から左に向かって pattern を探索します。 最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。 見つからなければ nil を返します。
...または正規表現で指定します。
offset が負の場合は、文字列の末尾から数えた位置から探索します。
byterindex と String#byteindex とでは、探索方向だけが逆になります。
完全に左右が反転した動作をするわけではありません。......//emlist[String#byteindex の場合][ruby]{
p "stringstring".byteindex("ing", 1) # => 3
# ing # ここから探索を始める
# ing
# ing # 右にずらしていってここで見つかる
//}
//emlist[String#byterindex の場合][ruby]{
p "stringstring".byterindex(......][ruby]{
'foo'.byterindex('f') # => 0
'foo'.byterindex('o') # => 2
'foo'.byterindex('oo') # => 1
'foo'.byterindex('ooo') # => nil
'foo'.byterindex(/f/) # => 0
'foo'.byterindex(/o/) # => 2
'foo'.byterindex(/oo/) # => 1
'foo'.byterindex(/ooo/) # => nil
# 右でのマッチが優先
'foo'.byterindex(... -
String
# byteslice(nth , len=1) -> String | nil (27219.0) -
nth バイト目から長さ len バイトの部分文字列を新しく作って返します。 nth が負の場合は文字列の末尾から数えます。引数が範囲外を指定した場合は nil を返します。
...。
@return 切り出した文字列を返します。戻り値の文字エンコーディングは自身
と同じです。
//emlist[例][ruby]{
"hello".byteslice(1, 2) # => "el"
"\u3042\u3044\u3046".byteslice(0, 3) # => "\u3042"
//}
@see String#slice
@see String#bytesplice... -
String
# byteslice(range) -> String | nil (27219.0) -
range で指定したバイトの範囲に含まれる部分文字列を返します。引数が範囲 外を指定した場合は nil を返します。
...ェクト
@return 切り出した文字列を返します。戻り値の文字エンコーディングは自身
と同じです。
//emlist[例][ruby]{
"hello".byteslice(1..2) # => "el"
"\x03\u3042\xff".byteslice(1..3) # => "\u3042"
//}
@see String#slice
@see String#bytesplice... -
String
# bytesplice(index , length , str) -> String (27215.0) -
self の一部または全部を str で置き換えて str を返します。
...は全部を str で置き換えて str を返します。
置き換え範囲の指定は、長さの指定が省略できないこと以外は
String#byteslice と同じです。
置き換え後の文字列の長さが対象の長さと違う場合、
適切に長さが調整されます。
@para......い文字列の範囲を示す Range オブジェクト
@raise IndexError index や length が範囲外の場合に発生
@raise RangeError range が範囲外の場合に発生
@raise IndexError 指定した始端や終端が文字列の境界と一致しない場合に発生
@see String#byteslice... -
String
# bytesplice(range , str) -> String (27215.0) -
self の一部または全部を str で置き換えて str を返します。
...は全部を str で置き換えて str を返します。
置き換え範囲の指定は、長さの指定が省略できないこと以外は
String#byteslice と同じです。
置き換え後の文字列の長さが対象の長さと違う場合、
適切に長さが調整されます。
@para......い文字列の範囲を示す Range オブジェクト
@raise IndexError index や length が範囲外の場合に発生
@raise RangeError range が範囲外の場合に発生
@raise IndexError 指定した始端や終端が文字列の境界と一致しない場合に発生
@see String#byteslice... -
String
# byteslice(nth) -> String | nil (27214.0) -
nth バイト目の文字を返します。nth が負の場合は文字列の末尾から数えます。 引数が範囲外を指定した場合は nil を返します。
...rn 切り出した文字列を返します。戻り値の文字エンコーディングは自身
と同じです。
//emlist[例][ruby]{
"hello".byteslice(1) # => "e"
"hello".byteslice(-1) # => "o"
"\u3042".byteslice(0) # => "\xE3"
"\u3042".byteslice(1) # => "\x81"
//}
@see String#slice... -
String
# bytes {|byte| . . . } -> self (27213.0) -
文字列の各バイトを数値の配列で返します。(self.each_byte.to_a と同じです)
..._byte.to_a と同じです)
//emlist[例][ruby]{
"str".bytes # => [115, 116, 114]
//}
ブロックが指定された場合は String#each_byte と同じように動作します。
Ruby 2.6 までは deprecated の警告が出ますが、Ruby 2.7 で警告は削除されました。
@see String#e......ach_byte... -
String
# byteslice(nth) -> String | nil (27212.0) -
nth バイト目の文字を返します。nth が負の場合は文字列の末尾から数えます。 引数が範囲外を指定した場合は nil を返します。
...rn 切り出した文字列を返します。戻り値の文字エンコーディングは自身
と同じです。
//emlist[例][ruby]{
"hello".byteslice(1) # => "e"
"hello".byteslice(-1) # => "o"
"\u3042".byteslice(0) # => "\xE3"
"\u3042".byteslice(1) # => "\x81"
//}
@see String#slice... -
String
# byteslice(nth , len=1) -> String | nil (27212.0) -
nth バイト目から長さ len バイトの部分文字列を新しく作って返します。 nth が負の場合は文字列の末尾から数えます。引数が範囲外を指定した場合は nil を返します。
...数で指定します。
@return 切り出した文字列を返します。戻り値の文字エンコーディングは自身
と同じです。
//emlist[例][ruby]{
"hello".byteslice(1, 2) # => "el"
"\u3042\u3044\u3046".byteslice(0, 3) # => "\u3042"
//}
@see String#slice... -
String
# byteslice(range) -> String | nil (27212.0) -
range で指定したバイトの範囲に含まれる部分文字列を返します。引数が範囲 外を指定した場合は nil を返します。
...を示す Range オブジェクト
@return 切り出した文字列を返します。戻り値の文字エンコーディングは自身
と同じです。
//emlist[例][ruby]{
"hello".byteslice(1..2) # => "el"
"\x03\u3042\xff".byteslice(1..3) # => "\u3042"
//}
@see String#slice... -
String
# crypt(salt) -> String (27208.0) -
self と salt から暗号化された文字列を生成して返します。 salt には英数字、ドット (「.」)、スラッシュ (「/」) から構成される、 2 バイト以上の文字列を指定します。
...どがあります。
注意:
* Ruby 2.6 から非推奨になったため、引き続き必要な場合は
string-crypt gem の使用を検討してください。
* crypt の処理は crypt(3) の実装に依存しています。
従って、crypt で処理される内容の詳細や......用環境の crypt(3) 等を見て確認してください。
* crypt の結果は利用環境が異なると変わる場合があります。
crypt の結果を、異なる利用環境間で使用する場合には注意して下さい。
* 典型的な DES を使用した crypt(3) の場......文字列
//emlist[例][ruby]{
# パスワードの暗号化
salt = [rand(64),rand(64)].pack("C*").tr("\x00-\x3f","A-Za-z0-9./")
passwd.crypt(salt)
# UNIX のログイン認証
require 'etc'
def valid_login?(user, password)
ent = Etc.getpwnam(user)
password.crypt(ent.passwd) == ent.passwd
end... -
String
# each _ byte {|byte| . . . } -> self (27207.0) -
文字列の各バイトに対して繰り返します。
...文字列の各バイトに対して繰り返します。
//emlist[例][ruby]{
"str".each_byte do |byte|
p byte
end
# => 115
# => 116
# => 114
"あ".each_byte do |byte|
p byte
end
# => 227
# => 129
# => 130
//}
@see String#bytes... -
String
# byteindex(pattern , offset = 0) -> Integer | nil (27113.0) -
文字列の offset から右に向かって pattern を検索し、 最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。 見つからなければ nil を返します。
...st[例][ruby]{
'foo'.byteindex('f') # => 0
'foo'.byteindex('o') # => 1
'foo'.byteindex('oo') # => 1
'foo'.byteindex('ooo') # => nil
'foo'.byteindex(/f/) # => 0
'foo'.byteindex(/o/) # => 1
'foo'.byteindex(/oo/) # => 1
'foo'.byteindex(/ooo/) # => nil
'foo'.byteindex('o', 1) # => 1
'foo'.byteindex('o......'foo'.byteindex('o', 3) # => nil
'foo'.byteindex('o', -1) # => 2
'foo'.byteindex('o', -2) # => 1
'foo'.byteindex('o', -3) # => 1
'foo'.byteindex('o', -4) # => nil
'あいう'.byteindex('う') # => 6
'あいう'.byteindex('う', 3) # => 6
'あいう'.byteindex('う', -3) # => 6
'あいう'.byteinde......x('う', 1) # offset 1 does not land on character boundary (IndexError)
//}
@see String#index, String#byterindex... -
String
# bytes -> [Integer] (27113.0) -
文字列の各バイトを数値の配列で返します。(self.each_byte.to_a と同じです)
..._byte.to_a と同じです)
//emlist[例][ruby]{
"str".bytes # => [115, 116, 114]
//}
ブロックが指定された場合は String#each_byte と同じように動作します。
Ruby 2.6 までは deprecated の警告が出ますが、Ruby 2.7 で警告は削除されました。
@see String#e......ach_byte... -
String
# bytesize -> Integer (27107.0) -
文字列のバイト長を整数で返します。
...文字列のバイト長を整数で返します。
//emlist[例][ruby]{
#coding:UTF-8
# 実行結果は文字コードによって異なります。
p "いろは".size #=> 3
p "いろは".bytesize #=> 9
//}
@see String#size... -
String
# each _ byte -> Enumerator (27107.0) -
文字列の各バイトに対して繰り返します。
...文字列の各バイトに対して繰り返します。
//emlist[例][ruby]{
"str".each_byte do |byte|
p byte
end
# => 115
# => 116
# => 114
"あ".each_byte do |byte|
p byte
end
# => 227
# => 129
# => 130
//}
@see String#bytes...