vcr-uri-catcher 0.5.0 → 0.5.1
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/VERSION +1 -1
- data/lib/vcr-uri-catcher.rb +3 -0
- data/vcr-uri-catcher.gemspec +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba1f391a9dd1f8ac920413208fd427507cdc7aea
|
4
|
+
data.tar.gz: 802dd518b735d647ab3c7f2d20084124a5231326
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6de5ad998439566cd6b58fd57857a47524f5c401de9f2c664f5b45ea92d83f58d09ecddb2092b274542db5bf7dbba27269484a12d9c28d5839096e7402f092c5
|
7
|
+
data.tar.gz: 16df316a2a91a256327c36c4a6ba7ac59e7ed7025317d1e0b155a18270d54aaed0c616e20df35ee12c5dfeab9f9d178244fa643da4857a839fdfab3da02f6e5f
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.1
|
data/lib/vcr-uri-catcher.rb
CHANGED
@@ -30,6 +30,7 @@ class Catcher
|
|
30
30
|
raise URICatcher::MissingVCR if VCR.nil?
|
31
31
|
VCR.configure do |c|
|
32
32
|
c.before_http_request do |request|
|
33
|
+
STDERR.puts "URICatcher: caught uri #{request.uri}" if $VERBOSE
|
33
34
|
catch_request(request) if active?
|
34
35
|
end
|
35
36
|
end
|
@@ -55,6 +56,7 @@ class Catcher
|
|
55
56
|
if @uris.has_key?(uri)
|
56
57
|
raise "uri #{uri} already registered"
|
57
58
|
else
|
59
|
+
STDERR.puts "URICatcher: will try to catch uri #{uri}" if $VERBOSE
|
58
60
|
@uris[uri] = { :once => once, :block => block }
|
59
61
|
end
|
60
62
|
end
|
@@ -66,6 +68,7 @@ class Catcher
|
|
66
68
|
def catch_request(r)
|
67
69
|
if found = @uris.keys.find{|uri| (uri.class == String && uri == r.uri) || (uri.class == Regexp && r.uri =~ uri)}
|
68
70
|
begin
|
71
|
+
STDERR.puts "URICatcher: matched uri #{found}, calling block" if $VERBOSE
|
69
72
|
@uris[found][:block].call()
|
70
73
|
ensure
|
71
74
|
@uris.delete(found) if @uris[found][:once]
|
data/vcr-uri-catcher.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: vcr-uri-catcher 0.5.
|
5
|
+
# stub: vcr-uri-catcher 0.5.1 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "vcr-uri-catcher"
|
9
|
-
s.version = "0.5.
|
9
|
+
s.version = "0.5.1"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Mischa Molhoek"]
|
14
|
-
s.date = "2015-
|
14
|
+
s.date = "2015-04-24"
|
15
15
|
s.description = "execute arbitrary code (like {raise RestClient::RequestTimeout}) the moment vcr tries to access certain configurable uri('s)"
|
16
16
|
s.email = "mischamolhoek@gmail.com"
|
17
17
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vcr-uri-catcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mischa Molhoek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|