[Xfce4-commits] <eatmonkey:aria2-xml-rpc> Ruby syntax change for options Hashtable
Mike Massonnet
noreply at xfce.org
Fri Feb 12 18:28:02 CET 2010
Updating branch refs/heads/aria2-xml-rpc
to f8f788e3126e87724b539eb59d57c4ba8005f059 (commit)
from d0a45ece7d1f042658293ecee6d57a6e297ebfd6 (commit)
commit f8f788e3126e87724b539eb59d57c4ba8005f059
Author: Mike Massonnet <mmassonnet at xfce.org>
Date: Fri Feb 12 13:00:34 2010 +0100
Ruby syntax change for options Hashtable
src/eatmanager.rb | 23 +++++++----------------
1 files changed, 7 insertions(+), 16 deletions(-)
diff --git a/src/eatmanager.rb b/src/eatmanager.rb
index 1cbae6a..87e6fa1 100644
--- a/src/eatmanager.rb
+++ b/src/eatmanager.rb
@@ -325,22 +325,13 @@ class Eat::Manager
# TODO check if it is a uri or a torrent/metalink file and use the right
# method addUri/addTorrent/addMetalink
puts "download file %s" % uri
- if @aria2.use_local_server?
- options = {
- "dir" => @file_download_dir.current_folder,
- "max-download-limit" => @file_max_download_speed.value_as_int.to_s,
- "split" => @file_split.value_as_int.to_s,
- "max-upload-limit" => @file_max_upload_speed.value_as_int.to_s,
- "seed-ratio" => @file_seed_ratio.value.to_s,
- }
- else
- options = {
- "max-download-limit" => @file_max_download_speed.value_as_int.to_s,
- "split" => @file_split.value_as_int.to_s,
- "max-upload-limit" => @file_max_upload_speed.value_as_int.to_s,
- "seed-ratio" => @file_seed_ratio.value.to_s,
- }
- end
+ options = {
+ "max-download-limit" => @file_max_download_speed.value_as_int.to_s,
+ "split" => @file_split.value_as_int.to_s,
+ "max-upload-limit" => @file_max_upload_speed.value_as_int.to_s,
+ "seed-ratio" => @file_seed_ratio.value.to_s,
+ }
+ options["dir"] = @file_download_dir.current_folder if @aria2.use_local_server?
gid = @aria2.add_uri(uri, options)
if gid != nil
puts "gid: %s" % gid
More information about the Xfce4-commits
mailing list