rest_shifter 0.0.25 → 0.0.26
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/.travis.yml +1 -0
- data/Dockerfile +4 -0
- data/README.md +15 -0
- data/lib/rest_shifter/commands/fake_certs/localhost.cert +18 -0
- data/lib/rest_shifter/commands/fake_certs/localhost.key +27 -0
- data/lib/rest_shifter/commands/fake_certs/readme +5 -0
- data/lib/rest_shifter/commands/start.rb +1 -1
- data/lib/rest_shifter/version.rb +1 -1
- data/spec/flavors/helloworld.flavor +10 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46058c0143f1f92461d483617da6a497dee3e3cb
|
4
|
+
data.tar.gz: 4808d296f0c6346d339fcb22ac938eb4d0a1caf9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9db42ab9903822be059b7b7e369f51211cab0dfa4efff46a031cf9bf5734cc9fbef3fd34a0cb259236d19846e299d099ba745cf81991d233ff5b11d07195268
|
7
|
+
data.tar.gz: 729de0ffa92178971dc0ff27789aebdbbef8fbb0a54da2ee9a3d64732ddd1bd471db87ded9651cb23ab5a20890ab3f2b2f6c1a8c124937bd2b9a4ed160f21b10
|
data/.travis.yml
CHANGED
data/Dockerfile
ADDED
data/README.md
CHANGED
@@ -96,6 +96,21 @@ Whatever you change in the file will change in the service as soon as you restar
|
|
96
96
|
|
97
97
|
Enjoy
|
98
98
|
|
99
|
+
Using with Docker <3
|
100
|
+
-----------------------
|
101
|
+
|
102
|
+
When using with docker you don't need to add either ruby or the gem itself to your filesystem, you just need to have docker running in your computer.
|
103
|
+
|
104
|
+
$ docker pull camiloribeiro/rest_shifter:latest
|
105
|
+
$ docker run -it -v $PWD/spec/flavors:/root/.rest_shifter/flavors -p 8080:8080 camiloribeiro/rest_shifter -s
|
106
|
+
|
107
|
+
Access http://192.168.59.103:8080/hello_world
|
108
|
+
It should return a 200 ok response status with the json:
|
109
|
+
|
110
|
+
$ { "hello_world" : "Your service is working fine. :D" }
|
111
|
+
|
112
|
+
Replace the spec/flavors for a directory where you have your flavor files as described in this document. The container uses rest_shifter as endpoint, so if you want to start in SSL mode, just use -S instead. All the other parameters also work with the docker container entrypoint.
|
113
|
+
|
99
114
|
Developing
|
100
115
|
----------
|
101
116
|
To develop `RestShifter`, you are going to need [Bundler][1]
|
@@ -0,0 +1,18 @@
|
|
1
|
+
-----BEGIN CERTIFICATE-----
|
2
|
+
MIIC+zCCAeOgAwIBAgIJAPSH6k3GsSNeMA0GCSqGSIb3DQEBBQUAMBQxEjAQBgNV
|
3
|
+
BAMMCWxvY2FsaG9zdDAeFw0xNTA3MDcxNDQxMDNaFw0yNTA3MDQxNDQxMDNaMBQx
|
4
|
+
EjAQBgNVBAMMCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
|
5
|
+
ggEBAM22832AMf4mfCH9UcBxQqKqROch2529/GZz7aHnDdRxn7UaDoNmvNIERGw6
|
6
|
+
ES/vtyeUhfSZQ3KG88BHn+hQsrcm7DVLfZ0g+SoR57flg9NLBQwBpmHtG6yXwdkD
|
7
|
+
2odJ9JwdH18UXi30839uPMNHa4kc0upolK4t3CqagM3qGZoUTf5s3Ya28hWK5ZZp
|
8
|
+
/2VIbS619P2Hq7owfxZVI8KDhQO4DewN4SFQfY9+VvLhjwujG/8j0jSBR6RQpI0I
|
9
|
+
0i0NKAFsPdkfhDVdP2vmnN8Ia6ehLadZf+kChD7Y2tC2pNe3j72qWiET0LMbRa1P
|
10
|
+
6uruYiIErY4o5PxPQWRdHi9EY1ECAwEAAaNQME4wHQYDVR0OBBYEFLdeY5ZqlF42
|
11
|
+
bsSZf7Rs6WR/EOy6MB8GA1UdIwQYMBaAFLd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0ttkS2Q
|
24
|
+
aBpBnwKBgC5+gNpoF/c0tgwhZUPclug5V2oskEMiVdajrL4WwFGfhEL2kUljJiwl
|
25
|
+
Q4RzyxDnaib+weSb9hYmhWL9CLkHVGfBrqVpIvaIhdTuXbrMqsyyXO5GHiowxS/v
|
26
|
+
TC2Ym35mDeNQE5mv7Z8jsWxrWLY6ITvb91gzR3pDVPOPb8VxzPnq
|
27
|
+
-----END RSA PRIVATE KEY-----
|
@@ -13,7 +13,7 @@ class RestShifter::Commands::Start
|
|
13
13
|
prepare_server
|
14
14
|
Shifter.use Rack::SSL
|
15
15
|
Shifter.set :bind, '0.0.0.0'
|
16
|
-
Shifter.run_ssl! port.to_i, File.join(File.dirname(__FILE__), "
|
16
|
+
Shifter.run_ssl! port.to_i, File.join(File.dirname(__FILE__), "fake_certs/localhost.cert"), File.join(File.dirname(__FILE__), "fake_certs/localhost.key")
|
17
17
|
end
|
18
18
|
|
19
19
|
def run_secure(args=ARGV)
|
data/lib/rest_shifter/version.rb
CHANGED
@@ -0,0 +1,10 @@
|
|
1
|
+
## ! ~/.rest_shifter/flavors/hello_world.flavor
|
2
|
+
method_used = "get"
|
3
|
+
path = "/hello_world"
|
4
|
+
request_accept = ""
|
5
|
+
request_content_type = ""
|
6
|
+
response_sleep = 0
|
7
|
+
response_status = "200"
|
8
|
+
response_body = { "hello_world" : "Your service is working fine. :D" }
|
9
|
+
response_content_type = "application/json"
|
10
|
+
response_location = ""
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rest_shifter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.26
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Camilo Ribeiro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: codeclimate-test-reporter
|
@@ -177,6 +177,7 @@ files:
|
|
177
177
|
- .ruby-version
|
178
178
|
- .travis.yml
|
179
179
|
- CHANGES
|
180
|
+
- Dockerfile
|
180
181
|
- Gemfile
|
181
182
|
- LICENSE
|
182
183
|
- README.md
|
@@ -198,6 +199,9 @@ files:
|
|
198
199
|
- lib/rest_shifter.rb
|
199
200
|
- lib/rest_shifter/commands.rb
|
200
201
|
- lib/rest_shifter/commands/create.rb
|
202
|
+
- lib/rest_shifter/commands/fake_certs/localhost.cert
|
203
|
+
- lib/rest_shifter/commands/fake_certs/localhost.key
|
204
|
+
- lib/rest_shifter/commands/fake_certs/readme
|
201
205
|
- lib/rest_shifter/commands/help.rb
|
202
206
|
- lib/rest_shifter/commands/main.rb
|
203
207
|
- lib/rest_shifter/commands/start.rb
|
@@ -206,6 +210,7 @@ files:
|
|
206
210
|
- lib/rest_shifter/ssl_helper.rb
|
207
211
|
- lib/rest_shifter/version.rb
|
208
212
|
- rest_shifter.gemspec
|
213
|
+
- spec/flavors/helloworld.flavor
|
209
214
|
- spec/flavors/location_get.flavor
|
210
215
|
- spec/flavors/location_post.flavor
|
211
216
|
- spec/flavors/nocontenttype.flavor
|
@@ -246,6 +251,7 @@ signing_key:
|
|
246
251
|
specification_version: 4
|
247
252
|
summary: Simple Rest Mock service
|
248
253
|
test_files:
|
254
|
+
- spec/flavors/helloworld.flavor
|
249
255
|
- spec/flavors/location_get.flavor
|
250
256
|
- spec/flavors/location_post.flavor
|
251
257
|
- spec/flavors/nocontenttype.flavor
|