protocool 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/protocool.rb +1 -1
- data/lib/protocool/version.rb +1 -1
- data/spec/lib/protocool_spec.rb +24 -0
- metadata +18 -25
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ba847715424d6aaba7e99c306f94a7519bc9d17f
|
4
|
+
data.tar.gz: 8f809c2f584285e673544133b85d39dd5784467f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 67ac2abe2aa2416a876922a91980fbe9779383ebbb58c1b0a2e5a3efbe57ea036badf8903c0f0063abd19e2e42aa5f964f12166b83c3f8e061c46ad5d50d0664
|
7
|
+
data.tar.gz: 15cf6836b819a5f30b66d4e2ff3a41a39fbd71860f7df3d59403aef60ed535c0f465f259c898bdd07cb89631291fae5e4b54c4d48864c1150608293ec551a752
|
data/lib/protocool.rb
CHANGED
@@ -14,7 +14,7 @@ module Protocool
|
|
14
14
|
|
15
15
|
def use_ssl?
|
16
16
|
# Let the Rails config decide
|
17
|
-
return true if Rails.application.config.force_ssl
|
17
|
+
return true if Rails.respond_to?(:application) && Rails.application.config.force_ssl
|
18
18
|
# Otherwise use default
|
19
19
|
!Rails.env.development? && !Rails.env.test?
|
20
20
|
end
|
data/lib/protocool/version.rb
CHANGED
data/spec/lib/protocool_spec.rb
CHANGED
@@ -4,6 +4,30 @@ describe Protocool do
|
|
4
4
|
|
5
5
|
let(:protocool) { Protocool }
|
6
6
|
|
7
|
+
context 'Rails 2 development' do
|
8
|
+
before do
|
9
|
+
Rails.stub!(:env).and_return mock(:environment, development?: true)
|
10
|
+
end
|
11
|
+
|
12
|
+
describe '.https' do
|
13
|
+
it 'does not use TLS' do
|
14
|
+
protocool.https.should == 'http'
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
context 'Rails 2 production' do
|
20
|
+
before do
|
21
|
+
Rails.stub!(:env).and_return mock(:environment, development?: false, test?: false)
|
22
|
+
end
|
23
|
+
|
24
|
+
describe '.https' do
|
25
|
+
it 'uses TLS' do
|
26
|
+
protocool.https.should == 'https'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
7
31
|
context 'if force_ssl is set' do
|
8
32
|
before do
|
9
33
|
Rails.stub_chain(:application, :config, :force_ssl).and_return true
|
metadata
CHANGED
@@ -1,62 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: protocool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- bukowskis
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-09-24 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rspec
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: guard-rspec
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: rb-fsevent
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - ">="
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - ">="
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
description: Decides whether to use TLS encryption or not on a per-environment basis
|
@@ -67,38 +60,38 @@ executables: []
|
|
67
60
|
extensions: []
|
68
61
|
extra_rdoc_files: []
|
69
62
|
files:
|
70
|
-
-
|
63
|
+
- LICENSE
|
64
|
+
- README.md
|
71
65
|
- lib/protocool.rb
|
66
|
+
- lib/protocool/version.rb
|
72
67
|
- spec/lib/protocool_spec.rb
|
73
68
|
- spec/spec_helper.rb
|
74
|
-
- README.md
|
75
|
-
- LICENSE
|
76
69
|
homepage: https://github.com/bukowskis/protocool
|
77
70
|
licenses:
|
78
71
|
- MIT
|
72
|
+
metadata: {}
|
79
73
|
post_install_message:
|
80
74
|
rdoc_options:
|
81
|
-
- --encoding
|
75
|
+
- "--encoding"
|
82
76
|
- UTF-8
|
83
77
|
require_paths:
|
84
78
|
- lib
|
85
79
|
required_ruby_version: !ruby/object:Gem::Requirement
|
86
|
-
none: false
|
87
80
|
requirements:
|
88
|
-
- -
|
81
|
+
- - ">="
|
89
82
|
- !ruby/object:Gem::Version
|
90
83
|
version: '0'
|
91
84
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
92
|
-
none: false
|
93
85
|
requirements:
|
94
|
-
- -
|
86
|
+
- - ">="
|
95
87
|
- !ruby/object:Gem::Version
|
96
88
|
version: '0'
|
97
89
|
requirements: []
|
98
90
|
rubyforge_project:
|
99
|
-
rubygems_version:
|
91
|
+
rubygems_version: 2.2.2
|
100
92
|
signing_key:
|
101
|
-
specification_version:
|
93
|
+
specification_version: 4
|
102
94
|
summary: Decides whether to use TLS encryption or not on a per-environment basis in
|
103
95
|
Rails.
|
104
96
|
test_files: []
|
97
|
+
has_rdoc:
|