taps2 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/taps/db_session.rb +13 -12
- data/lib/taps/server.rb +2 -2
- data/lib/taps/version.rb +1 -1
- 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: 90d456e2f3cc63da7d527fb43f19203e2d5cf223
|
4
|
+
data.tar.gz: 26901b91006ce88eab5b65e6ed72ce8ad93d7cc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1666f844b2af103978f95b7da215dd6b265b1753510ffdbfbe4e1267c6ab70bb70f755956a67031823ba47bda8a9638aa50c01c09c651a5c9a2df0aaa5bb8ca0
|
7
|
+
data.tar.gz: 14198719b01808971eba5cf90f8c8c108fe34610c5201fd734985615cc841c649b6aff84873aed2fac80c150b06e43ffd0edd3cae2a1e0b220dc15006ee8e8c0
|
data/lib/taps/db_session.rb
CHANGED
@@ -1,20 +1,21 @@
|
|
1
|
-
|
1
|
+
DB = Sequel.connect(Taps::Config.taps_database_url)
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
end
|
3
|
+
#DbSession.create_table! unless DbSession.table_exists?
|
4
|
+
DB.create_table? :db_session do
|
5
|
+
primary_key :id
|
6
|
+
text :key
|
7
|
+
text :database_url
|
8
|
+
timestamp :started_at
|
9
|
+
timestamp :last_access
|
10
|
+
end
|
12
11
|
|
12
|
+
Sequel::Model.db = DB
|
13
|
+
Sequel::Model.require_valid_table = false
|
14
|
+
|
15
|
+
class DbSession < Sequel::Model
|
13
16
|
def conn
|
14
17
|
Sequel.connect(database_url) do |db|
|
15
18
|
yield db if block_given?
|
16
19
|
end
|
17
20
|
end
|
18
21
|
end
|
19
|
-
|
20
|
-
DbSession.create_table! unless DbSession.table_exists?
|
data/lib/taps/server.rb
CHANGED
@@ -31,8 +31,8 @@ module Taps
|
|
31
31
|
before do
|
32
32
|
unless request.path_info == '/health'
|
33
33
|
major, minor = request.env['HTTP_TAPS_VERSION'].to_s.split('.')
|
34
|
-
unless Taps.compatible_version == "#{major}.#{minor}"
|
35
|
-
halt 417, "Taps >= v#{Taps.compatible_version}.x is required for this server"
|
34
|
+
unless Taps::Version.compatible_version == "#{major}.#{minor}"
|
35
|
+
halt 417, "Taps >= v#{Taps::Version.compatible_version}.x is required for this server"
|
36
36
|
end
|
37
37
|
end
|
38
38
|
end
|
data/lib/taps/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: taps2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ricardo Chimal, Jr.
|
@@ -57,14 +57,14 @@ dependencies:
|
|
57
57
|
name: sequel
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- - "
|
60
|
+
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '4.0'
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- - "
|
67
|
+
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '4.0'
|
70
70
|
- !ruby/object:Gem::Dependency
|