protocool 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ba847715424d6aaba7e99c306f94a7519bc9d17f
4
- data.tar.gz: 8f809c2f584285e673544133b85d39dd5784467f
3
+ metadata.gz: d54fbad2e7add40919d9d4fe3d6bff6f222822aa
4
+ data.tar.gz: 91e1b34f2ad776b21c4a73cb44f5de7c10e4f757
5
5
  SHA512:
6
- metadata.gz: 67ac2abe2aa2416a876922a91980fbe9779383ebbb58c1b0a2e5a3efbe57ea036badf8903c0f0063abd19e2e42aa5f964f12166b83c3f8e061c46ad5d50d0664
7
- data.tar.gz: 15cf6836b819a5f30b66d4e2ff3a41a39fbd71860f7df3d59403aef60ed535c0f465f259c898bdd07cb89631291fae5e4b54c4d48864c1150608293ec551a752
6
+ metadata.gz: 84c719f093e7f244edb02a54fb63fb39d53a96a892fcb32e1fdc41ff705e35205eec73d2f155badaa5c1009f2f92fb8ccd18fe289ff2cc0be2419cbf7a067bf4
7
+ data.tar.gz: cefe98d0996d40ed31c18f552448f9d39ade65635eb745dc3ef4c22ea609f92db0ecbf7c794516c685c398ac04d2a5372d6397c13c8572bf484fefd5f98e20ee
@@ -13,6 +13,9 @@ module Protocool
13
13
  private
14
14
 
15
15
  def use_ssl?
16
+ # Allow the user to override any defaults
17
+ # This is useful for booting a Rails app with production environment locally
18
+ return false if ENV['PROTOCOOL_FORCE_INSECURE'] == 'true'
16
19
  # Let the Rails config decide
17
20
  return true if Rails.respond_to?(:application) && Rails.application.config.force_ssl
18
21
  # Otherwise use default
@@ -2,7 +2,7 @@ module Protocool
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- TINY = 1
5
+ TINY = 2
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].compact.join('.')
8
8
  end
@@ -105,5 +105,25 @@ describe Protocool do
105
105
  end
106
106
  end
107
107
 
108
+ context 'with force_ssl in non-dev and non-test mode but overriding manually' do
109
+ before do
110
+ Rails.stub_chain(:application, :config, :force_ssl).and_return true
111
+ Rails.stub!(:env).and_return mock(:environment, development?: false, test?: false)
112
+ stub_const 'ENV', {'PROTOCOOL_FORCE_INSECURE' => 'true'}
113
+ end
114
+
115
+ describe '.https' do
116
+ it 'uses TLS' do
117
+ protocool.https.should == 'http'
118
+ end
119
+ end
120
+
121
+ describe '.protocol' do
122
+ it 'uses TLS' do
123
+ protocool.protocol.should == 'http://'
124
+ end
125
+ end
126
+ end
127
+
108
128
  end
109
129
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protocool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - bukowskis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-24 00:00:00.000000000 Z
11
+ date: 2016-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -88,10 +88,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  version: '0'
89
89
  requirements: []
90
90
  rubyforge_project:
91
- rubygems_version: 2.2.2
91
+ rubygems_version: 2.5.1
92
92
  signing_key:
93
93
  specification_version: 4
94
94
  summary: Decides whether to use TLS encryption or not on a per-environment basis in
95
95
  Rails.
96
96
  test_files: []
97
- has_rdoc: