ssl_routes 0.1.1 → 0.1.2

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.
@@ -62,14 +62,16 @@ module SslRoutes
62
62
  module InstanceMethods
63
63
 
64
64
  def url_for_with_ssl_support(options)
65
- ac = self.respond_to?(:controller) ? self.controller : self
66
- if ac.enable_ssl
67
- case options
68
- when Hash
69
- current, target = ac.determine_protocols(options)
70
- if current != target
71
- options.merge!({ :protocol => target, :only_path => false })
72
- end
65
+ if options[:only_path] == true
66
+ ac = self.respond_to?(:controller) ? self.controller : self
67
+ if ac.respond_to?(:enable_ssl) && ac.enable_ssl
68
+ case options
69
+ when Hash
70
+ current, target = ac.determine_protocols(options)
71
+ if current != target
72
+ options.merge!({ :protocol => target, :only_path => false })
73
+ end
74
+ end
73
75
  end
74
76
  end
75
77
  url_for_without_ssl_support(options)
@@ -1,5 +1,5 @@
1
1
  module SslRoutes
2
2
 
3
- VERSION = '0.1.1'
3
+ VERSION = '0.1.2'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ssl_routes
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Cedric Howe
@@ -15,12 +15,10 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-24 00:00:00 Z
18
+ date: 2011-08-25 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- name: rails
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
21
+ version_requirements: &id001 !ruby/object:Gem::Requirement
24
22
  none: false
25
23
  requirements:
26
24
  - - ">="
@@ -30,8 +28,10 @@ dependencies:
30
28
  - 2
31
29
  - 3
32
30
  version: "2.3"
31
+ prerelease: false
33
32
  type: :runtime
34
- version_requirements: *id001
33
+ requirement: *id001
34
+ name: rails
35
35
  description: Define your SSL settings in one place to enforce in your controller, generate URLs with the correct protocol, and protect yourself against session hijacking.
36
36
  email: cedric@howe.net
37
37
  executables: []
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
78
  requirements: []
79
79
 
80
80
  rubyforge_project: ssl_routes
81
- rubygems_version: 1.7.2
81
+ rubygems_version: 1.8.6
82
82
  signing_key:
83
83
  specification_version: 3
84
84
  summary: Enforce SSL based on your Rails routes.