perfectsched 0.7.5 → 0.7.6
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +5 -0
- data/lib/perfectsched/backend/rdb.rb +33 -30
- data/lib/perfectsched/version.rb +1 -1
- metadata +10 -10
data/ChangeLog
CHANGED
@@ -9,40 +9,43 @@ class RDBBackend < Backend
|
|
9
9
|
@uri = uri
|
10
10
|
@table = table
|
11
11
|
@db = Sequel.connect(@uri)
|
12
|
-
init_db(@uri.split('//',2)[0])
|
13
|
-
end
|
14
|
-
|
15
|
-
private
|
16
|
-
def init_db(type)
|
17
|
-
sql = ''
|
18
|
-
case type
|
19
|
-
when /mysql/i
|
20
|
-
sql << "CREATE TABLE IF NOT EXISTS `#{@table}` ("
|
21
|
-
sql << " id VARCHAR(256) NOT NULL,"
|
22
|
-
sql << " timeout INT NOT NULL,"
|
23
|
-
sql << " next_time INT NOT NULL,"
|
24
|
-
sql << " cron VARCHAR(128) NOT NULL,"
|
25
|
-
sql << " delay INT NOT NULL,"
|
26
|
-
sql << " data BLOB NOT NULL,"
|
27
|
-
sql << " PRIMARY KEY (id)"
|
28
|
-
sql << ") ENGINE=INNODB;"
|
29
|
-
else
|
30
|
-
sql << "CREATE TABLE IF NOT EXISTS `#{@table}` ("
|
31
|
-
sql << " id VARCHAR(256) NOT NULL,"
|
32
|
-
sql << " timeout INT NOT NULL,"
|
33
|
-
sql << " next_time INT NOT NULL,"
|
34
|
-
sql << " cron VARCHAR(128) NOT NULL,"
|
35
|
-
sql << " delay INT NOT NULL,"
|
36
|
-
sql << " data BLOB NOT NULL,"
|
37
|
-
sql << " PRIMARY KEY (id)"
|
38
|
-
sql << ");"
|
39
|
-
end
|
40
|
-
# TODO index
|
12
|
+
#init_db(@uri.split('//',2)[0])
|
41
13
|
connect {
|
42
|
-
|
14
|
+
# connection test
|
43
15
|
}
|
44
16
|
end
|
45
17
|
|
18
|
+
private
|
19
|
+
#def init_db(type)
|
20
|
+
# sql = ''
|
21
|
+
# case type
|
22
|
+
# when /mysql/i
|
23
|
+
# sql << "CREATE TABLE IF NOT EXISTS `#{@table}` ("
|
24
|
+
# sql << " id VARCHAR(256) NOT NULL,"
|
25
|
+
# sql << " timeout INT NOT NULL,"
|
26
|
+
# sql << " next_time INT NOT NULL,"
|
27
|
+
# sql << " cron VARCHAR(128) NOT NULL,"
|
28
|
+
# sql << " delay INT NOT NULL,"
|
29
|
+
# sql << " data BLOB NOT NULL,"
|
30
|
+
# sql << " PRIMARY KEY (id)"
|
31
|
+
# sql << ") ENGINE=INNODB;"
|
32
|
+
# else
|
33
|
+
# sql << "CREATE TABLE IF NOT EXISTS `#{@table}` ("
|
34
|
+
# sql << " id VARCHAR(256) NOT NULL,"
|
35
|
+
# sql << " timeout INT NOT NULL,"
|
36
|
+
# sql << " next_time INT NOT NULL,"
|
37
|
+
# sql << " cron VARCHAR(128) NOT NULL,"
|
38
|
+
# sql << " delay INT NOT NULL,"
|
39
|
+
# sql << " data BLOB NOT NULL,"
|
40
|
+
# sql << " PRIMARY KEY (id)"
|
41
|
+
# sql << ");"
|
42
|
+
# end
|
43
|
+
# # TODO index
|
44
|
+
# connect {
|
45
|
+
# @db.run sql
|
46
|
+
# }
|
47
|
+
#end
|
48
|
+
|
46
49
|
def connect(&block)
|
47
50
|
begin
|
48
51
|
block.call
|
data/lib/perfectsched/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: perfectsched
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-12-
|
12
|
+
date: 2011-12-09 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: cron-spec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70298435645560 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - <=
|
@@ -24,10 +24,10 @@ dependencies:
|
|
24
24
|
version: 0.1.2
|
25
25
|
type: :runtime
|
26
26
|
prerelease: false
|
27
|
-
version_requirements: *
|
27
|
+
version_requirements: *70298435645560
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: sequel
|
30
|
-
requirement: &
|
30
|
+
requirement: &70298435644720 !ruby/object:Gem::Requirement
|
31
31
|
none: false
|
32
32
|
requirements:
|
33
33
|
- - ~>
|
@@ -35,10 +35,10 @@ dependencies:
|
|
35
35
|
version: 3.26.0
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
|
-
version_requirements: *
|
38
|
+
version_requirements: *70298435644720
|
39
39
|
- !ruby/object:Gem::Dependency
|
40
40
|
name: aws-sdk
|
41
|
-
requirement: &
|
41
|
+
requirement: &70298435644200 !ruby/object:Gem::Requirement
|
42
42
|
none: false
|
43
43
|
requirements:
|
44
44
|
- - ~>
|
@@ -46,10 +46,10 @@ dependencies:
|
|
46
46
|
version: 1.1.1
|
47
47
|
type: :runtime
|
48
48
|
prerelease: false
|
49
|
-
version_requirements: *
|
49
|
+
version_requirements: *70298435644200
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
51
|
name: perfectqueue
|
52
|
-
requirement: &
|
52
|
+
requirement: &70298435643640 !ruby/object:Gem::Requirement
|
53
53
|
none: false
|
54
54
|
requirements:
|
55
55
|
- - ~>
|
@@ -57,7 +57,7 @@ dependencies:
|
|
57
57
|
version: 0.7.0
|
58
58
|
type: :runtime
|
59
59
|
prerelease: false
|
60
|
-
version_requirements: *
|
60
|
+
version_requirements: *70298435643640
|
61
61
|
description:
|
62
62
|
email: frsyuki@gmail.com
|
63
63
|
executables:
|