class Bagboy::Core::FileHelper
Public Instance Methods
get_directories( path)
click to toggle source
# File lib/bagboy/core/file_helper.rb, line 7 def get_directories ( path) Dir.entries(path).select { |entry| File.directory?(File.join(path, entry)) and !(entry == '.' || entry == '..')}.sort end
get_files( path )
click to toggle source
# File lib/bagboy/core/file_helper.rb, line 11 def get_files( path ) Dir.entries(path).select { |entry| !(entry == '.' || entry == '..')}.sort end
read( path )
click to toggle source
# File lib/bagboy/core/file_helper.rb, line 15 def read( path ) File.read path end
write( path, text )
click to toggle source
# File lib/bagboy/core/file_helper.rb, line 19 def write ( path, text ) File.open(path, 'w') { |file| file.write(text) } end