lib/rush/local.rb in aleksi-rush-0.6.6 vs lib/rush/local.rb in aleksi-rush-0.6.7
- old
+ new
@@ -347,11 +347,11 @@
end
def close_all_descriptors(keep_open = [])
3.upto(256) do |fd|
next if keep_open.include?(fd)
- IO::new(fd).close rescue nil
+ IO::new(fd, "r").close rescue nil
end
end
####################################
@@ -368,13 +368,13 @@
when 'append_to_file' then append_to_file(params[:full_path], params[:payload])
when 'file_contents' then file_contents(params[:full_path])
when 'destroy' then destroy(params[:full_path])
when 'purge' then purge(params[:full_path])
when 'create_dir' then create_dir(params[:full_path])
- when 'rename' then rename(params[:path], params[:name], params[:new_name], params[:force])
- when 'copy' then copy(params[:src], params[:dst], params[:force])
+ when 'rename' then rename(params[:path], params[:name], params[:new_name], !!params[:force])
+ when 'copy' then copy(params[:src], params[:dst], !!params[:force])
when 'read_archive' then read_archive(params[:full_path])
- when 'write_archive' then write_archive(params[:payload], params[:dir], params[:force])
+ when 'write_archive' then write_archive(params[:payload], params[:dir], !!params[:force])
when 'index' then index(params[:base_path], params[:glob]).join("\n") + "\n"
when 'stat' then YAML.dump(stat(params[:full_path]))
when 'set_access' then set_access(params[:full_path], Rush::Access.from_hash(params))
when 'size' then size(params[:full_path])
when 'processes' then YAML.dump(processes)