1330件ヒット
[201-300件を表示]
(0.081秒)
別のキーワード
ライブラリ
- ビルトイン (58)
- csv (72)
- json (24)
-
net
/ http (408) - optparse (684)
-
rexml
/ streamlistener (12) - ripper (12)
-
ripper
/ filter (12) -
ripper
/ lexer (12) - uri (36)
クラス
- CSV (24)
-
CSV
:: FieldInfo (36) -
JSON
:: Parser (12) -
Net
:: HTTPGenericRequest (96) -
Net
:: HTTPResponse (96) - Object (16)
- OptionParser (600)
- Ripper (12)
-
Ripper
:: Filter (12) -
Ripper
:: Lexer (12) -
RubyVM
:: AbstractSyntaxTree :: Node (42) - String (12)
-
URI
:: MailTo (36)
モジュール
- Kernel (12)
-
Net
:: HTTPExceptions (12) -
Net
:: HTTPHeader (204) -
OptionParser
:: Arguable (84) -
REXML
:: StreamListener (12)
キーワード
- JSON (12)
- [] (12)
- accept (12)
-
basic
_ auth (12) - body (24)
- body= (12)
-
body
_ stream (12) -
body
_ stream= (12) - children (7)
- code (12)
-
content
_ length (12) -
content
_ range (12) -
content
_ type (12) - convert (24)
-
default
_ argv (12) -
default
_ argv= (12) - delete (12)
-
each
_ capitalized _ name (12) - entity (12)
- entitydecl (12)
- environment (12)
- fetch (36)
-
first
_ column (7) -
first
_ lineno (7) -
get
_ fields (12) - getopts (36)
- header (12)
- headers (12)
- help (12)
-
http
_ version (12) - index (12)
- inspect (7)
-
last
_ column (7) -
last
_ lineno (7) - line (12)
- load (12)
-
main
_ type (12) - method (24)
- msg (12)
- on (144)
-
on
_ head (12) -
on
_ tail (12) - order (48)
- order! (48)
- parse! (24)
-
parse
_ csv (12) - path (12)
- permute (24)
- permute! (24)
-
program
_ name (12) -
program
_ name= (12) -
proxy
_ basic _ auth (12) - range (12)
-
range
_ length (12) -
read
_ body (12) - reject (12)
- release (12)
-
request
_ body _ permitted? (12) - response (12)
-
response
_ body _ permitted? (12) - separator (12)
- source (12)
-
sub
_ type (12) - summarize (24)
-
summary
_ indent (12) -
summary
_ indent= (12) -
summary
_ width (12) -
summary
_ width= (12) -
to
_ a (12) -
to
_ mailtext (12) -
to
_ rfc822text (12) -
to
_ s (12) - value (12)
- ver (12)
-
yield
_ self (16)
検索結果
先頭5件
- OptionParser
# summarize(to = [] , width = self . summary _ width , max = width - 1 , indent= self . summary _ indent) {|line| . . . } -> () - OptionParser
# summary _ width -> Integer - OptionParser
# environment(env) -> [String] - RubyVM
:: AbstractSyntaxTree :: Node # children -> Array - RubyVM
:: AbstractSyntaxTree :: Node # first _ column -> Integer
-
OptionParser
# summarize(to = [] , width = self . summary _ width , max = width - 1 , indent= self . summary _ indent) {|line| . . . } -> () (9125.0) -
サマリを指定された to へと加えていきます。
...m width サマリの幅を整数で指定します。
@param max サマリの最大幅を整数で指定します。
@param indent サマリのインデントを文字列で指定します。
//emlist[例][ruby]{
require "optparse"
opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")......opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
opts.summarize(["description\n"], 10, 8, " ")
# => ["description\n", " -i\n", " --init\n", " -u\n", " --update\n", " -h\n", " --help\... -
OptionParser
# summary _ width -> Integer (9125.0) -
サマリを表示するときの幅を整数で返します。
...emlist[例][ruby]{
require "optparse"
opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
opts.summary_width # => 32
opts.summarize
# => [" -i, --init\n", " -u, --update\n", " -h, --help\n"]
opts.summary_width......= 8
opts.summary_width # =>8
opts.summarize
# => [" -i\n", " --init\n", " -u\n", " --update\n", " -h\n", " --help\n"]
//}... -
OptionParser
# environment(env) -> [String] (9123.0) -
環境変数 env に対して Shellwords.#shellwords を呼 んで配列にしてから parse を行ないます。
...を呼
んで配列にしてから parse を行ないます。
@param env 環境変数名を文字列で与えます。
@raise OptionParser::ParseError パースに失敗した場合、発生します。
実際は OptionParser::ParseError のサブク......す。
//emlist[例][ruby]{
require "optparse"
config = {}
opts = OptionParser.new
opts.on("-r", "--require LIBRARY"){|lib| config[:lib] = lib }
# HOGE_OPT は hoge というプログラム名に対応した名前です
ENV['HOGE_OPT'] = %q{--require lib1 'remain data'}
p opts.environment('HOGE_O......PT') # => ["remain data"]
p config # => {:lib=>"lib1"}
//}... -
RubyVM
:: AbstractSyntaxTree :: Node # children -> Array (9113.0) -
self の子ノードを配列で返します。
...type によって異なります。
戻り値は、ほかの RubyVM::AbstractSyntaxTree::Node のインスタンスや nil を含みます。
//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 2')
p node.children
# => [[], nil, #<RubyVM::AbstractSyntaxTree::Node:OPCALL@1:0-1:5>]
//}... -
RubyVM
:: AbstractSyntaxTree :: Node # first _ column -> Integer (9113.0) -
ソースコード中で、self を表すテキストが最初に現れる列番号を返します。
...ソースコード中で、self を表すテキストが最初に現れる列番号を返します。
列番号は0-originで、バイト単位で表されます。
//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 2')
p node.first_column # => 0
//}... -
RubyVM
:: AbstractSyntaxTree :: Node # first _ lineno -> Integer (9113.0) -
ソースコード中で、self を表すテキストが最初に現れる行番号を返します。
...ソースコード中で、self を表すテキストが最初に現れる行番号を返します。
行番号は1-originです。
//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 2')
p node.first_lineno # => 1
//}... -
OptionParser
# load(filename = nil) -> bool (6223.0) -
指定された filename を読み込んで各行をまとめたものに対して OptionParser#parse を行ないます。
...指定された filename を読み込んで各行をまとめたものに対して OptionParser#parse を行ないます。
パースが成功した場合に true を返します。
ファイルが存在しなかった場合に false を返します。
@param filename 各行をパースしたい......れないか nil である場合、~/.options/ に
プログラムのサフィックスを付けた '~/.options/コマンド名' というファイルをパースします。
//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") # => false
end
p options # => {:a=>true, :b=>true}
//}... -
CSV
:: FieldInfo # index -> Integer (6213.0) -
行内で何番目のフィールドかわかるゼロベースのインデックスを返します。
...ロベースのインデックスを返します。
//emlist[例][ruby]{
require 'csv'
csv = CSV.new("date1,date2\n2018-07-09,2018-07-10", headers: true)
csv.convert do |field,field_info|
p field_info.index
Date.parse(field)
end
p csv.first
# => 0
# => 1
# => #<CSV::Row "date1":#<Date: 2018-0... -
CSV
:: FieldInfo # line -> Integer (6213.0) -
行番号を返します。
...行番号を返します。
//emlist[例][ruby]{
require 'csv'
csv = CSV.new("date1,date2,date3\n2018-07-09,2018-07-10\n2018-08-09,2018-08-10", headers: true)
csv.convert do |field,field_info|
p field_info.line
Date.parse(field)
end
p csv.to_a
# => 2
# => 2
# => 3
# => 3
# => [#<CSV::Row "da......te1":#<Date: 2018-07-09 ((2458309j,0s,0n),+0s,2299161j)> "date2":#<Date: 2018-07-10 ((2458310j,0s,0n),+0s,2299161j)> "date3":nil>, ...]
//}... -
Net
:: HTTPHeader # main _ type -> String|nil (6213.0) -
"text/html" における "text" のようなタイプを表す 文字列を返します。
...タイプを表す
文字列を返します。
Content-Type: ヘッダフィールドが存在しない場合には nil を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.get_response(uri)
res.main_type # => "text"
//}... -
OptionParser
# order!(argv = self . default _ argv , into: nil) -> [String] (6213.0) -
与えられた argv を順番に破壊的にパースします。 argv からオプションがすべて取り除かれます。 argv を返します。
...efile)に出会うと、パースを中断します。
ブロックが与えられている場合は、パースを中断せずに
引数をブロックに渡してブロックを評価し、パースを継続します。argv を返します。
下の例で言うと、コマンドの引数 somefile......したい引数を文字列の配列で指定します。
@param into オプションを格納するハッシュを指定します。
指定したハッシュにはオプションの名前をキーとして、OptionParser#onに渡されたブロックの値が格納されます。......す。
@raise OptionParser::ParseError パースに失敗した場合、発生します。
実際は OptionParser::ParseError のサブク
ラスになります。
//emlist[opt.rb][ruby]{
require 'optparse'
opt = OptionParser.new
opt...