27件ヒット
[1-27件を表示]
(0.040秒)
検索結果
-
JSON
. # parse!(source , options = {}) -> object (18212.0) -
与えられた JSON 形式の文字列を Ruby オブジェクトに変換して返します。
...文字列のみを入力として使用するようにしてください。
@param source JSON 形式の文字列を指定します。
@param options オプションをハッシュで指定します。
指定可能なオプションは以下の通りです。
: :max_nesting
入れ子に......す。
: :create_additions
偽を指定するとマッチするクラスや JSON.create_id が見つかっても付加情報を生成しません。
デフォルトは偽です。
//emlist[例][ruby]{
require "json"
json_text = "[1,2,{\"name\":\"tanaka\",\"age\":19}, NaN]"
JSON.parse!(json_tex......t)
# => [1, 2, {"name"=>"tanaka", "age"=>19}, NaN]
JSON.parse!(json_text, symbolize_names: true)
# => [1, 2, {:name=>"tanaka", :age=>19}, NaN]
JSON.parse(json_text) # => unexpected token at 'NaN]' (JSON::ParserError)
//}
@see JSON::Parser#parse... -
ruby 1
. 8 . 4 feature (54.0) -
ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。
.../File.join [bug]>))
* ((<ruby 1.8.4 feature/Thread#pass [bug]>))
* ((<ruby 1.8.4 feature/Module#const_missing [bug]>))
* ((<ruby 1.8.4 feature/IO [bug]>))
* ((<ruby 1.8.4 feature/添付ライブラリ>))
* ((<ruby 1.8.4 feature/"Ruby/Tk">))
* ((<ruby 1.8.4 feature/REXML [compat]>))
* ((<......られていたバグの修正。
require "optparse"
puts "[#{ARGV * ', '}]"
ARGV.options do |opt|
opt.on("-n NODE") {|v| puts v }
opt.parse!
end
>ruby -v -Ku a.rb -n 時間
ruby 1.8.2 (2004-12-25) [i386-mswin32]
[-n, 時......allocate X509V3_CTX.
#
# * ext/openssl/ossl_x509ext.c (ossl_x509extfactory_create_ext): use
# X509V3_EXT_nconf_nid to avoid SEGV (and to build extensions which
# values are placed in separate section).
#
# * test/openssl/test_x509ext.rb: new file.
#
# ?
#Tue Nov 01 10:... -
NEWS for Ruby 2
. 7 . 0 (24.0) -
NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...で呼び出すと
例外が発生するようになりました。
//emlist[][ruby]{
def bar
lambda
end
bar { puts "Hello" } #=> tried to create Proc object without a block (ArgumentError)
//}
==== その他の変更
* 始端なしRangeが実験的に導入されました。
caseやC......omparable#clampや定数やDSLなどで便利かもしれません。
14799
//emlist[][ruby]{
ary[..3] # identical to ary[0..3]
case RUBY_VERSION
when ..."2.4" then puts "EOL"
# ...
end
age.clamp(..100)
where(sales: ..100)
//}
* 「$;」にnil以外の値を設定すると警告が出る......OptionParser.new do |opts|
opts.on("-f", "--foo", "foo") {|v| }
opts.on("-b", "--bar", "bar") {|v| }
opts.on("-c", "--baz", "baz") {|v| }
end.parse!
//}
//emlist{
$ ruby test.rb --baa
Traceback (most recent call last):
test.rb:7:in `<main>': invalid option: --baa (OptionParser::InvalidOption)...