rest_shifter 0.0.4 → 0.0.5
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/CHANGES +4 -0
- data/README.md +9 -6
- data/lib/rest_shifter/commands/help.rb +2 -0
- data/lib/rest_shifter/shifter.rb +2 -3
- data/lib/rest_shifter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fba7cc33a3a70d78cdbecc7f5ddcbc3f3b21f96
|
4
|
+
data.tar.gz: fa69aee539b835ee673de3a7aff9c82e7a7b2e69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf285e2ac62122f91a54bcfc02da07aaabea307e217eddd97102e64460a0122278affaebfb0abdc295ea978e2562892ee4f2dc3edd577ff07716d5d15abcb93d
|
7
|
+
data.tar.gz: ffc80dd336031b0592fb12ed32ddc3d6f0eb80d77498162e7a77a18ccded44052d94bc9589628b17600b322bfca58d2662911e0b2417fa38a0b4bdb253959bf0
|
data/CHANGES
CHANGED
data/README.md
CHANGED
@@ -8,8 +8,8 @@
|
|
8
8
|
/
|
9
9
|
__ // The rest api ShapeShifter!
|
10
10
|
-\= \=\ //
|
11
|
-
--=_\=---//=-- This is a Sinatra app with no predefined routes.
|
12
|
-
-_==/ \/ //\/-- This replaces mocks for integration level tests.
|
11
|
+
--=_\=---//=-- This is a Sinatra app with no predefined routes.
|
12
|
+
-_==/ \/ //\/-- This replaces mocks for integration level tests.
|
13
13
|
==/ /O O\==-- This can be used also to create tests for new feature
|
14
14
|
_ _ _ _ /_/ \ ] /-- before the dependent services are in place
|
15
15
|
/\ ( (- \ / ] ] ]==- This can also be used for Rest prototipation
|
@@ -19,7 +19,7 @@
|
|
19
19
|
/ ( \ \_ \./ ) - Easy to define rest paths with custom routes
|
20
20
|
( \ \ ) \ - Easy to define rest paths with custom responses
|
21
21
|
( /\_ _ _ _ /---/ /\_ \ - Definition of response times and response codes
|
22
|
-
\ / \ / ____/ / \ \ - Suitable to any kind of tests that use Rest
|
22
|
+
\ / \ / ____/ / \ \ - Suitable to any kind of tests that use Rest
|
23
23
|
( / ) / / /__ ) ( )
|
24
24
|
( ) / __/ '---` / /
|
25
25
|
\ / \ \ _/ / This is still under development, so do not use it.
|
@@ -62,19 +62,22 @@ Using
|
|
62
62
|
The focus here is in simplicity.
|
63
63
|
|
64
64
|
Install rest_shifter
|
65
|
+
|
65
66
|
$ gem install rest_shifter
|
66
67
|
|
67
68
|
Create the service (you can choose any name that have only letters and underline. It is required to start with a letter )
|
69
|
+
|
68
70
|
$ rest_shifter -c hello_world
|
69
71
|
|
70
72
|
Start the service
|
73
|
+
|
71
74
|
$ rest_shifter -s
|
72
75
|
|
73
|
-
Go to a browser and open the url:
|
74
|
-
$ http://localhost:4567/hello_world
|
76
|
+
Go to a browser and open the url: [http://localhost:4567/hello_world](http://localhost:4567/hello_world)
|
75
77
|
|
76
78
|
You should see the following JSON:
|
77
|
-
|
79
|
+
|
80
|
+
{ \hello_world\ : \Your service is working fine. :D\ }
|
78
81
|
|
79
82
|
To edit the service you just created, go to ~/.rest_shifter/flavors/hello_world.flavor
|
80
83
|
The name of the file is the name that you used in the command -c (create).
|
@@ -11,6 +11,8 @@ rest_shifter version #{RestShifter::VERSION}: The ShapeShifter Rest Service
|
|
11
11
|
help Show this help text
|
12
12
|
|
13
13
|
--start, -s: Start service on port 4567
|
14
|
+
|
15
|
+
--create, -c: Create a config file for a service (send a name as argument)
|
14
16
|
|
15
17
|
--version, -v: Print version and exit
|
16
18
|
--help, -h: Show this message
|
data/lib/rest_shifter/shifter.rb
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
require 'sinatra/base'
|
2
2
|
require 'sinatra'
|
3
3
|
require 'icecream'
|
4
|
-
require 'pry'
|
5
4
|
|
6
5
|
module RestShifter; end
|
7
6
|
|
8
7
|
class Shifter < Sinatra::Base
|
9
8
|
|
10
9
|
# test
|
11
|
-
|
10
|
+
shapes = IceCream::IceCream.new File.join(File.dirname(__FILE__), "../../spec/flavors")
|
12
11
|
# prod
|
13
|
-
shapes = IceCream::IceCream.new File.dirname("#{Dir.home}/.rest_shifter/flavors/*")
|
12
|
+
#shapes = IceCream::IceCream.new File.dirname("#{Dir.home}/.rest_shifter/flavors/*")
|
14
13
|
|
15
14
|
services = []
|
16
15
|
shapes.all.each do |shape|
|
data/lib/rest_shifter/version.rb
CHANGED