261件ヒット
[1-100件を表示]
(0.096秒)
クラス
- Addrinfo (11)
- Array (19)
- Object (11)
-
Rake
:: FileList (187) - String (11)
モジュール
-
Rake
:: Cloneable (22)
検索結果
先頭5件
-
Addrinfo
# canonname -> String|nil (7.0) -
カノニカル名を文字列で返します。
...す。
カノニカル名は Addrinfo.getaddrinfo に Socket::AI_CANONINAME
を指定した場合にセットされます。
require 'socket'
list = Addrinfo.getaddrinfo("www.ruby-lang.org", 80, :INET, :STREAM, nil, Socket::AI_CANONNAME)
p list[0] #=> #<Addrinfo: 221.186.184.68:80 TCP carbo... -
Array
# pack(template) -> String (7.0) -
配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。
...l").unpack("l")[0]
n # => -2
//}
: IPアドレス
//emlist[][ruby]{
require 'socket'
official_hostname, alias_hostnames, address_family, *address_list = Socket.gethostbyname("localhost")
address_list.find {|address| address.size == 4 }.unpack("C4").join(".")
# => "127.0.0.1"
"127.0.0.1".split(".")... -
Array
# pack(template , buffer: String . new) -> String (7.0) -
配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。
...l").unpack("l")[0]
n # => -2
//}
: IPアドレス
//emlist[][ruby]{
require 'socket'
official_hostname, alias_hostnames, address_family, *address_list = Socket.gethostbyname("localhost")
address_list.find {|address| address.size == 4 }.unpack("C4").join(".")
# => "127.0.0.1"
"127.0.0.1".split(".")... -
Object
# respond _ to?(name , include _ all = false) -> bool (7.0) -
オブジェクトがメソッド name を持つとき真を返します。
...した事になります。
//emlist[][ruby]{
class F
def hello
"Bonjour"
end
end
class D
private
def hello
"Guten Tag"
end
end
list = [F.new,D.new]
list.each{|it| puts it.hello if it.respond_to?(:hello)}
#=> Bonjour
list.each{|it| it.instance_eval("puts hello if it.respond_to?... -
Rake
:: Cloneable # clone -> object (7.0) -
自身を複製します。
...リーズされています。
//emlist[][ruby]{
# Rakefile での記載例とする
task default: :test_rake_app
task :test_rake_app do
file_list = FileList['a.c', 'b.c']
clone = file_list.clone
clone # => ["a.c", "b.c"]
clone.exclude("a.c")
clone == file_list # => fa... -
Rake
:: Cloneable # dup -> object (7.0) -
自身と同じクラスのオブジェクトを作成後、自身のインスタンス変数を 全て新たに作成したオブジェクトにコピーします。
...クトにコピーします。
//emlist[][ruby]{
# Rakefile での記載例とする
task default: :test_rake_app
task :test_rake_app do
file_list = FileList['a.c', 'b.c']
file_list.freeze
dup = file_list.dup
clone = file_list.clone
dup.exclude("a.c") # => ["b.c"]
clone.exclude("a.c"... -
Rake
:: FileList # ==(array) -> bool (7.0) -
自身を配列に変換してから与えられた配列と比較します。
...列と比較します。
@param array 比較対象の配列を指定します。
//emlist[][ruby]{
# Rakefile での記載例とする
task default: :test_rake_app
task :test_rake_app do
file_list = FileList.new('lib/**/*.rb', 'test/test*.rb')
file_list == file_list.to_a # => true
end
//}... -
Rake
:: FileList # clear _ exclude -> self (7.0) -
登録されている除外リストをクリアします。
...ストをクリアします。
//emlist[][ruby]{
# Rakefile での記載例とする
task default: :test_rake_app
task :test_rake_app do
file_list = FileList.new("test.rb", "test.bak")
file_list.exclude("test.rb")
# DEFAULT_IGNORE_PATTERNS と "test.rb" の双方の除外がクリアされ... -
Rake
:: FileList # egrep(pattern) {|filename , count , line| . . . } (7.0) -
与えられたパターンをファイルリストから grep のように検索します。
...ample1", "line1\nline2\nline3\n")
IO.write("sample2", "line1\nline2\nline3\nline4\n")
task default: :test_rake_app
task :test_rake_app do
file_list = FileList.new('sample*')
file_list.egrep(/line/) # => 7
file_list.egrep(/.*/) do |filename, count, line|
"filename = #{filename}, count =... -
Rake
:: FileList # excluded _ from _ list?(file _ name) -> bool (7.0) -
与えられたファイル名が除外される場合は、真を返します。 そうでない場合は偽を返します。
...le での記載例とする
IO.write("test1.rb", "test")
IO.write("test2.rb", "test")
task default: :test_rake_app
task :test_rake_app do
file_list = FileList.new("test1.rb", "test2.rb")
file_list.exclude("test1.rb")
file_list.excluded_from_list?("test1.rb") # => true
file_list.excluded_fr...