anymock 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/anymock.rb +6 -1
- data/lib/anymock/cli.rb +3 -1
- data/lib/anymock/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 619b503228cfc5a16cad8f3964b36fbb75bce33e62cecacb92fde4a851cd5db5
|
4
|
+
data.tar.gz: a193a47feaabcd3194e12d795c636ba43c5cf78cf35d4fe8afc31dd31230c215
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4857620f4fc4d3759aa6e680f254eabb4d54bf7d92896d68b81c06880e855b2acfc2e6a069c56366deed75d2e5e3d05b6e61979ce7470af56e4426be1d59feb8
|
7
|
+
data.tar.gz: dfaed9d908fc7d90cd1ffaab984bfcae838f2cfa00e031d85439360e8765c4908f75fdf4640d89eb6a0b849f5828b6f878991f00a0bbcface54c74d70af1ffe7
|
data/lib/anymock.rb
CHANGED
@@ -13,6 +13,7 @@ module Anymock
|
|
13
13
|
@address = opts[:address]
|
14
14
|
@port = opts[:port]
|
15
15
|
@response = opts[:response]
|
16
|
+
@file = opts[:file]
|
16
17
|
@log = opts[:log]
|
17
18
|
@mirror = opts[:mirror]
|
18
19
|
@json = opts[:json]
|
@@ -26,7 +27,11 @@ module Anymock
|
|
26
27
|
query: req.query
|
27
28
|
}
|
28
29
|
res.status = status_code(req.request_method)
|
29
|
-
if @
|
30
|
+
if @file
|
31
|
+
File.open(@file) do |f|
|
32
|
+
res.body = f.read
|
33
|
+
end
|
34
|
+
elsif @response
|
30
35
|
res.body = @response
|
31
36
|
elsif @mirror
|
32
37
|
res.body = req_string
|
data/lib/anymock/cli.rb
CHANGED
@@ -7,7 +7,8 @@ module Anymock
|
|
7
7
|
option :d, type: :string, default: 'public/'
|
8
8
|
option :a, type: :string, default: 'localhost'
|
9
9
|
option :p, type: :string, default: '8080'
|
10
|
-
option :r, type: :string
|
10
|
+
option :r, type: :string
|
11
|
+
option :f, type: :string
|
11
12
|
option :l, type: :string
|
12
13
|
option :m, type: :boolean, default: false
|
13
14
|
option :j, type: :boolean, default: false
|
@@ -30,6 +31,7 @@ module Anymock
|
|
30
31
|
address: options[:a],
|
31
32
|
port: options[:p],
|
32
33
|
response: options[:r],
|
34
|
+
file: options[:f],
|
33
35
|
log: options[:l],
|
34
36
|
mirror: options[:m],
|
35
37
|
json: options[:j]
|
data/lib/anymock/version.rb
CHANGED