37件ヒット
[1-37件を表示]
(0.065秒)
別のキーワード
キーワード
- bigdecimal (12)
- open-uri (12)
-
rubygems
/ commands / generate _ index _ command (12) -
test
/ unit (1)
検索結果
-
rubygems
/ commands / generate _ index _ command (26019.0) -
ある Gem サーバに対するインデックスを作成するためのライブラリです。
...作成するためのライブラリです。
Usage: gem generate_index [options]
Options:
-d, --directory=DIRNAME repository base dir containing gems subdir
Common Options:
-h, --help このコマンドのヘルプを表示します
-V, --......た設定ファイルを使用します
--backtrace バックトレースを表示します
--debug Ruby 自体のデバッグオプションを有効にします
Summary:
Generates the index files for a gem server directory
Des......the inflate algorithm.
The
Marshal version number comes from ruby's Marshal::MAJOR_VERSION and
Marshal::MINOR_VERSION constants. It is used to ensure compatibility. The
yaml indexes exist for legacy RubyGems clients and fallback in case of
Marshal
version change... -
bigdecimal (199.0)
-
bigdecimal は浮動小数点数演算ライブラリです。 任意の精度で 10 進表現された浮動小数点数を扱えます。
...ecimal は浮動小数点数演算ライブラリです。
任意の精度で 10 進表現された浮動小数点数を扱えます。
//emlist[][ruby]{
require 'bigdecimal'
a = BigDecimal("0.123456789123456789")
b = BigDecimal("123456.78912345678", 40)
print a + b # => 0.123456912580245903456789e......きます。
//emlist[例1: 0.0001 を 10000 回足す場合。][ruby]{
sum = 0
for i in (1..10000)
sum = sum + 0.0001
end
print sum # => 0.9999999999999062
//}
//emlist[例2: 0.0001 を 10000 回足す場合。(BigDecimal)][ruby]{
require 'bigdecimal'
sum = BigDecimal("0")
for i in (1..10000)......sum = sum + BigDecimal("0.0001")
end
print sum # => 0.1e1
//}
//emlist[例3: 1.2 - 1.0 と 0.2 との比較][ruby]{
require "bigdecimal"
(BigDecimal("1.2") - BigDecimal("1.0")) == BigDecimal("0.2") # => true
(1.2 - 1.0) == 0.2 # => false
//}
=== 特別な値
正確な計算結果の提供の... -
open-uri (67.0)
-
http/ftp に簡単にアクセスするためのクラスです。
...定義します。
=== 使用例
http/ftp の URL を、普通のファイルのように開けます。
require 'open-uri'
open("http://www.ruby-lang.org/") {|f|
f.each_line {|line| p line}
}
開いたファイルオブジェクトは StringIO もしくは Tempfile で
すが OpenURI:......を獲得する
メソッドが使えます。
require 'open-uri'
open("http://www.ruby-lang.org/en") {|f|
f.each_line {|line| p line}
p f.base_uri # <URI::HTTP:0x40e6ef2 URL:http://www.ruby-lang.org/en/>
p f.content_type # "text/html"
p f.charset # "iso-885......ダフィールドを指定できます。
require 'open-uri'
open("http://www.ruby-lang.org/en/",
"User-Agent" => "Ruby/#{RUBY_VERSION}",
"From" => "foo@bar.invalid",
"Referer" => "http://www.ruby-lang.org/") {|f|
...
}
http_proxy, ftp_proxy, no_proxy などの環境変数......スです。
=== 使用例
http/ftp の URL を、普通のファイルのように開けます。
require 'open-uri'
URI.open("http://www.ruby-lang.org/") {|f|
f.each_line {|line| p line}
}
開いたファイルオブジェクトは StringIO もしくは Tempfile で
すが OpenURI::M......獲得する
メソッドが使えます。
require 'open-uri'
URI.open("http://www.ruby-lang.org/en") {|f|
f.each_line {|line| p line}
p f.base_uri # <URI::HTTP:0x40e6ef2 URL:http://www.ruby-lang.org/en/>
p f.content_type # "text/html"
p f.charset # "iso-88......フィールドを指定できます。
require 'open-uri'
URI.open("http://www.ruby-lang.org/en/",
"User-Agent" => "Ruby/#{RUBY_VERSION}",
"From" => "foo@bar.invalid",
"Referer" => "http://www.ruby-lang.org/") {|f|
...
}
http_proxy, ftp_proxy, no_proxy などの環境変数... -
test
/ unit (61.0) -
ユニットテストを行うためのライブラリです。
...:Unit - Ruby用単体テストフレームワーク: https://test-unit.github.io/
なお、2.2.0より前のtest/unit は当時バンドルしていた minitest/unit を使って再実装し
ていましたが、上記のtest/unitと完全な互換性がある訳ではありません。
Rubyのテ......Don't retry running testcase when --jobs specified
--ruby VAL Path to ruby; It'll have used at -j option
-q, --hide-skip Hide skipped tests
-b, --basedir=DIR Base directory of test suites.
-x, --exclude PATTERN......Exclude test files on pattern.
-Idirectory Add library load path
--[no-]gc-stress Set GC.stress as true
複数のテストを一度に行う場合、以下のように書いただけのファイルを実行します。
require 'test/unit'
requir...