387件ヒット
[301-387件を表示]
(0.049秒)
別のキーワード
モジュール
- FileTest (174)
- FileUtils (36)
- JSON (12)
- Kernel (153)
- ObjectSpace (12)
キーワード
-
allocation
_ sourcefile (12) -
caller
_ locations (24) - chomp (12)
- chop (12)
- dump (12)
- empty? (9)
-
executable
_ real? (12) - exists? (9)
- grpowned? (12)
- gsub (36)
- identical? (12)
- lambda (18)
- mkdir (12)
- move (12)
- mv (12)
- owned? (12)
- proc (19)
- readable? (12)
- setgid? (12)
- setuid? (12)
- size? (12)
- socket? (12)
- sticky? (12)
- symlink? (12)
- warn (8)
- writable? (12)
- zero? (12)
検索結果
先頭5件
-
FileUtils
. # move(src , dest , options = {}) -> () (37.0) -
ファイル src を dest に移動します。
...c:FileUtils#options
//emlist[][ruby]{
require 'fileutils'
FileUtils.mv('badname.rb', 'goodname.rb')
FileUtils.mv('stuff.rb', 'lib/ruby', force: true)
FileUtils.mv(['junk.txt', 'dust.txt'], "#{ENV['HOME']}/.trash")
FileUtils.mv(Dir.glob('test*.rb'), 'test', noop: true, verbose: true)
//}... -
FileUtils
. # mv(src , dest , options = {}) -> () (37.0) -
ファイル src を dest に移動します。
...c:FileUtils#options
//emlist[][ruby]{
require 'fileutils'
FileUtils.mv('badname.rb', 'goodname.rb')
FileUtils.mv('stuff.rb', 'lib/ruby', force: true)
FileUtils.mv(['junk.txt', 'dust.txt'], "#{ENV['HOME']}/.trash")
FileUtils.mv(Dir.glob('test*.rb'), 'test', noop: true, verbose: true)
//}... -
JSON
. # dump(object , io = nil , limit = nil) -> String | IO (37.0) -
与えられたオブジェクトを JSON 形式の文字列に変換してダンプします。
...生します。
//emlist[例][ruby]{
require "json"
JSON.dump({ name: "tanaka", age: 19 }) # => "{\"name\":\"tanaka\",\"age\":19}"
//}
//emlist[例][ruby]{
require "json"
File.open("test.txt", "w") do |f|
JSON.dump([[[[[[[[[[]]]]]]]]]], f, 10) # => #<File:test.txt>
JSON.dump([[[[[[[[[[[]]]... -
ObjectSpace
. # allocation _ sourcefile(object) -> String (25.0) -
objectの元となったソースファイル名を返します。
...返します。
//emlist[例:test.rbというファイルで下記のスクリプトを実行した場合][ruby]{
require 'objspace'
ObjectSpace::trace_object_allocations_start
obj = Object.new
puts "file:#{ObjectSpace::allocation_sourcefile(obj)}" # => file:test.rb
ObjectSpace::trace_object_all... -
FileUtils
. # mkdir(dir , options = {}) -> () (19.0) -
ディレクトリ dir を作成します。
...作成するディレクトリ。
@param options :mode, :noop, :verbose が指定できます。
c:FileUtils#options
//emlist[][ruby]{
require 'fileutils'
FileUtils.mkdir('test')
FileUtils.mkdir(%w( tmp data ))
FileUtils.mkdir('notexist', noop: true) # does not create really
//}... -
Kernel
. # gsub(pattern) -> Enumerator (19.0) -
$_.gsub とほぼ同じですが、置換が発生したときは、$_の内容を置き換える点が異なります。 コマンドラインオプションで -p または -n を指定した時のみ定義されます。
...規表現。
文字列を指定した場合は全く同じ文字列にだけマッチする
@param replace pattern で指定した文字列と置き換える文字列
//emlist[例][ruby]{
$_ # => "test\n"
gsub(/es/, '!!') # => "t!!t\n"
//}
@see String#gsub,$_... -
Kernel
. # gsub(pattern) {|matched| . . . } -> String (19.0) -
$_.gsub とほぼ同じですが、置換が発生したときは、$_の内容を置き換える点が異なります。 コマンドラインオプションで -p または -n を指定した時のみ定義されます。
...規表現。
文字列を指定した場合は全く同じ文字列にだけマッチする
@param replace pattern で指定した文字列と置き換える文字列
//emlist[例][ruby]{
$_ # => "test\n"
gsub(/es/, '!!') # => "t!!t\n"
//}
@see String#gsub,$_... -
Kernel
. # gsub(pattern , replace) -> String (19.0) -
$_.gsub とほぼ同じですが、置換が発生したときは、$_の内容を置き換える点が異なります。 コマンドラインオプションで -p または -n を指定した時のみ定義されます。
...規表現。
文字列を指定した場合は全く同じ文字列にだけマッチする
@param replace pattern で指定した文字列と置き換える文字列
//emlist[例][ruby]{
$_ # => "test\n"
gsub(/es/, '!!') # => "t!!t\n"
//}
@see String#gsub,$_...