84件ヒット
[1-84件を表示]
(0.038秒)
別のキーワード
ライブラリ
- ビルトイン (12)
- bigdecimal (12)
- optparse (12)
- rake (24)
-
rake
/ loaders / makefile (12) - rubygems (12)
クラス
- BigDecimal (12)
- Module (12)
- OptionParser (12)
-
Rake
:: Application (12) -
Rake
:: DefaultLoader (12) -
Rake
:: MakefileLoader (12)
モジュール
- Kernel (12)
キーワード
-
_ dump (12) -
add
_ loader (12) - autoload (12)
- gem (12)
検索結果
先頭5件
-
Rake
:: DefaultLoader # load(filename) (21120.0) -
与えられたファイルをロードします。
...与えられたファイルをロードします。
@param filename ロードするファイル名を指定します。
//emlist[][ruby]{
require 'rake'
loader = Rake::DefaultLoader.new
loader.load("path/to/Rakefile") # => true
//}... -
Rake
:: MakefileLoader # load(filename) (21120.0) -
与えられた Makefile をロードします。
...た Makefile をロードします。
@param filename 読み込む Makefile の名前を指定します。
//emlist[][ruby]{
# Rakefile での記載例とする
require "rake/loaders/makefile"
task default: :test_rake_app
open "sample.mf", "w" do |io|
io << <<-'SAMPLE_MF'
# Comments
a: a1 a2 a......d: Comment
b7
a : a5 a6 a7
c: c1
d: d1 d2 \
e f : e1 f1
g\ 0: g1 g\ 2 g\ 3 g4
SAMPLE_MF
end
task :test_rake_app do |task|
loader = Rake::MakefileLoader.new
loader.load("sample.mf")
p Rake::Task.task_defined?("a") # => true
p Rake::Task.tasks[0] # => <Rake::FileTask a => [a1, a2, a3, a4,... -
OptionParser
# load(filename = nil) -> bool (18126.0) -
指定された filename を読み込んで各行をまとめたものに対して OptionParser#parse を行ないます。
...。
//emlist[例][ruby]{
require "optparse"
IO.write("options.txt", %w(-a --b).join("\n"))
options = { a: false, b: false }
OptionParser.new do |opt|
opt.on('-a') { |v| options[:a] = v }
opt.on('--b') {|v| options[:b] = v }
opt.load("options.txt") # => true
opt.load("not_exist.txt") # =>... -
Rake
:: Application # add _ loader(ext , loader) (6219.0) -
与えられた拡張子で終わるファイル名のファイルをロードするためのローダーを 自身に追加します。
...@param loader ローダーを指定します。
//emlist[例][ruby]{
require "rake/loaders/makefile"
# Rakefile での記載例とする
task default: :test
task :test
makefile =<<-EOS
<< <<-'SAMPLE_MF'
# Comments
a: a1 a2 a3 a4
EOS
IO.write("sample.mf", makefile)
Rake.application.add_loader("mf......", Rake::MakefileLoader.new)
Rake.application.add_import("sample.mf")
Rake::Task.task_defined?("a") # => false
Rake.application.load_imports
Rake::Task.task_defined?("a") # => true
//}... -
Module
# autoload(const _ name , feature) -> nil (6141.0) -
定数 const_name を最初に参照した時に feature を Kernel.#require するように設定します。
...照した時に feature を Kernel.#require するように設定します。
const_name が autoload 設定されていて、まだ定義されてない(ロードされていない)ときは、
autoload する対象を置き換えます。
const_name が(autoloadではなく)既に定義されて......定できません。
@param feature Kernel.#require と同様な方法で autoload する対象を指定する。
//emlist[例][ruby]{
# ------- /tmp/foo.rb ---------
class Foo
class Bar
end
end
# ----- end of /tmp/foo.rb ----
class Foo
autoload :Bar, '/tmp/foo'
end
p Foo::Bar #=> Foo::Bar......出すこともできます。
//emlist[例][ruby]{
# ------- /tmp/foo.rb ---------
class Foo
class Bar
end
end
# ----- end of /tmp/foo.rb ----
class Foo
end
Foo.autoload :Bar, '/tmp/foo'
p Foo::Bar #=> Foo::Bar
//}
以下のように、autoload したライブラリがネストした定数... -
Kernel
# gem(gem _ name , *version _ requirements) -> bool (145.0) -
$LOAD_PATH に Ruby Gem を追加します。
...$LOAD_PATH に Ruby Gem を追加します。
指定された Gem をロードする前にその Gem が必要とする Gem をロードします。
バージョン情報を省略した場合は、最も高いバージョンの Gem をロードします。
指定された Gem やその Gem が必......った場合は
Gem::LoadError が発生します。
バージョンの指定方法に関しては Gem::Version を参照してください。
rubygems ライブラリがライブラリバージョンの衝突を検出しない限り、
gem メソッドは全ての require メソッドよりも前......ために使用できます。
例:
GEM_SKIP=libA:libB ruby-I../libA -I../libB ./mycode.rb
@param gem Gem の名前の文字列か、Gem の依存関係を Gem::Dependency のインスタンスで指定します。
@param version_requirements 必要とする gem のバージョンを指定し... -
BigDecimal
# _ dump -> String (47.0) -
BigDecimal._load で復元可能な文字列を返します。 Marshal.#dump から呼び出されます。
...BigDecimal._load で復元可能な文字列を返します。
Marshal.#dump から呼び出されます。
//emlist[][ruby]{
require 'bigdecimal'
inf = BigDecimal('Infinity') # => Infinity
s = Marshal.dump(inf) # => "\x04\bu:\x0FBigDecimal\x0F9:Infinity"
Marshal.load(s) # => I......nfinity
//}
@see BigDecimal._load, Marshal.#dump, Marshal.#load...