scenario_server 0.0.6 → 0.0.7
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 +23 -6
- data/lib/scenarios/application/app.rb +2 -2
- data/lib/scenarios/version.rb +1 -1
- data/lib/scenarios.rb +0 -1
- data/sample_config.yml +2 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 428e1ab2442b942ab63071ea8598148e79574df5
|
4
|
+
data.tar.gz: 469192547f52f20755ec2b64dec1e6c487572970
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34269dfd4153e5932e32ce393d58008e7ee9ff7143bec9cd09273e0ff49b28987a2a676010445e661d92ed805087bc387863a877c94bca7ed38f490c3566f80a
|
7
|
+
data.tar.gz: f87c3e8a0c778da0a4316f284845fe867c0e144dd7b3102e0f6cd340aa734fe82e99e01e259cf6e5092c7d088675cee4998d1188c8d49df69dd328b496f87f9b
|
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# Scenarios
|
2
2
|
|
3
|
-
This gem is used to setup a
|
3
|
+
This gem is used to setup a quick local api server
|
4
4
|
|
5
|
-
As the server is started for the first time, point your browser to http://localhost:4567/scenarios .
|
6
|
-
scenario is present. You can add various routes to this scenario.
|
5
|
+
As the server is started for the first time, point your browser to http://localhost:4567/scenarios .
|
6
|
+
Here a "default" scenario is present. You can add various routes to this scenario.
|
7
7
|
|
8
8
|
for e.g. a sample route added would be
|
9
9
|
GET , '/v1/mystyle' {"Hello":"world"}
|
@@ -26,6 +26,23 @@ Or install it yourself as:
|
|
26
26
|
|
27
27
|
## Usage
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
29
|
+
The server can be started in daemon mode by
|
30
|
+
|
31
|
+
scenario_service start
|
32
|
+
|
33
|
+
or
|
34
|
+
|
35
|
+
without a daemon mode
|
36
|
+
|
37
|
+
scenario_service start -T
|
38
|
+
|
39
|
+
## Configuration
|
40
|
+
|
41
|
+
a yaml file can be provided at the following location
|
42
|
+
~/.scenarios/config.yml
|
43
|
+
to hold the port to be used and the path of a sqlite database.
|
44
|
+
If this file is not provided, the db file is created inside the
|
45
|
+
gem folder.
|
46
|
+
|
47
|
+
Please see sample_config.yml for more info.
|
48
|
+
|
@@ -31,7 +31,7 @@ class ScenarioServer < Sinatra::Base
|
|
31
31
|
set :scenario, DEFAULT_SCENARIO
|
32
32
|
enable :logging
|
33
33
|
set :server, %w[thin mongrel webrick]
|
34
|
-
if settings.localport
|
34
|
+
if defined?(settings.localport)
|
35
35
|
set :port, settings.localport
|
36
36
|
else
|
37
37
|
set :port, 4567
|
@@ -52,7 +52,7 @@ class ScenarioServer < Sinatra::Base
|
|
52
52
|
before do
|
53
53
|
|
54
54
|
# configure database
|
55
|
-
if settings.localdbfile
|
55
|
+
if defined?(settings.localdbfile)
|
56
56
|
puts "using db: "+settings.localdbfile
|
57
57
|
options = {:db_file=>settings.localdbfile}
|
58
58
|
else
|
data/lib/scenarios/version.rb
CHANGED
data/lib/scenarios.rb
CHANGED
data/sample_config.yml
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scenario_server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vaibhav Bhatia
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|
@@ -194,6 +194,7 @@ files:
|
|
194
194
|
- lib/scenarios/data/readme.md
|
195
195
|
- lib/scenarios/scenario_db.rb
|
196
196
|
- lib/scenarios/version.rb
|
197
|
+
- sample_config.yml
|
197
198
|
- scenarios.gemspec
|
198
199
|
- spec/app_spec.rb
|
199
200
|
- spec/spec_helper.rb
|