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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aed0a9dad080d209db0fb7d86b2b94f3bd4d4c99
4
- data.tar.gz: f4c6e5b8519c7e7e24b3e1fade2e009fa063209f
3
+ metadata.gz: 428e1ab2442b942ab63071ea8598148e79574df5
4
+ data.tar.gz: 469192547f52f20755ec2b64dec1e6c487572970
5
5
  SHA512:
6
- metadata.gz: 6cb98b9bd210059ef49ca3591373b133d95450c2f599ee0a8ef101fdedf648baaff3650cf97ed925256b1de6155acc9be7a4ccb69d218c76afe7429e5dbebe6f
7
- data.tar.gz: dec924ed3cf44a33dbeac158a6441d6e8cdf2fbb7a3b68e90955a5bbcc71565a37e3b90f275fccb56b11f57d099490b4760a07ed6f5d9a129e6b7593d94289fe
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 mock sinatra server, to be used when developing apps or for ui automation using frank.
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 . Here a "default"
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
- This would provide with the following binaries
30
- - scenarios
31
- - scenariosdb
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
@@ -1,3 +1,3 @@
1
1
  module Scenarios
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
data/lib/scenarios.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require "scenarios/version"
2
2
 
3
3
  module Scenarios
4
- # Your code goes here...
5
4
  end
data/sample_config.yml ADDED
@@ -0,0 +1,2 @@
1
+ localport: 9000
2
+ localdbfile: /Users/vaibhav/.scenarios/scenarios.sqlite3
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.6
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-07-30 00:00:00.000000000 Z
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