qm 1.1.14 → 1.1.15
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/lib/defs-mongo.rb +2 -2
- data/lib/service.rb +11 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f7ce32d5a8f6608f6ed4d819a6a0167b15c5614
|
4
|
+
data.tar.gz: 95e3ea3a4ca0dda415ea111f77946e9a5b426704
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cb092e23e1801f2f11e02f6d88893f5501f57e89d5d28a300ea86561676bee348822c125ecfbf2b31284dce4c1ee461053d9bba4093d99cbc4a22ce861d6fc8
|
7
|
+
data.tar.gz: 8c6b83041d770925e812e50f2fc7e73db4c7a80611dce827fa34994f3f9b9c08d2ce082c7002f3b5a4bdb871a9c107af262830130406fc488b7cb3516a0e8abe
|
data/lib/defs-mongo.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
#- defs-mongo.rb ~~
|
4
4
|
# ~~ (c) SRW, 16 Jul 2014
|
5
|
-
# ~~ last updated
|
5
|
+
# ~~ last updated 21 Aug 2014
|
6
6
|
|
7
7
|
require 'json'
|
8
8
|
require 'mongo'
|
@@ -99,8 +99,8 @@ module Sinatra
|
|
99
99
|
host: request.host,
|
100
100
|
ip: request.ip,
|
101
101
|
method: request.request_method,
|
102
|
+
#status_code: response.status,
|
102
103
|
timestamp: Time.now,
|
103
|
-
#status: response.status,
|
104
104
|
url: request.fullpath
|
105
105
|
})
|
106
106
|
return
|
data/lib/service.rb
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
# of a 'box', 'key', or 'status' value.
|
17
17
|
#
|
18
18
|
# ~~ (c) SRW, 24 Apr 2013
|
19
|
-
# ~~ last updated
|
19
|
+
# ~~ last updated 28 Aug 2014
|
20
20
|
|
21
21
|
require 'sinatra'
|
22
22
|
require 'sinatra/cross_origin'
|
@@ -31,7 +31,7 @@ class QMachineService < Sinatra::Base
|
|
31
31
|
|
32
32
|
set avar_ttl: 86400, # seconds
|
33
33
|
enable_api_server: false,
|
34
|
-
|
34
|
+
enable_cors: false,
|
35
35
|
enable_web_server: false,
|
36
36
|
hostname: '0.0.0.0',
|
37
37
|
persistent_storage: {},
|
@@ -90,7 +90,7 @@ class QMachineService < Sinatra::Base
|
|
90
90
|
(@box.match(/^[\w\-]+$/)) and
|
91
91
|
((@key.is_a?(String) and @key.match(/^[A-Za-z0-9]+$/)) or
|
92
92
|
(@status.is_a?(String) and @status.match(/^[A-Za-z0-9]+$/)))
|
93
|
-
cross_origin if settings.
|
93
|
+
cross_origin if settings.enable_cors?
|
94
94
|
end
|
95
95
|
|
96
96
|
get '/:version/:box' do
|
@@ -126,6 +126,14 @@ class QMachineService < Sinatra::Base
|
|
126
126
|
return [201, {'Content-Type' => 'text/plain'}, ['']]
|
127
127
|
end
|
128
128
|
|
129
|
+
get '/robots.txt' do
|
130
|
+
# This route tells web crawlers to keep out of an API server, but it
|
131
|
+
# delegates to a static file if the web server is enabled.
|
132
|
+
pass if settings.enable_web_server?
|
133
|
+
y = "User-agent: *\nDisallow: /\n"
|
134
|
+
return [200, {'Content-Type' => 'text/plain'}, [y]]
|
135
|
+
end
|
136
|
+
|
129
137
|
get '/' do
|
130
138
|
# This route enables a static index page to be served from the public
|
131
139
|
# folder, if and only if QM's web server has been enabled.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Wilkinson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bson_ext
|
@@ -145,5 +145,5 @@ rubyforge_project:
|
|
145
145
|
rubygems_version: 2.4.1
|
146
146
|
signing_key:
|
147
147
|
specification_version: 4
|
148
|
-
summary: A platform for World Wide Computing
|
148
|
+
summary: 'QMachine: A platform for World Wide Computing'
|
149
149
|
test_files: []
|