[フレーム]

Module: FileUtils

Extended by:
FileUtils
Included in:
FileUtils
Defined in:
opal/stdlib/nodejs/fileutils.rb

Instance Method Summary collapse

Instance Method Details

#cp(source, target) ⇒ Object

10
11
12
13
# File 'opal/stdlib/nodejs/fileutils.rb', line 10
def cp source, target
 target = File .join (target, File .basename (source)) if File .directory?  target
 `__fs__.writeFileSync(target, __fs__.readFileSync(source));`
end

#mkdir_p(path) ⇒ Object Also known as: mkpath, makedirs

5
6
7
8
# File 'opal/stdlib/nodejs/fileutils.rb', line 5
def mkdir_p path
 return true if File .directory?  path
 `__fs__.mkdirSync(#{path})`
end

#mv(source, target) ⇒ Object

19
20
21
22
# File 'opal/stdlib/nodejs/fileutils.rb', line 19
def mv source, target
 target = File .join (target, File .basename (source)) if File .directory?  target
 `__fs__.renameSync(source, target)`
end

#rm(path) ⇒ Object

15
16
17
# File 'opal/stdlib/nodejs/fileutils.rb', line 15
def rm path
 `__fs__.unlinkSync(path)`
end

AltStyle によって変換されたページ (->オリジナル) /