rack-auth-cookie 0.7.5 → 0.7.6

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,25 +1,22 @@
1
1
  require 'rake'
2
+ require 'rake/clean'
2
3
  require 'rake/testtask'
3
4
  require 'rbconfig'
4
-
5
- desc 'Install the rack-auth-cookie library (non-gem)'
6
- task :install do
7
- dir = File.join(CONFIG['sitelibdir'], 'rack', 'auth')
8
- FileUtils.mkdir_p(dir) unless File.exists?(dir)
9
- file = 'lib/rack/auth/cookie.rb'
10
- FileUtils.cp_r(file, dir, :verbose => true)
11
- end
12
-
13
- desc 'Build the gem'
14
- task :gem do
15
- spec = eval(IO.read('rack-auth-cookie.gemspec'))
16
- Gem::Builder.new(spec).build
17
- end
18
-
19
- desc 'Install the rack-auth-cookie library as a gem'
20
- task :install_gem => [:gem] do
21
- file = Dir["*.gem"].first
22
- sh "gem install #{file}"
5
+
6
+ CLEAN.include("**/*.gem", "**/*.rbc")
7
+
8
+ namespace :gem do
9
+ desc 'Create the rack-auth-cookie the gem'
10
+ task :create do
11
+ spec = eval(IO.read('rack-auth-cookie.gemspec'))
12
+ Gem::Builder.new(spec).build
13
+ end
14
+
15
+ desc 'Install the rack-auth-cookie gem'
16
+ task :install => [:create] do
17
+ file = Dir["*.gem"].first
18
+ sh "gem install #{file}"
19
+ end
23
20
  end
24
21
 
25
22
  desc 'Export the git archive to a .zip, .gz and .bz2 file in your home directory'
@@ -49,6 +46,8 @@ task :export, :output_file do |t, args|
49
46
  end
50
47
 
51
48
  Rake::TestTask.new do |t|
52
- t.verbose = true
53
- t.warning = true
49
+ t.verbose = true
50
+ t.warning = true
54
51
  end
52
+
53
+ task :default => :test
@@ -6,7 +6,7 @@ module Rack
6
6
  module Auth
7
7
  class Cookie
8
8
  # The version of the rack-auth-cookie library.
9
- VERSION = '0.7.5'
9
+ VERSION = '0.7.6'
10
10
 
11
11
  # Creates a new Rack::Auth::Cookie object.
12
12
  #
@@ -135,14 +135,22 @@ module Rack
135
135
  if env['AUTH_USER']
136
136
  cookie = self.class.create_auth_cookie(env)
137
137
 
138
- headers["Set-Cookie"] << cookie
138
+ if headers["Set-Cookie"]
139
+ headers["Set-Cookie"] << cookie
140
+ else
141
+ headers["Set-Cookie"] = cookie
142
+ end
139
143
  end
140
144
 
141
145
  # If authentication failed earlier, tell the client to clear the cookie
142
146
  if env['AUTH_FAIL']
143
147
  cookie = self.class.create_clear_cookie(env)
144
148
 
145
- headers["Set-Cookie"] << cookie
149
+ if headers["Set-Cookie"]
150
+ headers["Set-Cookie"] << cookie
151
+ else
152
+ headers["Set-Cookie"] = cookie
153
+ end
146
154
  end
147
155
  end
148
156
 
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = 'rack-auth-cookie'
5
- gem.version = '0.7.5'
5
+ gem.version = '0.7.6'
6
6
  gem.authors = ["Daniel Berger", "Charlie O'Keefe"]
7
7
  gem.email = 'cokeefe@globe.gov'
8
8
  gem.homepage = 'http://www.github.com/charlieok/rack-auth-cookie'
@@ -9,7 +9,7 @@ class TC_Rack_Auth_Cookie < Test::Unit::TestCase
9
9
  end
10
10
 
11
11
  def test_version
12
- assert_equal('0.7.5', Rack::Auth::Cookie::VERSION)
12
+ assert_equal('0.7.6', Rack::Auth::Cookie::VERSION)
13
13
  end
14
14
 
15
15
  def test_constructor_basic
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-auth-cookie
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 5
10
- version: 0.7.5
9
+ - 6
10
+ version: 0.7.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Daniel Berger
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-07-29 00:00:00 -06:00
19
+ date: 2010-11-23 00:00:00 -07:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency