hwacha 1.0.1 → 1.0.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: 0db9188491e5762e93306d3fb87df48855322ee4
4
- data.tar.gz: 849b5056ecb3e715e3d8dd5e6df7377df14c325f
3
+ metadata.gz: 884f21ac66ab0773bec6d88e5c72661219f90f28
4
+ data.tar.gz: 5bafab080d51c358950b527fd5f23c882c5141a0
5
5
  SHA512:
6
- metadata.gz: 7e9ff6ec0f1bc4138170a857e1da3343f2ea1509ecd08a56df1f9e5e5edfbc95113b462d6ea59a1848cc54d06b80ab182841726ce733644c13efdb77063130f5
7
- data.tar.gz: c3f9987340c8986f5ec36585c7eb072f798d79380d6e97a09d7fd942c2eb2e368d7fd9b11759cacbe22b7f7b42737d9bfe1857d03b1e646ae072c2952fc585e1
6
+ metadata.gz: 8bdf95bb35cde8f1293bb60fd51609e77c0e650a350ae48c1760ac617dff69dfe4279cda1e26e97359353d639da984e99f2ca257ab0e396c3e0b354eade8b10b
7
+ data.tar.gz: 2d8e01e0fd1bdae865236d1ed4436918f9b2a86311b6d808ed25f2d63d0a03aa97859c57aff37439dce03603932b824ab8d4be54ed76e3f50988bf65c9b8912f
@@ -0,0 +1 @@
1
+ ruby-2.1
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hwacha (1.0.1)
4
+ hwacha (1.0.2)
5
5
  typhoeus
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Hwacha [![Build Status](https://travis-ci.org/sdball/hwacha.png?branch=master)](https://travis-ci.org/sdball/hwacha)
1
+ # Hwacha [![Build Status](https://travis-ci.org/sdball/hwacha.png?branch=master)](https://travis-ci.org/sdball/hwacha) [![Gem Version](https://badge.fury.io/rb/hwacha.png)](http://badge.fury.io/rb/hwacha)
2
2
 
3
3
  Hwacha! Harness the power of Typhoeus to quickly check webpage responses.
4
4
 
@@ -20,8 +20,10 @@ class Hwacha
20
20
  end
21
21
 
22
22
  def follow_redirects_option
23
- return { :followlocation => false } if follow_redirects.nil?
24
- { :followlocation => !!follow_redirects }
23
+ followlocation = false
24
+ followlocation = !!ricochet unless ricochet.nil?
25
+ followlocation = !!follow_redirects unless follow_redirects.nil?
26
+ { :followlocation => followlocation }
25
27
  end
26
28
  end
27
29
  end
@@ -1,3 +1,3 @@
1
1
  class Hwacha
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
@@ -25,18 +25,38 @@ describe Hwacha::Config do
25
25
  end
26
26
 
27
27
  describe "#request_options" do
28
- context "when follow_redirects option is set" do
29
- let(:follow_redirects) { true }
30
- let(:follow_redirects_option) do
31
- { :followlocation => follow_redirects }
28
+ context "when follow_redirects option is true" do
29
+ before do
30
+ subject.follow_redirects = true
32
31
  end
33
32
 
34
- before do
35
- subject.follow_redirects = follow_redirects
33
+ it "exports followlocation as true" do
34
+ expect(subject.request_options.fetch(:followlocation)).to be_true
35
+ end
36
+ end
37
+
38
+ context "when follow_redirects option is not set" do
39
+ it "exports followlocation as false" do
40
+ expect(subject.request_options.fetch(:followlocation)).to be_false
41
+ end
42
+ end
43
+
44
+ context "when follow_redirects option is false" do
45
+ it "exports followlocation as false" do
46
+ expect(subject.request_options.fetch(:followlocation)).to be_false
47
+ end
48
+ end
49
+
50
+ context "when ricochet is set" do
51
+ it "treats ricochet as an alias for follow_redirects" do
52
+ subject.ricochet = true
53
+ expect(subject.request_options.fetch(:followlocation)).to be_true
36
54
  end
37
55
 
38
- it "exports as followlocation in a hash" do
39
- expect(subject.request_options).to include follow_redirects_option
56
+ it "has a lower precedence than setting follow_redirects" do
57
+ subject.ricochet = true
58
+ subject.follow_redirects = false
59
+ expect(subject.request_options.fetch(:followlocation)).to be_false
40
60
  end
41
61
  end
42
62
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hwacha
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Ball
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-14 00:00:00.000000000 Z
11
+ date: 2014-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -88,6 +88,7 @@ extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
90
  - ".gitignore"
91
+ - ".ruby-version"
91
92
  - ".travis.yml"
92
93
  - Gemfile
93
94
  - Gemfile.lock