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 +4 -4
- data/.ruby-version +1 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/hwacha/config.rb +4 -2
- data/lib/hwacha/version.rb +1 -1
- data/spec/lib/hwacha/config_spec.rb +28 -8
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 884f21ac66ab0773bec6d88e5c72661219f90f28
|
4
|
+
data.tar.gz: 5bafab080d51c358950b527fd5f23c882c5141a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bdf95bb35cde8f1293bb60fd51609e77c0e650a350ae48c1760ac617dff69dfe4279cda1e26e97359353d639da984e99f2ca257ab0e396c3e0b354eade8b10b
|
7
|
+
data.tar.gz: 2d8e01e0fd1bdae865236d1ed4436918f9b2a86311b6d808ed25f2d63d0a03aa97859c57aff37439dce03603932b824ab8d4be54ed76e3f50988bf65c9b8912f
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-2.1
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Hwacha [](https://travis-ci.org/sdball/hwacha)
|
1
|
+
# Hwacha [](https://travis-ci.org/sdball/hwacha) [](http://badge.fury.io/rb/hwacha)
|
2
2
|
|
3
3
|
Hwacha! Harness the power of Typhoeus to quickly check webpage responses.
|
4
4
|
|
data/lib/hwacha/config.rb
CHANGED
@@ -20,8 +20,10 @@ class Hwacha
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def follow_redirects_option
|
23
|
-
|
24
|
-
|
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
|
data/lib/hwacha/version.rb
CHANGED
@@ -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
|
29
|
-
|
30
|
-
|
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
|
-
|
35
|
-
subject.
|
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 "
|
39
|
-
|
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.
|
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-
|
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
|