You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by mf...@apache.org on 2011/06/30 14:49:26 UTC

svn commit: r1141515 - in /incubator/deltacloud/trunk/server: Rakefile lib/sinatra/rack_etag.rb

Author: mfojtik
Date: Thu Jun 30 12:49:25 2011
New Revision: 1141515

URL: http://svn.apache.org/viewvc?rev=1141515&view=rev
Log:
Fixed warnings for rack 1.3.0 and warning for the new rubygem

Modified:
    incubator/deltacloud/trunk/server/Rakefile
    incubator/deltacloud/trunk/server/lib/sinatra/rack_etag.rb

Modified: incubator/deltacloud/trunk/server/Rakefile
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/Rakefile?rev=1141515&r1=1141514&r2=1141515&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/Rakefile (original)
+++ incubator/deltacloud/trunk/server/Rakefile Thu Jun 30 12:49:25 2011
@@ -19,7 +19,12 @@
 
 require 'rake'
 require 'rake/testtask'
-require 'rake/gempackagetask'
+
+begin
+  require 'rubygems/package_task'
+rescue LoadError
+  require 'rake/gempackagetask'
+end
 
 begin
   require 'ci/reporter/rake/test_unit'
@@ -86,8 +91,15 @@ rescue LoadError
 end
 
 spec = Gem::Specification.load('deltacloud-core.gemspec')
-Rake::GemPackageTask.new(spec) do |pkg|
-  pkg.need_tar = true
+
+if Rake::PackageTask
+  Rake::PackageTask.new(spec) do |pkg|
+    pkg.version = '0.3.0'
+  end
+else
+  Rake::GemPackageTask.new(spec) do |pkg|
+    pkg.need_tar = true
+  end
 end
 
 namespace :mock do

Modified: incubator/deltacloud/trunk/server/lib/sinatra/rack_etag.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/sinatra/rack_etag.rb?rev=1141515&r1=1141514&r2=1141515&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/sinatra/rack_etag.rb (original)
+++ incubator/deltacloud/trunk/server/lib/sinatra/rack_etag.rb Thu Jun 30 12:49:25 2011
@@ -30,11 +30,10 @@ module Rack
   # used when Etag is absent and a directive when it is present. The first
   # defaults to nil, while the second defaults to "max-age=0, privaute, must-revalidate"
   class ETag
-    DEFAULT_CACHE_CONTROL = "max-age=0, private, must-revalidate".freeze
 
-    def initialize(app, no_cache_control = nil, cache_control = DEFAULT_CACHE_CONTROL)
+    def initialize(app, no_cache_control = nil, cache_control = nil)
       @app = app
-      @cache_control = cache_control
+      @cache_control = cache_control || "max-age=0, private, must-revalidate"
       @no_cache_control = no_cache_control
     end