別のキーワード
ライブラリ
- ビルトイン (12)
- coverage (8)
- csv (48)
- pp (20)
- prettyprint (12)
- rake (24)
- readline (12)
-
ripper
/ lexer (36) -
ripper
/ sexp (24) -
rubygems
/ requirement (36) - socket (24)
-
webrick
/ httpproxy (12)
クラス
- CSV (48)
- Coverage (8)
-
Gem
:: Requirement (36) - PP (20)
- PrettyPrint (12)
- Ripper (60)
-
RubyVM
:: InstructionSequence (12) - Socket (24)
-
WEBrick
:: HTTPProxyServer (12)
キーワード
- application (12)
- application= (12)
-
compile
_ option (12) -
completion
_ append _ character= (12) - create (12)
- default (12)
- format (12)
- getaddrinfo (12)
- getifaddrs (12)
- lex (12)
- new (24)
- parse (24)
- read (12)
- readlines (12)
- sexp (12)
-
sexp
_ raw (12) -
sharing
_ detection (4) -
sharing
_ detection= (4) - slice (12)
- start (8)
- tokenize (12)
検索結果
先頭5件
-
PP
. pp(obj , out = $ > , width = 79) -> object (35126.0) -
指定されたオブジェクト obj を出力先 out に幅 width で出力します。 出力先 out を返します。
...。<< メソッドが定義されている必要があります。
@param width 出力先の幅を指定します。
//emlist[][ruby]{
require 'pp'
str = PP.pp(b], [:a, [[:a, [:a, [:a, :b], [:a, :b],]]], '', 20)
puts str
# =>
# [[:a, :b],
# [:a,
# [[:a,
# [:a, [:a, :b]]],
# [:a, :b]]]]... -
PP
. sharing _ detection -> bool (17063.0) -
共有検出フラグを表すアクセサです。 デフォルトは false です。true である場合、 PP.pp は一度出力したオブジェクトを再び出力する時 Object#pretty_print_cycle を使います。
...true である場合、
PP.pp は一度出力したオブジェクトを再び出力する時
Object#pretty_print_cycle を使います。
@param boolean 共有検出フラグを true か false で指定します。
//emlist[][ruby]{
require 'pp'
b = [1, 2, 3]
a = [b, b]
pp a......#=> [[1, 2, 3], [1, 2, 3]]
PP.sharing_detection = true
pp a #=> [[1, 2, 3], [...]]
//}... -
PP
. sharing _ detection=(boolean) (17063.0) -
共有検出フラグを表すアクセサです。 デフォルトは false です。true である場合、 PP.pp は一度出力したオブジェクトを再び出力する時 Object#pretty_print_cycle を使います。
...true である場合、
PP.pp は一度出力したオブジェクトを再び出力する時
Object#pretty_print_cycle を使います。
@param boolean 共有検出フラグを true か false で指定します。
//emlist[][ruby]{
require 'pp'
b = [1, 2, 3]
a = [b, b]
pp a......#=> [[1, 2, 3], [1, 2, 3]]
PP.sharing_detection = true
pp a #=> [[1, 2, 3], [...]]
//}... -
Rake
. application -> Rake :: Application (6219.0) -
現在の Rake アプリケーションを返します。
...プリケーションを返します。
//emlist[][ruby]{
# Rakefile での記載例とする
require 'pp'
task default: :test_rake_app
task :test_rake_app do
pp Rake.application
end
# => #<Rake::Application:0x31b0f18
# @default_loader=#<Rake::DefaultLoader:0x31b0c78>,
# @imported=[],......ile", "rakefile.rb", "Rakefile.rb"],
# @rules=[],
# @scope=LL(),
# @tasks=
# {"default"=><Rake::Task default => [test_rake_app]>,
# "test_rake_app"=><Rake::Task test_rake_app => []>},
# @terminal_columns=0,
# @top_level_tasks=["default"],
# @tty_output=false>
//}... -
Rake
. application=(app) (6219.0) -
現在の Rake アプリケーションをセットします。
...@param app Rake::Application のインスタンスを指定します。
//emlist[][ruby]{
# Rakefile での記載例とする
require 'pp'
task default: :test_rake_app
task :test_rake_app do
app = Rake::Application.new
app.tty_output = true
Rake.application = app
pp Rake.application
end......# => #<Rake::Application:0x00005624e6c30eb8
# @default_loader=#<Rake::DefaultLoader:0x00005624e6c30cd8>,
# @imported=[],
# @last_description=nil,
# @loaders=
# {".rb"=>#<Rake::DefaultLoader:0x00005624e6c30bc0>,
# ".rf"=>#<Rake::DefaultLoader:0x00005624e6c30b48>,
#......_system=false, nosearch=false, rakelib=["rakelib"], show_all_tasks=false, show_prereqs=false, show_task_pattern=nil, show_tasks=nil, silent=false, suppress_backtrace_pattern=nil, thread_pool_size=20, trace=false, trace_output=#<IO:<STDERR>>, trace_rules=false>,
# @original_dir="/path/to/dir",
#... -
Readline
. completion _ append _ character=(string) (6113.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... -
Gem
:: Requirement . new(requirements) -> Gem :: Requirement (3207.0) -
Gem::Requirement のインスタンスを作成します。
...m::Requirement のインスタンスを作成します。
@param requirements 文字列か配列か Gem::Version のインスタンスを指定します。
//emlist[][ruby]{
pp Gem::Requirement.new("~> 3.2.1")
# => Gem::Requirement.new(["~> 3.2.1"])
//}
@see Gem::Requirement#parse, Gem::Requireme... -
WEBrick
:: HTTPProxyServer . new(config , default = WEBrick :: Config :: HTTP) -> WEBrick :: HTTPProxyServer (3137.0) -
プロクシオブジェクトを生成して返します。
...list{
require 'webrick'
require 'webrick/httpproxy'
auth_proc = proc{|req, res|
unless c = req['proxy-authorization']
res['Proxy-Authenticate'] = 'Basic realm="WEBrick Proxy"'
raise WEBrick::HTTPStatus::ProxyAuthenticationRequired
else
# 略
end
}
s = WEBrick::HTTPProxyS......せん。デフォルトは nil です。
//emlist{
require 'webrick'
require 'webrick/httpproxy'
handler = proc{|req, res|
res.body.gsub!(/です。/, 'でんがな。')
res.body.gsub!(/ます。/, 'まんがな。')
}
s = WEBrick::HTTPProxyServer.new(ProxyContentHandler: handler, Port:......使う場合にその Proxy の URI
を URI オブジェクトで指定します。
//emlist{
require 'uri'
require 'webrick/httpproxy'
u = URI.parse('http://localhost:18080/')
s = WEBrick::HTTPProxyServer.new(ProxyURI: u, Port: 8080)
//}
@param default デフォルトは WEBrick::Config:... -
Ripper
. lex(src , filename = & # 39;-& # 39; , lineno = 1) -> [[Integer , Integer] , Symbol , String , Ripper :: Lexer :: State] (3113.0) -
Ruby プログラム str をトークンに分割し、そのリストを返します。 ただし Ripper.tokenize と違い、トークンの種類と位置情報も付属します。
...Ruby プログラム str をトークンに分割し、そのリストを返します。
ただし Ripper.tokenize と違い、トークンの種類と位置情報も付属します。
@param src Ruby プログラムを文字列か IO オブジェクトで指定します。
@param filename src......-" になります。
@param lineno src の開始行番号を指定します。省略すると 1 になります。
//emlist[][ruby]{
require 'ripper'
pp Ripper.lex("def m(a) nil end")
# => [[[1, 0], :on_kw, "def", EXPR_FNAME],
# [[1, 3], :on_sp, " ", EXPR_FNAME],
# [[1, 4], :on_ident,......1, 8], :on_sp, " ", EXPR_BEG],
# [[1, 9], :on_kw, "nil", EXPR_END],
# [[1, 12], :on_sp, " ", EXPR_END],
# on_kw, "end", EXPR_END
//}
Ripper.lex は分割したトークンを詳しい情報とともに返します。
返り値の配列の要素は 4 要素の配列 (概念的にはタ......" になります。
@param lineno src の開始行番号を指定します。省略すると 1 になります。
//emlist[][ruby]{
require 'ripper'
pp Ripper.lex("def m(a) nil end")
# => [[[1, 0], :on_kw, "def", FNAME],
# [[1, 3], :on_sp, " ", FNAME],
# [[1, 4], :on_ident, "m", ENDFN......")", ENDFN],
# [[1, 8], :on_sp, " ", BEG],
# [[1, 9], :on_kw, "nil", END],
# [[1, 12], :on_sp, " ", END],
# on_kw, "end", END
//}
Ripper.lex は分割したトークンを詳しい情報とともに返します。
返り値の配列の要素は 4 要素の配列 (概念的にはタ... -
Ripper
. lex(src , filename = & # 39;-& # 39; , lineno = 1 , raise _ errors: false) -> [[Integer , Integer] , Symbol , String , Ripper :: Lexer :: State] (3113.0) -
Ruby プログラム str をトークンに分割し、そのリストを返します。 ただし Ripper.tokenize と違い、トークンの種類と位置情報も付属します。
...Ruby プログラム str をトークンに分割し、そのリストを返します。
ただし Ripper.tokenize と違い、トークンの種類と位置情報も付属します。
@param src Ruby プログラムを文字列か IO オブジェクトで指定します。
@param filename src......ます。
@raise SyntaxError raise_errors が true で、src に文法エラーがある場合に発生します。
//emlist[][ruby]{
require 'ripper'
pp Ripper.lex("def m(a) nil end")
# => [[[1, 0], :on_kw, "def", FNAME],
# [[1, 3], :on_sp, " ", FNAME],
# [[1, 4], :on_ident, "m", ENDFN......9], :on_kw, "nil", END],
# [[1, 12], :on_sp, " ", END],
# on_kw, "end", END
Ripper.lex("def req(true) end", raise_errors: true)
# => SyntaxError (syntax error, unexpected `true', expecting ')')
//}
Ripper.lex は分割したトークンを詳しい情報とともに返します。
返り... -
Gem
:: Requirement . create(input) -> Gem :: Requirement (3107.0) -
Gem::Requirement のインスタンスを作成するためのファクトリメソッドです。
...Gem::Requirement のインスタンスを作成するためのファクトリメソッドです。
@param input 文字列か配列か Gem::Requirement, Gem::Version のインスタンス
のいずれかを指定します。
@return 上記以外の値を input に指定するとデフ......ォルト値を返します。
//emlist[][ruby]{
pp Gem::Requirement.create("~> 3.2.1")
# => Gem::Requirement.new(["~> 3.2.1"])
//}
@see Gem::Requirement.new, Gem::Requirement.default...