guillotine 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # Changelog
2
2
 
3
- ## master
3
+ ## v1.2.1
4
+
5
+ * Fix WildcardHostChecker error responses.
6
+
7
+ ## v1.2.0
4
8
 
5
9
  * Add a simple wildcard host checker.
6
10
 
data/guillotine.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'guillotine'
16
- s.version = '1.2.0'
16
+ s.version = '1.2.1'
17
17
  s.date = '2012-06-04'
18
18
  s.rubyforge_project = 'guillotine'
19
19
 
data/lib/guillotine.rb CHANGED
@@ -3,7 +3,7 @@ require 'digest/md5'
3
3
  require 'addressable/uri'
4
4
 
5
5
  module Guillotine
6
- VERSION = "1.2.0"
6
+ VERSION = "1.2.1"
7
7
 
8
8
  class Error < StandardError
9
9
  end
@@ -11,10 +11,10 @@ module Guillotine
11
11
  @all ||= []
12
12
  end
13
13
 
14
- attr_reader :error, :error_response
14
+ attr_reader :error
15
15
 
16
16
  def initialize(arg = nil)
17
- @error_response = [422, {}, @error]
17
+ @error_response = nil
18
18
  end
19
19
 
20
20
  def valid?(url)
@@ -22,7 +22,11 @@ module Guillotine
22
22
  end
23
23
 
24
24
  def call(url)
25
- @error_response unless valid?(url)
25
+ error_response unless valid?(url)
26
+ end
27
+
28
+ def error_response
29
+ @error_response ||= [422, {}, @error]
26
30
  end
27
31
  end
28
32
 
@@ -79,7 +79,7 @@ module Guillotine
79
79
  end
80
80
 
81
81
  def test_builds_custom_error
82
- assert_match /must be from foo\.com/, checker.error
82
+ assert_match /must be from foo\.com/, checker.error_response[2]
83
83
  end
84
84
  end
85
85
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guillotine
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-06-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra
16
- requirement: &70351788208980 !ruby/object:Gem::Requirement
16
+ requirement: &70118903831360 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.2.6
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70351788208980
24
+ version_requirements: *70118903831360
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: addressable
27
- requirement: &70351788208520 !ruby/object:Gem::Requirement
27
+ requirement: &70118903830900 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 2.2.6
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70351788208520
35
+ version_requirements: *70118903830900
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rack-test
38
- requirement: &70351788208140 !ruby/object:Gem::Requirement
38
+ requirement: &70118903830520 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70351788208140
46
+ version_requirements: *70118903830520
47
47
  description: Adaptable private URL shortener
48
48
  email: technoweenie@gmail.com
49
49
  executables: []