emmy-http 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4054dabb4c316860e14ce8f484b7729cb74660cb
4
- data.tar.gz: 4e22db5e55710caf6a8411b374fe9bb8d5697f4b
3
+ metadata.gz: 39723dc7fd12004f07f58427d043f58dfcaf4c58
4
+ data.tar.gz: 5240b66295cf92c9d4140fa550bc0c3e8340838e
5
5
  SHA512:
6
- metadata.gz: a16fbbf0853d9bebea1a41ce93f11376de55ec73a5c1beb6f34eb919dc1890bd7f8ff416c8c07a873c5568a7c89dbfe6f298e664eddac8546c070863b7ed4fa3
7
- data.tar.gz: 6961520e46cc7169f57d9f90ba2ce22b26dbd6bde085f247843198f0d64211845f9aaf692ca21767f7965653e809725997274d62a29a0cf34d0719884955a13a
6
+ metadata.gz: 98f2216df716fa2fbbd898d597b3757140421bd39751efcad354f64a3204b511aa6bf52631cd43665eeef406dfcbc494a0f1d63f001abd4e56ad6e7b16782f23
7
+ data.tar.gz: 7c59ebaa786585565b3a4d968f4f66e44adff1ae5973d4e9e13f336e25e57665edfd5c9e2f0395f9d87bb007eed80d2a572637fec004445c2b0dfc82b8cfed7b
@@ -49,9 +49,8 @@ module EmmyHttp
49
49
  end
50
50
  end
51
51
 
52
- # FIXME: move to model_pack
53
52
  def ssl?
54
- !!ssl
53
+ ssl || url.scheme == 'https' || url.port == 443
55
54
  end
56
55
 
57
56
  private
@@ -1,3 +1,3 @@
1
1
  module EmmyHttp
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
@@ -0,0 +1,14 @@
1
+ require "spec_helper"
2
+ using EventObject
3
+
4
+ describe EmmyHttp::Request do
5
+ it "ssl flag" do
6
+ req1 = EmmyHttp::Request.new(url: 'http://httpbin.org')
7
+ req2 = EmmyHttp::Request.new(url: 'https://httpbin.org')
8
+ req3 = EmmyHttp::Request.new(url: 'http://httpbin.org:443')
9
+
10
+ expect(req1.ssl?).to eq false
11
+ expect(req2.ssl?).to eq true
12
+ expect(req3.ssl?).to eq true
13
+ end
14
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emmy-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - inre
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-19 00:00:00.000000000 Z
11
+ date: 2015-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: event_object
@@ -149,6 +149,7 @@ files:
149
149
  - lib/emmy_http/utils.rb
150
150
  - lib/emmy_http/version.rb
151
151
  - spec/emmy_http/model_spec.rb
152
+ - spec/emmy_http/request_spec.rb
152
153
  - spec/emmy_http/response_spec.rb
153
154
  - spec/emmy_http_spec.rb
154
155
  - spec/fakes.rb
@@ -179,6 +180,7 @@ specification_version: 4
179
180
  summary: EmmyHttp - EventMachine's HTTP Client
180
181
  test_files:
181
182
  - spec/emmy_http/model_spec.rb
183
+ - spec/emmy_http/request_spec.rb
182
184
  - spec/emmy_http/response_spec.rb
183
185
  - spec/emmy_http_spec.rb
184
186
  - spec/fakes.rb