別のキーワード
ライブラリ
- ビルトイン (562)
- csv (36)
- digest (12)
- openssl (24)
- pathname (407)
- rake (96)
-
rdoc
/ code _ object (12) -
rubygems
/ package / tar _ writer (48) - shell (6)
-
shell
/ command-processor (6) -
shell
/ filter (18) - tempfile (36)
- zlib (36)
クラス
-
ARGF
. class (24) - BasicObject (24)
- Binding (19)
- CSV (36)
-
Digest
:: Base (12) - Dir (11)
- File (24)
-
File
:: Stat (12) -
Gem
:: Package :: TarWriter (48) - IO (360)
- Method (14)
-
OpenSSL
:: Config (12) -
OpenSSL
:: X509 :: Store (12) - Pathname (407)
- Proc (14)
-
RDoc
:: CodeObject (12) -
Rake
:: FileList (96) -
RubyVM
:: InstructionSequence (48) - Shell (6)
-
Shell
:: CommandProcessor (6) -
Shell
:: Filter (18) - String (12)
- Tempfile (36)
-
Zlib
:: GzipFile :: Error (12) -
Zlib
:: GzipWriter (24)
キーワード
- << (38)
- <=> (12)
- > (6)
- >> (20)
-
absolute
_ path (12) -
add
_ file (36) -
add
_ file _ simple (24) -
add
_ row (12) - ascend (24)
- atime (12)
-
base
_ label (12) - basename (12)
- birthtime (11)
- chmod (12)
- chown (12)
-
clear
_ exclude (12) - clone (12)
- close (12)
-
close
_ on _ exec= (12) - closed? (12)
- count (12)
- ctime (12)
- delete (12)
- descend (24)
- dirname (12)
- dup (12)
- each (84)
-
each
_ byte (24) -
each
_ char (24) -
each
_ codepoint (24) -
each
_ filename (12) -
each
_ line (72) - eval (12)
- exclude (12)
- existing! (12)
- extname (12)
- file? (12)
- fileno (11)
- flush (24)
- fnmatch (12)
- fnmatch? (12)
- ftype (12)
- getbyte (12)
- getc (12)
- gsub! (12)
- import (12)
- include (12)
- inspect (12)
-
instance
_ eval (24) - label (12)
- lchmod (12)
- lchown (12)
- lstat (12)
-
make
_ link (12) -
make
_ symlink (12) - mtime (12)
- open (36)
-
parent
_ file _ name (12) - path (24)
- puts (12)
- readlink (12)
- realpath (24)
- rename (12)
- reopen (36)
- resolve (12)
-
set
_ encoding (36) -
source
_ location (7) - split (12)
- stat (12)
- sub! (12)
-
to
_ path (12) - truncate (12)
- unlink (30)
- utime (12)
検索結果
先頭5件
-
Rake
:: FileList # gsub!(pattern , replace) -> self (3120.0) -
自身に含まれるファイルリストのそれぞれのエントリに対して String#gsub を実行します。 自身を破壊的に変更します。
...Rakefile での記載例とする
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", "test3.rb")
file_list.gsub!(/\.rb/, ".erb") # => ["test1.erb", "test2.erb", "test3.erb"]
file_list... -
Rake
:: FileList # import(array) -> self (3120.0) -
与えられた配列を自身にインポートします。
...指定します。
//emlist[][ruby]{
# Rakefile での記載例とする
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", "test3.rb")
file_list.import(["test4.rb", "test5.rb"]) # => [......"test4.rb", "test5.rb", "test1.rb", "test2.rb", "test3.rb"]
file_list # => ["test4.rb", "test5.rb", "test1.rb", "test2.rb", "test3.rb"]
end
//}... -
Rake
:: FileList # sub!(pattern , replace) -> self (3120.0) -
自身に含まれるファイルリストのそれぞれのエントリに対して String#sub を実行します。 自身を破壊的に変更します。
...。
自身を破壊的に変更します。
//emlist[][ruby]{
# Rakefile での記載例とする
task default: :test_rake_app
task :test_rake_app do
file_list = FileList['a.c', 'b.c']
file_list.sub!(/\.c$/, '.o') # => ['a.o', 'b.o']
file_list # => ['a.o', 'b.o']
end
//}... -
Rake
:: FileList # exclude(*patterns) {|entry| . . . } -> self (3114.0) -
自身から取り除くべきファイル名のパターンを自身の除外リストに登録します。
...ら削除しません。
例:
FileList['a.c', 'b.c'].exclude("a.c") # => ['b.c']
FileList['a.c', 'b.c'].exclude(/^a/) # => ['b.c']
# If "a.c" is a file, then ...
FileList['a.c', 'b.c'].exclude("a.*") # => ['b.c']
# If "a.c" is not a file, then ...
FileList['a.c', 'b.c'].exclude("a.*"... -
Tempfile
# delete -> self (3103.0) -
テンポラリファイルをクローズせずに、削除します。 UNIXライクなシステムでは、 作成したテンポラリファイルが他のプログラムに使用される機会をなくすために、 テンポラリファイルを作成しオープンした後、 すぐに削除するということがしばしばおこなわれます。
...ンポラリファイルを作成しオープンした後、
すぐに削除するということがしばしばおこなわれます。
require "tempfile"
tf = Tempfile.new("foo")
tf.unlink
p tf.path # => nil
tf.print("foobar,hoge\n")
tf.rewind
p tf.gets("\n") # => "foobar,hoge\n"... -
Tempfile
# unlink -> self (3103.0) -
テンポラリファイルをクローズせずに、削除します。 UNIXライクなシステムでは、 作成したテンポラリファイルが他のプログラムに使用される機会をなくすために、 テンポラリファイルを作成しオープンした後、 すぐに削除するということがしばしばおこなわれます。
...ンポラリファイルを作成しオープンした後、
すぐに削除するということがしばしばおこなわれます。
require "tempfile"
tf = Tempfile.new("foo")
tf.unlink
p tf.path # => nil
tf.print("foobar,hoge\n")
tf.rewind
p tf.gets("\n") # => "foobar,hoge\n"... -
Tempfile
# open -> self (3102.0) -
クローズしたテンポラリファイルを再オープンします。 "r+" でオープンされるので、クローズ前の内容を再度読む ことができます。
...ァイルを再オープンします。
"r+" でオープンされるので、クローズ前の内容を再度読む
ことができます。
require "tempfile"
tf = Tempfile.new("foo")
tf.print("foobar,hoge\n")
tf.print("bar,ugo\n")
tf.close
tf.open
p tf.gets # => "foobar,hoge\n"... -
File
:: Stat # <=>(o) -> Integer | nil (3053.0) -
ファイルの最終更新時刻を比較します。self が other よりも 新しければ正の数を、等しければ 0 を古ければ負の数を返します。 比較できない場合は nil を返します。
...self が other よりも
新しければ正の数を、等しければ 0 を古ければ負の数を返します。
比較できない場合は nil を返します。
@param o File::Stat のインスタンスを指定します。
//emlist[][ruby]{
require 'tempfile' # for Tempfile
fp1 = Tempfile.......open("first")
fp1.print "古い方\n"
sleep(1)
fp2 = Tempfile.open("second")
fp2.print "新しい方\n"
p File::Stat.new(fp1.path) <=> File::Stat.new(fp2.path) #=> -1
p File::Stat.new(fp2.path) <=> File::Stat.new(fp1.path) #=> 1
p File::Stat.new(fp1.path) <=> fp2.path #=> nil
//}... -
Zlib
:: GzipFile :: Error # inspect -> String (3017.0) -
self の情報を人間に読みやすい文字列にして返します。
...
self の情報を人間に読みやすい文字列にして返します。... -
IO
# each _ char {|c| . . . } -> self (142.0) -
self に含まれる文字を一文字ずつブロックに渡して評価します。
...
self に含まれる文字を一文字ずつブロックに渡して評価します。
self は読み込み用にオープンされていなければなりません。
ブロックを省略した場合は各文字について繰り返す Enumerator を返します。
@raise IOError self が読......み込み用にオープンされていない場合に発生します。
f = File.new("testfile")
f.each_char {|c| print c, ' ' } #=> #<File:testfile>...