fake_server 0.0.2 → 0.0.3

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: 75641cd05fb4b53ab7b5f61338f87899d7e253b8
4
- data.tar.gz: 9362eda450908023d7d83a298d0679f51f16a39a
3
+ metadata.gz: b0bd1386f6bec6fe5350cf5f0d9aa8b098f07ccc
4
+ data.tar.gz: f95f9b4313e424e2e75771ded8b42efa615c5168
5
5
  SHA512:
6
- metadata.gz: 62d3bb0d3c07a2b930469da75317fcd3ed4f1aa6e5bf10d65203e8ed6d2ad2eea2d171adabc1ad6aed541a0bdd235381d71aad69631815efedea452af972d1ea
7
- data.tar.gz: 7b80371786e401faff2f9b1da55cfde39f9914b71083d730a2ce4e301a67c8406adfb7d83dc27b2d37ebe30e9ff50333b8a07388e523f75fe2173560a48e8ade
6
+ metadata.gz: 0c504437ae2101b6e9af2a0e21ac620225afd88b532fd7b8022d7593e33cd5fac2f199dc0983802c8f02be451062337399952e9ffcf087aadc647bd3f613b57c
7
+ data.tar.gz: a3656af2317e1719076df12329f526e591be11914e9c8e8b3fdd9eb03ec33df036a46c10f0afe3a4af873f1749ebf8d1f19bb3893dd0c0083755d41a893c9b28
data/Gemfile CHANGED
@@ -1,2 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
  gemspec
3
+
4
+ group :development do
5
+ gem 'pry'
6
+ end
@@ -4,12 +4,14 @@ module FakeServer
4
4
  class RemoteAPI
5
5
  def initialize(host)
6
6
  @host = host
7
+ @host = "http://#{host}" unless host[/\Ahttp/]
7
8
  end
8
9
 
9
10
  attr_reader :host
10
11
 
11
12
  def request(method, relative_url)
12
13
  response = HTTParty.public_send(method.downcase, "#{host}#{relative_url}")
14
+ response.headers.delete 'transfer-encoding'
13
15
  [response.code, response.headers, [response.body]]
14
16
  end
15
17
  end
@@ -17,11 +17,21 @@ module FakeServer
17
17
 
18
18
  logger.info("#{method} #{url}")
19
19
  if method == "GET"
20
- VCR.use_cassette(url) { remote_api.request(method, url) }
20
+ name = cassette_name(url)
21
+ logger.info("using cassette #{name}")
22
+ VCR.use_cassette(name) { remote_api.request(method, url) }
21
23
  else
22
24
  remote_api.request(method, url)
23
25
  end
24
26
 
25
27
  end
28
+
29
+ private
30
+
31
+ def cassette_name(url)
32
+ name = url.sub(/\/\z/, '')
33
+ name.empty? ? "_root" : name
34
+ end
35
+
26
36
  end
27
37
  end
@@ -1,3 +1,3 @@
1
1
  module FakeServer
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,111 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fake_server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Evans
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-04 00:00:00.000000000 Z
11
+ date: 2014-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: httparty
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: puma
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: thor
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: vcr
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: webmock
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  description: Command line proxy server that records requests, useful for caching external
@@ -117,7 +117,7 @@ executables:
117
117
  extensions: []
118
118
  extra_rdoc_files: []
119
119
  files:
120
- - .gitignore
120
+ - ".gitignore"
121
121
  - Gemfile
122
122
  - LICENSE.txt
123
123
  - README.md
@@ -139,20 +139,19 @@ require_paths:
139
139
  - lib
140
140
  required_ruby_version: !ruby/object:Gem::Requirement
141
141
  requirements:
142
- - - '>='
142
+ - - ">="
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0'
145
145
  required_rubygems_version: !ruby/object:Gem::Requirement
146
146
  requirements:
147
- - - '>='
147
+ - - ">="
148
148
  - !ruby/object:Gem::Version
149
149
  version: '0'
150
150
  requirements: []
151
151
  rubyforge_project:
152
- rubygems_version: 2.0.0
152
+ rubygems_version: 2.2.2
153
153
  signing_key:
154
154
  specification_version: 4
155
155
  summary: Command line proxy server that records requests, useful for caching external
156
156
  requests in tests
157
157
  test_files: []
158
- has_rdoc: