種類
- 特異メソッド (48)
- 文書 (29)
- インスタンスメソッド (14)
- モジュール関数 (12)
モジュール
-
OpenSSL
:: ASN1 (12) - Readline (24)
キーワード
- << (7)
- >> (7)
-
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 3
. 0 . 0 (5) -
NEWS for Ruby 3
. 1 . 0 (4) -
completion
_ append _ character (12) -
completion
_ append _ character= (12) - decode (12)
- readlines (12)
-
ruby 1
. 8 . 5 feature (12)
検索結果
先頭5件
-
CSV
. read(path , options = Hash . new) -> [Array] | CSV :: Table (18125.0) -
CSV ファイルを配列の配列にするために使います。 headers オプションに偽でない値を指定した場合は CSV::Table オブジェクトを返します。
...なければなりません。
//emlist[例][ruby]{
require "csv"
require "pp"
File.write("test.csv", <<CSV)
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
CSV
pp CSV.read("test.csv")
# => [["id", "first name", "last name", "age"],
# ["1", "taro",......"csv"
File.write("test.csv", <<CSV)
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
CSV
table = CSV.read("test.csv", headers: true)
p table.class # => CSV::Table
p table[0] # => #<CSV::Row "id":"1" "first name":"taro" "last name":"tanaka" "age":"20"... -
Readline
. completion _ append _ character -> String (9100.0) -
ユーザの入力の補完が完了した場合に、最後に付加する文字を取得します。
...ユーザの入力の補完が完了した場合に、最後に付加する文字を取得します。
@raise NotImplementedError サポートしていない環境で発生します。
@see Readline.completion_append_character=... -
Readline
. completion _ append _ character=(string) (9100.0) -
ユーザの入力の補完が完了した場合に、最後に付加する文字 string を指定します。
..."」などの単語を区切る文字を指定すれば、
連続して入力する際に便利です。
require 'readline'
Readline.readline("> ", true)
Readline.completion_append_character = " "
> /var/li
ここで補完(TABキーを押す)を行う。
> /var/lib
最後に" "が追......ることはできないため、
例えば、"string"を指定した場合は最初の文字である"s"だけを使用します。
require 'readline'
Readline.completion_append_character = "string"
p Readline.completion_append_character # => "s"
@see Readline.completion_append_character... -
CSV
. readlines(path , options = Hash . new) -> [Array] | CSV :: Table (6125.0) -
CSV ファイルを配列の配列にするために使います。 headers オプションに偽でない値を指定した場合は CSV::Table オブジェクトを返します。
...なければなりません。
//emlist[例][ruby]{
require "csv"
require "pp"
File.write("test.csv", <<CSV)
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
CSV
pp CSV.read("test.csv")
# => [["id", "first name", "last name", "age"],
# ["1", "taro",......"csv"
File.write("test.csv", <<CSV)
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
CSV
table = CSV.read("test.csv", headers: true)
p table.class # => CSV::Table
p table[0] # => #<CSV::Row "id":"1" "first name":"taro" "last name":"tanaka" "age":"20"... -
NEWS for Ruby 3
. 1 . 0 (36.0) -
NEWS for Ruby 3.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...* Thread
* 新規メソッド
* Thread#native_thread_id が追加されました。 17853
* Thread::Backtrace
* 新規メソッド
* --backtrace-limit コマンドラインオプションで設定したバックトレースの長さを制限する値を返す Thread::Backt......race.limit が追加されました。 17479
* Thread::Queue
* 変更されたメソッド
* Thread::Queue.new が、初期値のEnumerableオブジェクトを渡せるようになりました。 17327
* Time
* 変更されたメソッド
* Time.new は、Time.at や Time........2.0
* openssl 3.0.0
* optparse 0.2.0
* ostruct 0.5.2
* pathname 0.2.0
* pp 0.3.0
* prettyprint 0.1.1
* psych 4.0.3
* racc 1.6.0
* rdoc 6.4.0
* readline 0.0.3
* readline-ext 0.1.4
* reline 0.3.0
* resolv 0.2.1
* rinda 0.1.1
* ruby2_keywords... -
NEWS for Ruby 3
. 0 . 0 (24.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...[[[1]], {}]
pr.call([1, {a: 1}])
# 2.7 => [[1], {:a=>1}] # and deprecation warning
# 3.0 => a=>1}, {}]
//}
* Arguments forwarding (`...`) now supports leading arguments.
16378
//emlist{
def method_missing(meth, ...)
send(:"do_#{meth}", ...)
end
//}
* Pattern matching (`case/in`) is......ERIMENTAL]
16828
//emlist{
case ["a", 1, "b", "c", 2, "d", "e", "f", 3]
in [*pre, String => x, String => y, *post]
p pre #=> ["a", 1]
p x #=> "b"
p y #=> "c"
p post #=> [2, "d", "e", "f", 3]
end
//}
* Endless method definition is added. [EXPERIMENTAL]
16746
//emlist{
def......keyword option. 8709
* ENV
* ENV.except has been added, which returns a hash excluding the given keys and their values. 15822
* Windows: Read ENV names and values as UTF-8 encoded Strings 12650
* Encoding
* Added new encoding IBM720. 16233
* Changed default for Encoding.defaul... -
OpenSSL
:: ASN1 . # decode(der) -> OpenSSL :: ASN1 :: ASN1Data (18.0) -
DER 表現の文字列を解析し、そこにエンコードされている ASN.1 の値を OpenSSL::ASN1::ASN1Data のサブクラスのインスタンスとして返します。
...れを構成する要素も再帰的に解析します。
例:
ruby -e '
require "openssl"
require "pp"
pem = File.read(ARGV[0])
cert = OpenSSL::X509::Certificate.new(pem)
pp OpenSSL::ASN1.decode(cert.to_der)
' mycert.pem
#<OpenSSL::ASN1::Sequence:0x814e9fc
@tag=16,
@tag_clas... -
ruby 1
. 8 . 5 feature (18.0) -
ruby 1.8.5 feature ruby 1.8.4 から ruby 1.8.5 までの変更点です。
...ck [new]
: UDPSocket#recvfrom_nonblock [new]
追加
=== 2006-06-17
: Pathname(path) [new]
pathname で追加
: Kernel#pretty_inspect [new]
pp で追加
: RSS::TaxonomyTopicModel [new]
: RSS::TaxonomyTopicsModel [new]
: RSS::Maker::TaxonomyTopicModel [new]
: RSS::Maker::TaxonomyTopicsMod......: RSS::RootElementMixin#to_xml [new]
こんな風にすると、RSS 1.0からRSS 2.0に変換できます。
rss10 = RSS::Parser.parse(File.read("1.0.rdf"))
File.open("2.0.rss", "w") {|f| f.print(rss10.to_xml("2.0"))}
((<ruby-talk:197284>))
: RSS::VERSION
"0.1.5"から"0.1.6"に......IXSocket#recvfrom_nonblock [new]
: TCPServer#accept_nonblock [new]
: UNIXServer#accept_nonblock [new]
((<ruby-core:7925>))
=== 2006-05-22
: IO#read_nonblock [new]
: IO#write_nonblock [new]
: Socket#connect_nonblock [new]
: Socket#accept_nonblock [new]
: Socket#recvfrom_nonblock [new]
((<ruby... -
Method
# <<(callable) -> Proc (12.0) -
self と引数を合成した Proc を返します。
...uby]{
class WordScanner
def self.call(str)
str.scan(/\w+/)
end
end
File.write('testfile', <<~TEXT)
Hello, World!
Hello, Ruby!
TEXT
pipeline = method(:pp) << WordScanner << File.method(:read)
pipeline.call('testfile') # => ["Hello", "World", "Hello", "Ruby"]
//}
@see Proc#<<, Proc#>>... -
Method
# >>(callable) -> Proc (12.0) -
self と引数を合成した Proc を返します。
...uby]{
class WordScanner
def self.call(str)
str.scan(/\w+/)
end
end
File.write('testfile', <<~TEXT)
Hello, World!
Hello, Ruby!
TEXT
pipeline = File.method(:read) >> WordScanner >> method(:pp)
pipeline.call('testfile') # => ["Hello", "World", "Hello", "Ruby"]
//}
@see Proc#<<, Proc#>>... -
NEWS for Ruby 2
. 5 . 0 (12.0) -
NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...黙の to_s 呼び出しにも refinements が影響するようになりました 13812
=== 組み込みクラスの更新
* Array
* Array#append を追加 12746
* Array#prepend を追加 12746
* Data
* 非推奨になりました。C拡張のベースクラスでしたが、Ruby......8.1 以降で、ReFSの128bitのinoをサポートしました 13731
* File.readable?, File.readable_real?, File.writable?, File.writable_real?,
File.executable?, File.executable_real?, File.mkfifo, File.readlink,
File.truncate, File#truncate, File.chmod, File.lchmod, File.chown,......* IO#pread を追加 4532
* IO#pwrite を追加 4532
* IO#write 複数の引数を受け取れるようになりました 9323
* IOError
* IO#close 以前は"stream closed"というメッセージの例外が発生していましたが、"stream closed in another thread"という...