drb_sqlite 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/drb_sqlite.rb +21 -6
- data.tar.gz.sig +0 -0
- metadata +24 -5
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1719657b8dfca0eecd264c3694d3a682fc1186820dd82b37dc0b85a5ad391f89
|
4
|
+
data.tar.gz: c774c26a1efbcdf192988db1f996085cecc3dcb393ac8b0aa500b59ece6997a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 837a90c35eac1fa35f3d60e36b738423a94173eaaf3cf7142790386ed852929c1e0f49f357bedc6fbe123aeb1ea9cc3bd9c552d6b95d88f06bbb8bb33b45ff53
|
7
|
+
data.tar.gz: 921e96da513953af47f28d2a4c7269f27805e108bdb374bad9af169d99ba4da5405b1ea4d8b3b0ead011dc62df77685c8947b46ad394fb556ccef5cf4ebb713b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/drb_sqlite.rb
CHANGED
@@ -3,20 +3,26 @@
|
|
3
3
|
# file: drb_sqlite.rb
|
4
4
|
|
5
5
|
require 'drb'
|
6
|
+
require 'c32'
|
7
|
+
|
6
8
|
|
7
9
|
class SQLiteServerError < Exception
|
8
10
|
end
|
9
11
|
|
10
12
|
class DRbSQLite
|
13
|
+
using ColouredText
|
11
14
|
|
12
|
-
def initialize(raw_dbfile=nil, host: nil, port: '57000')
|
13
|
-
|
14
|
-
|
15
|
+
def initialize(raw_dbfile=nil, host: nil, port: '57000', debug: false)
|
16
|
+
|
17
|
+
|
18
|
+
@host, @port, @debug = host, port, debug
|
19
|
+
|
20
|
+
puts 'inside DRbSQLite'.info if @debug
|
15
21
|
|
16
22
|
DRb.start_service
|
17
23
|
|
18
24
|
if raw_dbfile then
|
19
|
-
|
25
|
+
load_db(raw_dbfile)
|
20
26
|
else
|
21
27
|
@server = DRbObject.new nil, "druby://#{host}:#{port}"
|
22
28
|
end
|
@@ -38,17 +44,26 @@ class DRbSQLite
|
|
38
44
|
@server.exists? dbfile
|
39
45
|
end
|
40
46
|
|
41
|
-
def
|
47
|
+
def load_db(raw_dbfile)
|
48
|
+
|
49
|
+
puts 'DRbSQLite | inside load_db'.info if @debug
|
42
50
|
|
43
51
|
if raw_dbfile =~ /^sqlite:\/\// then
|
44
52
|
host, @dbfile = raw_dbfile\
|
45
53
|
.match(/(?<=^sqlite:\/\/)([^\/]+)\/(.*)/).captures
|
54
|
+
|
55
|
+
if @debug then
|
56
|
+
puts ('host: ' + host.inspect).debug
|
57
|
+
puts ('@dbfile: ' + @dbfile.inspect).debug
|
58
|
+
end
|
59
|
+
|
46
60
|
@server = DRbObject.new nil, "druby://#{host}:#{@port}"
|
47
61
|
else
|
48
62
|
@dbfile = raw_dbfile
|
63
|
+
@server = DRbObject.new nil, "druby://#{@host}:#{@port}"
|
49
64
|
end
|
50
65
|
|
51
|
-
@server.
|
66
|
+
@server.load_db(@dbfile)
|
52
67
|
end
|
53
68
|
|
54
69
|
def query(*args, &blk)
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: drb_sqlite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,8 +35,28 @@ cert_chain:
|
|
35
35
|
mybZGWCZ9IMBI6L8ParyIfuosSf+xiEislKiCmSUKJVoIlCQJjjyQ3xCnaA4xMlO
|
36
36
|
sMq03hOXxpYXAteF2Kmy2wiZ
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date:
|
39
|
-
dependencies:
|
38
|
+
date: 2019-02-17 00:00:00.000000000 Z
|
39
|
+
dependencies:
|
40
|
+
- !ruby/object:Gem::Dependency
|
41
|
+
name: c32
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0.1'
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 0.1.2
|
50
|
+
type: :runtime
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - "~>"
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '0.1'
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: 0.1.2
|
40
60
|
description:
|
41
61
|
email: james@jamesrobertson.eu
|
42
62
|
executables: []
|
@@ -63,8 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
63
83
|
- !ruby/object:Gem::Version
|
64
84
|
version: '0'
|
65
85
|
requirements: []
|
66
|
-
|
67
|
-
rubygems_version: 2.7.6
|
86
|
+
rubygems_version: 3.0.1
|
68
87
|
signing_key:
|
69
88
|
specification_version: 4
|
70
89
|
summary: Connects to a remote SQLite database (sqlite_server2018 gem).
|
metadata.gz.sig
CHANGED
Binary file
|