From 40a4dd0cdf398b950742c8394b32821647de6b58 Mon Sep 17 00:00:00 2001 From: "W. Andrew Loe III" Date: Tue, 31 Jan 2012 16:32:15 -0800 Subject: [PATCH 1/2] Memoize the expires time. --- lib/aws/s3/authentication.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/aws/s3/authentication.rb b/lib/aws/s3/authentication.rb index 0efbc7a..8b1a3ae 100644 --- a/lib/aws/s3/authentication.rb +++ b/lib/aws/s3/authentication.rb @@ -115,7 +115,7 @@ def initialize(*args) # 3) The current time in seconds since the epoch plus the default number of seconds (60 seconds) def expires return options[:expires] if options[:expires] - date.to_i + expires_in + @expires || = date.to_i + expires_in end def expires_in @@ -218,4 +218,4 @@ def only_path end end end -end \ No newline at end of file +end From a7aedc3b4cea5e2193e4f9e02830adbde538a6f1 Mon Sep 17 00:00:00 2001 From: "W. Andrew Loe III" Date: Tue, 31 Jan 2012 16:37:58 -0800 Subject: [PATCH 2/2] Style. --- lib/aws/s3/authentication.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/aws/s3/authentication.rb b/lib/aws/s3/authentication.rb index 8b1a3ae..2a18acf 100644 --- a/lib/aws/s3/authentication.rb +++ b/lib/aws/s3/authentication.rb @@ -115,7 +115,7 @@ def initialize(*args) # 3) The current time in seconds since the epoch plus the default number of seconds (60 seconds) def expires return options[:expires] if options[:expires] - @expires || = date.to_i + expires_in + @expires ||= date.to_i + expires_in end def expires_in