http-mock-server 0.1.0 → 0.1.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/README.md +2 -0
- metadata +1 -4
- data/.gitignore +0 -1
- data/http-mock-server.gemspec +0 -25
- data/mock.yml +0 -48
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6c36ea5e76a2d6f1a0e2eda34bcdd6ed1a847e1b
|
|
4
|
+
data.tar.gz: 2c354c438261a68565ad3b997d35263c99f0109d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d886dc16e73b76e475dac39c063b6c87e57fa39c5dabd6b90796f90874d56d88c70ef418a2733e575134907deabd4028ff6981c7cc269fd6f61ed8c48e1857e0
|
|
7
|
+
data.tar.gz: 71f12f8c388c7740e91a46516dae6ab8e4ad7a37187e1351ba9ca51cf3affce4b984aa6713d3a735d959a564c2f14f165094202495d3d1568724cfd7338c7cec
|
data/README.md
CHANGED
|
@@ -68,6 +68,8 @@ routes:
|
|
|
68
68
|
'Access-Control-Expose-Headers': 'X-Total-Count'
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
+
See [docs](http://sinatrarb.com/intro.html) for Sinatra request variables.
|
|
72
|
+
|
|
71
73
|
## Notes
|
|
72
74
|
|
|
73
75
|
- Routes are loaded from the Yaml config at each request, but it updates only the exiting routes; new / old routes are ignored, you have to restart *http-mock-server* to include them
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: http-mock-server
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mattia Roccoberton
|
|
@@ -45,15 +45,12 @@ executables:
|
|
|
45
45
|
extensions: []
|
|
46
46
|
extra_rdoc_files: []
|
|
47
47
|
files:
|
|
48
|
-
- ".gitignore"
|
|
49
48
|
- Gemfile
|
|
50
49
|
- Gemfile.lock
|
|
51
50
|
- LICENSE.txt
|
|
52
51
|
- README.md
|
|
53
52
|
- bin/http-mock-server
|
|
54
|
-
- http-mock-server.gemspec
|
|
55
53
|
- lib/http-mock-server.rb
|
|
56
|
-
- mock.yml
|
|
57
54
|
homepage: https://github.com/blocknotes/http-mock-server
|
|
58
55
|
licenses:
|
|
59
56
|
- MIT
|
data/.gitignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
_misc/
|
data/http-mock-server.gemspec
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
lib = File.expand_path( '../lib', __FILE__ )
|
|
3
|
-
$LOAD_PATH.unshift( lib ) unless $LOAD_PATH.include?( lib )
|
|
4
|
-
|
|
5
|
-
Gem::Specification.new do |spec|
|
|
6
|
-
spec.name = 'http-mock-server'
|
|
7
|
-
spec.version = '0.1.0'
|
|
8
|
-
spec.authors = [ 'Mattia Roccoberton' ]
|
|
9
|
-
spec.email = 'mat@blocknot.es'
|
|
10
|
-
spec.homepage = 'https://github.com/blocknotes/http-mock-server'
|
|
11
|
-
spec.summary = 'HTTP Mock Server'
|
|
12
|
-
spec.description = 'A Ruby HTTP Mock Server based on Sinatra'
|
|
13
|
-
spec.platform = Gem::Platform::RUBY
|
|
14
|
-
spec.license = 'MIT'
|
|
15
|
-
|
|
16
|
-
spec.files = `git ls-files -z`.split("\x0")
|
|
17
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
18
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
19
|
-
spec.require_paths = ["lib"]
|
|
20
|
-
|
|
21
|
-
spec.required_ruby_version = '>= 2.0.0'
|
|
22
|
-
|
|
23
|
-
spec.add_runtime_dependency 'pry', '~> 0.11'
|
|
24
|
-
spec.add_runtime_dependency 'sinatra', '~> 2.0'
|
|
25
|
-
end
|
data/mock.yml
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
config:
|
|
3
|
-
# no_cors: true # don't send CORS headers
|
|
4
|
-
port: 8080 # server port
|
|
5
|
-
# timeout: 10 # response timeout
|
|
6
|
-
verbose: true # shows request params
|
|
7
|
-
not_found:
|
|
8
|
-
body:
|
|
9
|
-
message: This is not the path you are looking for...
|
|
10
|
-
routes:
|
|
11
|
-
-
|
|
12
|
-
get: '/posts'
|
|
13
|
-
headers:
|
|
14
|
-
'A-Random-Header': Something
|
|
15
|
-
body:
|
|
16
|
-
message: List of posts
|
|
17
|
-
-
|
|
18
|
-
get: '/posts/:id'
|
|
19
|
-
body:
|
|
20
|
-
content: A random number {rand} !
|
|
21
|
-
extra:
|
|
22
|
-
today: Today is {DateTime.now}
|
|
23
|
-
request: Post id {params[:id]} - request path {request.path}
|
|
24
|
-
more:
|
|
25
|
-
is_first: "conditional check {params[:id] == '1' ? 'first' : 'other'}"
|
|
26
|
-
-
|
|
27
|
-
get: '/pry'
|
|
28
|
-
body:
|
|
29
|
-
message: '{binding.pry}'
|
|
30
|
-
-
|
|
31
|
-
post: '/posts'
|
|
32
|
-
status: 201
|
|
33
|
-
body:
|
|
34
|
-
code: 201
|
|
35
|
-
result: Ok
|
|
36
|
-
-
|
|
37
|
-
delete: '*'
|
|
38
|
-
status: 405
|
|
39
|
-
body:
|
|
40
|
-
message: Please don't do it
|
|
41
|
-
-
|
|
42
|
-
options: '*'
|
|
43
|
-
status: 200
|
|
44
|
-
headers:
|
|
45
|
-
'Access-Control-Allow-Origin': '*'
|
|
46
|
-
'Access-Control-Allow-Methods': 'HEAD,GET,PUT,DELETE,OPTIONS'
|
|
47
|
-
'Access-Control-Allow-Headers': 'X-Requested-With, X-HTTP-Method-Override, Content-Type, Cache-Control, Accept'
|
|
48
|
-
'Access-Control-Expose-Headers': 'X-Total-Count'
|