bcms_pubcookie 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "bcms_pubcookie"
6
- s.version = "0.3.0"
6
+ s.version = "0.3.1"
7
7
  s.authors = ["James Hughes"]
8
8
  s.email = ["james@virtualjames.com"]
9
9
  s.homepage = "http://github.com/jamezilla/bcms_pubcookie"
@@ -11,9 +11,17 @@ Gem::Specification.new do |s|
11
11
 
12
12
  s.rubyforge_project = "bcms_pubcookie"
13
13
 
14
- s.files = `git ls-files`.split("\n")
15
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
14
+ s.files = Dir[".gitignore"]
15
+ s.files += Dir["*"]
16
+ s.files -= Dir["lib"]
17
+ s.files -= Dir["pkg"]
18
+ s.files += Dir["lib/**/*.rb"]
19
+ s.files += Dir["lib/**/.gitkeep"]
20
+ s.files -= Dir["lib/tasks/build_gem.rake"]
21
+ s.files.reject! { |file| file[-1] == "~" || file[-1] == "#" }
22
+
23
+ # s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
24
+ # s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
17
25
  s.require_paths = ["lib"]
18
26
 
19
27
  # specify any dependencies here; for example:
@@ -47,7 +47,6 @@ module Pubcookie
47
47
  # Attempts to set the current user based on the
48
48
  # HTTP_AUTHORIZATION variable set by pubcookie.
49
49
  def login_from_pubcookie
50
- # logger.debug '--- Attempting to login using pubcookie'
51
50
  if login_id = parse_http_authorization
52
51
  begin
53
52
  return User.find_by_login(login_id)
@@ -67,7 +66,7 @@ module Pubcookie
67
66
  # login information encoded in Base64.
68
67
  def parse_http_authorization
69
68
  if !request.env['HTTP_AUTHORIZATION'].nil?
70
- return request.env['HTTP_AUTHORIZATION'].split(' ')[1].unpack("m").to_s.split(':')[0]
69
+ return request.env['HTTP_AUTHORIZATION'].split(' ')[1].unpack("m")[0].split(':')[0]
71
70
  else
72
71
  return nil
73
72
  end
@@ -7,19 +7,23 @@ module Pubcookie
7
7
  # a :login_required filter, you want "location" to be
8
8
  # request.url, thus it's parameterized
9
9
  def handle_pubcookie_ondemand(location = request.env["HTTP_REFERER"])
10
- # logger.debug "Handling login with pubcookie."
11
10
  response.headers["Cache-control"] = "no-store, no-cache, must-revalidate"
12
11
  response.headers["Expires"] = "Sat, 1 Jan 2000 01:01:01 GMT"
13
12
  response.headers["Set-Cookie"] = "OnDemandKey=ondemand; path=/"
13
+
14
+ # make sure we redirect back to something sensible
14
15
  back = location || my_root_url || request.host
16
+
17
+ # logger.debug "--- Handling login with pubcookie"
15
18
  # logger.debug "--- OnDemand redirect: " + back
16
19
  # logger.debug "--- location: " + location
17
20
  # logger.debug "--- referer: " + request.env["HTTP_REFERER"].to_s
18
21
  # logger.debug "--- my_root_url: " + my_root_url.to_s
19
22
  # logger.debug "--- host: " + request.host.to_s
23
+
20
24
  redirect_to ensure_ssl(back)
21
25
  end
22
-
26
+
23
27
  private
24
28
 
25
29
  def ensure_ssl(url_or_path)
@@ -36,5 +40,5 @@ module Pubcookie
36
40
  return defined?(root_url) ? root_url : nil
37
41
  end
38
42
 
39
- end
43
+ end
40
44
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bcms_pubcookie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-10-07 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &2152578640 !ruby/object:Gem::Requirement
16
+ requirement: &2157613760 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2152578640
24
+ version_requirements: *2157613760
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: browsercms
27
- requirement: &2152578160 !ruby/object:Gem::Requirement
27
+ requirement: &2157613280 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '3.3'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2152578160
35
+ version_requirements: *2157613280
36
36
  description:
37
37
  email:
38
38
  - james@virtualjames.com
@@ -41,13 +41,13 @@ extensions: []
41
41
  extra_rdoc_files: []
42
42
  files:
43
43
  - .gitignore
44
+ - bcms_pubcookie.gemspec
44
45
  - COPYRIGHT
45
- - GPL
46
46
  - Gemfile
47
+ - GPL
47
48
  - LGPL
48
- - README.markdown
49
49
  - Rakefile
50
- - bcms_pubcookie.gemspec
50
+ - README.markdown
51
51
  - lib/bcms_pubcookie.rb
52
52
  - lib/pubcookie/authentication/controller.rb
53
53
  - lib/pubcookie/controller_helper.rb
@@ -55,7 +55,6 @@ files:
55
55
  - lib/pubcookie/sessions_controller.rb
56
56
  - lib/pubcookie/user_extensions.rb
57
57
  - lib/tasks/.gitkeep
58
- - lib/tasks/build_gem.rake
59
58
  homepage: http://github.com/jamezilla/bcms_pubcookie
60
59
  licenses: []
61
60
  post_install_message:
@@ -1,5 +0,0 @@
1
- # Add any tasks from your Rake file here (if you were using, say, Jeweler to build gems)
2
-
3
- # Otherwise, this enabled Bundler to build your gem
4
- require 'bundler'
5
- Bundler::GemHelper.install_tasks