別のキーワード
ライブラリ
- ビルトイン (4763)
- csv (222)
- date (4)
- digest (24)
- erb (24)
- fiber (8)
-
fiddle
/ import (36) - forwardable (48)
-
irb
/ cmd / help (12) -
irb
/ cmd / load (36) - json (48)
-
json
/ add / exception (12) - matrix (24)
-
net
/ http (264) - openssl (12)
- optparse (264)
- pathname (48)
- pp (24)
- prime (72)
- rake (540)
-
rake
/ packagetask (96) -
rexml
/ document (24) -
rexml
/ streamlistener (12) - ripper (12)
-
rubygems
/ specification (36) - set (18)
- strscan (84)
- thread (16)
- tsort (93)
- win32ole (36)
- zlib (24)
クラス
-
ARGF
. class (36) - Array (245)
- BasicObject (144)
- Binding (47)
- CSV (180)
-
CSV
:: FieldInfo (36) -
CSV
:: Row (6) - Class (40)
- Data (6)
- Date (2)
- DateTime (2)
-
Digest
:: Base (24) - Dir (60)
- ERB (24)
-
Encoding
:: Converter (48) -
Encoding
:: InvalidByteSequenceError (24) -
Encoding
:: UndefinedConversionError (12) - Enumerator (120)
-
Enumerator
:: Lazy (48) -
Enumerator
:: Yielder (30) - Exception (140)
- Fiber (42)
- File (36)
-
File
:: Stat (72) - FrozenError (6)
-
Gem
:: Specification (36) - Hash (67)
- IO (286)
-
IRB
:: ExtendCommand :: Help (12) -
IRB
:: ExtendCommand :: Load (12) -
IRB
:: ExtendCommand :: Require (12) -
IRB
:: ExtendCommand :: Source (12) - Integer (35)
-
JSON
:: Parser (24) -
JSON
:: State (12) - MatchData (104)
- Matrix (24)
- Method (223)
- Module (963)
- Mutex (6)
-
Net
:: HTTP (156) -
Net
:: HTTPGenericRequest (24) -
Net
:: HTTPResponse (36) - Numeric (105)
- Object (480)
- OptionParser (264)
- Pathname (48)
- Prime (24)
-
Prime
:: PseudoPrimeGenerator (48) - Proc (92)
-
REXML
:: Attributes (24) -
Rake
:: Application (60) -
Rake
:: FileList (192) -
Rake
:: FileTask (24) -
Rake
:: InvocationChain (36) -
Rake
:: NameSpace (24) -
Rake
:: PackageTask (96) -
Rake
:: TaskArguments (60) - Random (36)
- Range (148)
- Refinement (4)
- Regexp (72)
- Ripper (12)
-
RubyVM
:: InstructionSequence (60) - Set (24)
- SignalException (24)
- String (194)
- StringScanner (84)
- Symbol (12)
- Thread (72)
-
Thread
:: Backtrace :: Location (48) -
Thread
:: ConditionVariable (24) -
Thread
:: Mutex (30) -
Thread
:: Queue (36) -
Thread
:: SizedQueue (36) - Time (2)
- TracePoint (189)
- UnboundMethod (36)
- UncaughtThrowError (33)
- WIN32OLE (12)
-
WIN32OLE
_ EVENT (12) -
WIN32OLE
_ TYPE (12) -
Zlib
:: GzipWriter (24)
モジュール
- Comparable (12)
- Enumerable (244)
-
Fiddle
:: Importer (36) - Forwardable (48)
-
JSON
:: Generator :: GeneratorMethods :: Object (12) -
Net
:: HTTPExceptions (12) -
Net
:: HTTPHeader (36) -
REXML
:: StreamListener (12) -
Rake
:: Cloneable (24) -
Rake
:: TaskManager (120) - TSort (93)
キーワード
- ! (12)
- != (12)
- % (12)
-
/ (11) - < (12)
- << (38)
- <= (12)
- <=> (12)
- == (60)
- === (75)
- =~ (12)
- > (12)
- >= (12)
- >> (14)
- [] (156)
- []= (36)
-
_ _ send _ _ (24) -
_ dump (12) -
absolute
_ path (24) - accept (12)
-
add
_ dependency (12) -
add
_ development _ dependency (12) -
add
_ row (12) -
add
_ runtime _ dependency (12) -
add
_ trace _ func (12) -
alias
_ method (12) - allocate (12)
- ancestors (12)
- append (20)
-
append
_ as _ bytes (1) -
append
_ features (12) - arity (24)
- ascend (24)
- at (12)
- attr (36)
-
attr
_ accessor (12) -
attr
_ reader (12) -
attr
_ writer (12) - autoclose? (12)
- autoload (12)
- backtrace (24)
-
backtrace
_ locations (12) -
base
_ label (24) - begin (24)
- bind (24)
- binding (24)
- binmode (12)
- blockdev? (12)
-
body
_ stream (12) -
body
_ stream= (12) - broadcast (12)
- byteend (2)
- byteoffset (6)
- call (36)
-
callee
_ id (12) - cause (12)
- chardev? (12)
-
check
_ circular? (12) - chunk (12)
- clamp (12)
-
class
_ eval (24) -
class
_ exec (12) -
class
_ variable _ defined? (12) -
class
_ variable _ get (12) -
class
_ variable _ set (12) -
class
_ variables (12) -
clear
_ exclude (12) - clone (48)
- close (12)
-
close
_ read (12) -
close
_ write (12) - coerce (12)
- compact (4)
-
const
_ added (3) -
const
_ defined? (12) -
const
_ get (12) -
const
_ set (12) -
const
_ source _ location (12) - constants (12)
- convert (36)
- cover? (19)
- crypt (12)
-
current
_ scope (12) - curry (22)
- deconstruct (6)
-
deconstruct
_ keys (12) -
def
_ class (12) -
def
_ delegator (12) -
def
_ instance _ delegator (12) -
def
_ module (12) -
default
_ event _ sources (12) -
define
_ method (24) -
define
_ singleton _ method (24) -
define
_ task (12) -
defined
_ class (12) - delegate (12)
-
delete
_ suffix (8) -
delete
_ suffix! (8) - deq (24)
- descend (24)
- disable (24)
- display (12)
- div (12)
- divide (24)
- dup (36)
- each (120)
-
each
_ attribute (12) -
each
_ byte (48) -
each
_ codepoint (24) -
each
_ entry (24) -
each
_ index (24) -
each
_ line (24) -
each
_ strongly _ connected _ component (23) -
each
_ strongly _ connected _ component _ from (23) -
each
_ with _ index (72) - enable (24)
-
end
_ seen? (12) -
end
_ with? (18) - entitydecl (12)
-
enum
_ for (48) - eql? (12)
-
error
_ bytes (12) -
error
_ char (12) - eval (12)
-
eval
_ script (7) - event (12)
- exception (24)
-
exclude
_ end? (12) -
excluded
_ from _ list? (12) - execute (48)
- existing (12)
- existing! (12)
- ext (12)
- extend (12)
-
extend
_ object (12) - extended (12)
- fcntl (12)
- fdatasync (12)
- feed (12)
- fetch (72)
-
field
_ size _ limit (12) - finish (12)
- first (24)
-
first
_ lineno (12) -
fixed
_ encoding? (12) - flush (12)
-
force
_ quotes? (12) - freeze (12)
- get (24)
- get2 (24)
- gets (12)
- gsub! (12)
- handler= (12)
- hash (12)
- header (12)
- help (12)
- hexdigest (12)
- import (12)
-
import
_ methods (4) -
in
_ namespace (12) - include (12)
- include? (12)
- included (12)
-
included
_ modules (12) -
incomplete
_ input? (12) - index (12)
- inherited (12)
- initialize (12)
-
initialize
_ copy (12) -
inplace
_ mode= (12) - inspect (72)
-
instance
_ delegate (12) -
instance
_ eval (24) -
instance
_ exec (12) -
instance
_ method (12) -
instance
_ methods (12) -
instance
_ of? (12) -
instance
_ variable _ defined? (12) -
instance
_ variable _ get (12) -
instruction
_ sequence (7) - intern (12)
-
internal
_ encoding (12) - invert (12)
-
is
_ a? (24) -
kind
_ of? (24) - label (12)
- lambda? (12)
- last (24)
-
last
_ comment (12) -
last
_ description (12) - lazy (12)
- line (12)
- lineno (12)
- load (12)
-
local
_ variable _ defined? (12) -
local
_ variable _ get (12) -
local
_ variables (11) - lookup (12)
- lstat (12)
-
marshal
_ dump (12) - match (24)
- match? (12)
-
matched
_ size (12) - max (48)
-
max
_ by (48) - member? (12)
- merge (24)
-
method
_ added (12) -
method
_ defined? (12) -
method
_ id (12) -
method
_ missing (12) -
method
_ removed (12) -
method
_ undefined (12) - methods (12)
- min (48)
-
module
_ eval (24) -
module
_ exec (12) -
module
_ function (36) - name (48)
- names (12)
-
need
_ tar (12) -
need
_ tar _ bz2 (12) -
need
_ tar _ gz (12) -
need
_ zip (12) - needed? (12)
-
new
_ scope (12) - next (12)
-
next
_ values (12) - offset (24)
-
ole
_ query _ interface (12) -
on
_ head (12) -
on
_ tail (12) -
original
_ dir (12) -
original
_ name (24) - overlap? (2)
- owned? (12)
- owner (12)
- pack (21)
-
package
_ dir (12) -
package
_ dir _ path (12) -
package
_ files (12) - parameters (7)
- parse (36)
- parse! (12)
- path (36)
- pathmap (12)
- peek (12)
-
peek
_ values (12) - peep (12)
- pid (12)
- pointer= (12)
- pop (24)
- pos (12)
- pos= (12)
- post (24)
- post2 (24)
- pread (8)
- prepend (41)
-
prepend
_ features (12) - prepended (12)
-
pretty
_ print (12) -
pretty
_ print _ cycle (12) -
primitive
_ convert (48) - priority (12)
- priority= (12)
- private (48)
-
private
_ class _ method (24) -
private
_ constant (12) -
private
_ instance _ methods (12) -
private
_ method _ defined? (12) -
program
_ name (12) -
protected
_ method _ defined? (12) - public (48)
-
public
_ class _ method (24) -
public
_ constant (12) -
public
_ method _ defined? (12) -
public
_ send (24) - push (8)
- puts (12)
- pwrite (8)
- raise (18)
-
raised
_ exception (12) - rakefile (12)
- rand (36)
- read (24)
-
read
_ body (24) - readbyte (24)
- readchar (12)
- readline (12)
- readlines (12)
- receiver (18)
- refine (12)
- reject (12)
- release (12)
-
remove
_ class _ variable (12) -
remove
_ const (12) -
remove
_ instance _ variable (12) -
remove
_ method (12) - replace (12)
-
request
_ get (24) -
request
_ post (24) - resolve (12)
-
respond
_ to? (12) -
respond
_ to _ missing? (12) - response (12)
- resume (12)
-
return
_ value (12) - rewind (12)
-
ruby2
_ keywords (18) - seek (12)
- send (24)
-
send
_ request (12) - separator (12)
-
set
_ backtrace (12) -
set
_ encoding _ by _ bom (6) -
set
_ trace _ func (12) - setgid? (12)
- setuid? (12)
- shift (36)
- signal (12)
- signm (12)
- signo (12)
-
singleton
_ class? (12) -
singleton
_ method (12) -
singleton
_ method _ added (12) -
singleton
_ method _ removed (12) -
singleton
_ method _ undefined (12) -
singleton
_ methods (12) - size (12)
- sleep (12)
- socket? (12)
-
sort
_ by (24) - source (12)
-
source
_ location (12) -
start
_ with? (18) - stat (12)
- step (93)
- sticky? (12)
-
strongly
_ connected _ components (12) - struct (12)
- sub! (12)
- subclasses (4)
- sum (12)
- summarize (24)
-
summary
_ indent (12) -
summary
_ indent= (12) -
summary
_ width (12) -
summary
_ width= (12) -
super
_ method (11) - superclass (12)
- sync (12)
- synchronize (12)
-
synthesize
_ file _ task (12) - syswrite (12)
- tag (11)
- tasks (24)
- tell (12)
-
to
_ a (36) -
to
_ ary (36) -
to
_ bn (12) -
to
_ enum (48) -
to
_ h (19) -
to
_ hash (24) -
to
_ int (12) -
to
_ json (24) -
to
_ path (12) -
to
_ proc (30) -
to
_ regexp (12) -
to
_ s (119) -
to
_ str (12) -
top
_ level _ tasks (12) - transfer (12)
- truncate (12)
- tsort (12)
-
tsort
_ each (23) - unbind (12)
-
undef
_ method (12) - union (12)
- unpack (12)
- unscan (12)
- unshift (8)
- upto (12)
- value (23)
- ver (12)
-
with
_ defaults (12) -
with
_ index (24) -
with
_ object (24) - write (12)
-
write
_ headers? (12) - yield (24)
- ~ (12)
検索結果
先頭5件
-
Enumerable
# min -> object | nil (110.0) -
最小の要素、もしくは最小の n 要素が昇順で入った配列を返します。 全要素が互いに <=> メソッドで比較できることを仮定しています。
...す。
該当する要素が複数存在する場合、どの要素を返すかは不定です。
@param n 取得する要素数。
//emlist[例][ruby]{
a = %w(albatross dog horse)
a.min # => "albatross"
a.min(2) # => ["albatross", "dog"]... -
Enumerable
# min(n) -> Array (110.0) -
最小の要素、もしくは最小の n 要素が昇順で入った配列を返します。 全要素が互いに <=> メソッドで比較できることを仮定しています。
...す。
該当する要素が複数存在する場合、どの要素を返すかは不定です。
@param n 取得する要素数。
//emlist[例][ruby]{
a = %w(albatross dog horse)
a.min # => "albatross"
a.min(2) # => ["albatross", "dog"]... -
ARGF
. class # inplace _ mode=(ext) (85.0) -
c:ARGF#inplace時にバックアップファイルに付加する拡張子を設定します。 ピリオドも含めて指定する必要があります。
...。
Ruby 起動時の -i オプションで設定することも出来ます。
@param ext インプレースモード時にバックアップファイルに付加する拡張子を
文字列で指定します。
ピリオドも含める必要があります。
$ ruby argf.......rb file.txt
---- argf.rb ----
# 引数のファイル中の各行の最初の "foo" を "bar" で置き換える
ARGF.inplace_mode = '.bak'
ARGF.lines do |line|
print line.sub("foo","bar")
end
---- -i オプションを使う場合 ----
$ ruby -i.bak -p -e '$_.sub!("foo","bar")......' file.txt
---- -i オプションを使う場合その2 ----
$ ruby -i.bak -n -e 'print $_.sub("foo","bar")' file.txt
@see d:spec/rubycmd#cmd_option, ARGF.class#inplace_mode... -
Array
# []=(range , val) (55.0) -
Range オブジェクト range の範囲にある要素を配列 val の内容に置換します。 range の first が自身の末尾を越える時には配列の長さを自動的に拡張し、拡張した領域を nil で初期化します。
...が自身の末尾を越える時には配列の長さを自動的に拡張し、拡張した領域を nil で初期化します。
//emlist[例][ruby]{
ary = [0, 1, 2, 3, 4, 5]
ary[0..2] = ["a", "b"]
p ary # => ["a", "b", 3, 4, 5]
ary = [0, 1, 2]
ary[5..6] = "x"
p ary # => [0, 1, 2, nil, nil,......first や end の値が負の時には末尾からのインデックスと見倣します。
末尾の要素が -1 番目になります。
range の first が end より後にある場合には first の直前に val を挿入します。
//emlist[例][ruby]{
ary = [0, 1...... end までの要素が削除されます。
//emlist[例][ruby]{
ary = [0, 1, 2, 3, 4, 5]
ary[2..4] = []
p ary # => [0, 1, 5]
//}
@raise RangeError 指定された範囲の始点が自身の始点よりも前にある場合に発生します。
//emlist[例][ruby]{
a = [0, 1, 2, 3, 4, 5]
a[-10... -
OptionParser
# summary _ indent=(indent) (49.0) -
サマリを表示する時のインデントを文字列で指定します。
...//emlist[例][ruby]{
require "optparse"
opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
opts.summary_indent # => " "
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
opts.s......ummary_indent = " " # => " "
opts.summary_indent # => " "
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
//}... -
OptionParser
# summary _ width=(width) (49.0) -
サマリを表示するときの幅を整数で指定します。
...。
//emlist[例][ruby]{
require "optparse"
opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
opts.summary_width # => 32
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
opts.summar......y_width = 8 # => 8
opts.summary_width # => 8
opts.summarize
# => [" -i\n", " --init\n", " -u\n", " --update\n", " -h\n", " --help\n"]
//}... -
Array
# []=(start , length , val) (40.0) -
インデックス start から length 個の要素を配列 val の内容で置き換えます。 start が自身の末尾を越える時には配列の長さを自動的に拡張し、拡張した領域を nil で初期化します。
...が自身の末尾を越える時には配列の長さを自動的に拡張し、拡張した領域を nil で初期化します。
//emlist[例][ruby]{
ary = [0, 1, 2, 3]
ary[1, 2] = ["a", "b", "c", "d"]
p ary #=> [0, "a", "b", "c", "d", 3]
ary = [0, 1, 2]
ary[5, 1] = "Z"......指定します。
start の値が負の時には末尾からのインデックスと見倣します。
末尾の要素が -1 番目になります。
整数以外のオブジェクトを指定した場合は to_int メソッドによ
る暗黙の......以外のオブジェクトを指定した場合は to_int メソッドに
よる暗黙の型変換を試みます。
//emlist[例][ruby]{
ary = [0, 1, 2, 3]
ary[1, 0] = ["inserted"]
p ary # => [0, "inserted", 1, 2, 3]
//}
@param val 設定したい要素を配... -
Thread
# priority=(val) (31.0) -
スレッドの優先度を返します。この値が大きいほど優先度が高くなります。 メインスレッドのデフォルト値は 0 です。新しく生成されたスレッドは親スレッドの priority を引き継ぎます。
...フォームに依存します。
//emlist[例][ruby]{
Thread.current.priority # => 0
count1 = count2 = 0
a = Thread.new do
loop { count1 += 1 }
end
a.priority = -1
b = Thread.new do
loop { count2 += 1 }
end
b.priority = -2
count1 = count2 = 0 # reset
sleep 1 # => 1
count1... -
StringScanner
# pointer=(n) (25.0) -
スキャンポインタのインデックスを n にセットします。
...][ruby]{
require 'strscan'
s = StringScanner.new('test string')
p s.scan(/\w+/) # => "test"
p s.pos = 1 # => 1
p s.scan(/\w+/) # => "est"
p s.pos = 7 # => 7
p s.scan(/\w+/) # => "ring"
begin
s.pos = 20
rescue RangeError => err
puts err #=> index out of range
end
p s.pos = -4 # => -4...