postjob 0.3.1 → 0.3.2
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/postjob/cli/ps.rb +1 -1
- data/lib/postjob/queue/search.rb +4 -4
- data/spec/support/test_helper.rb +4 -4
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e47bcd99a363a5715728af719726a814c5e574b9
|
4
|
+
data.tar.gz: c50dd5cecf1f2453bbf55e38cb3a3d15c3990013
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22acf73031797e4fc1b94796b01e0aef0c1dbe591b376c109730a8673151878e2f87b797d436a46ba746b67c588f88217a398a7233f0f6914d96dab91585e6b7
|
7
|
+
data.tar.gz: 2fd15eb599a3eab9a599ce2a46c2b28efa5af1b46b36a1962962de66cf5609af481e8f30bfa9869feee4694d3b11083c00feaea52a2f7893904c9ee181e8cb18
|
data/lib/postjob/cli/ps.rb
CHANGED
@@ -100,7 +100,7 @@ module Postjob::CLI
|
|
100
100
|
def ps_show(id, *ids)
|
101
101
|
ids = ([id] + ids).map { |s| Integer(s) }
|
102
102
|
|
103
|
-
jobs = Simple::SQL.
|
103
|
+
jobs = Simple::SQL.all <<~SQL, ids, into: Postjob::Job
|
104
104
|
SELECT * FROM postjob.postjobs WHERE id = ANY($1)
|
105
105
|
SQL
|
106
106
|
|
data/lib/postjob/queue/search.rb
CHANGED
@@ -6,14 +6,14 @@ end
|
|
6
6
|
module Postjob::Queue::Search
|
7
7
|
extend self
|
8
8
|
|
9
|
-
def one(id, filter: {}, into:
|
9
|
+
def one(id, filter: {}, into: Hash)
|
10
10
|
query = query(page: 0, per: 1, filter: filter, id: id)
|
11
|
-
Simple::SQL.
|
11
|
+
Simple::SQL.ask(query, into: into)
|
12
12
|
end
|
13
13
|
|
14
|
-
def all(page: 0, per: 100, filter: {}, into:
|
14
|
+
def all(page: 0, per: 100, filter: {}, into: Hash)
|
15
15
|
query = query(page: page, per: per, filter: filter)
|
16
|
-
Simple::SQL.
|
16
|
+
Simple::SQL.all(query, into: into)
|
17
17
|
end
|
18
18
|
|
19
19
|
private
|
data/spec/support/test_helper.rb
CHANGED
@@ -8,15 +8,15 @@ module TestHelper
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def newest_job
|
11
|
-
Simple::SQL.
|
11
|
+
Simple::SQL.ask "SELECT * FROM postjobs ORDER BY id DESC", into: Postjob::Job
|
12
12
|
end
|
13
13
|
|
14
14
|
def load_job(id_or_sql, *args)
|
15
15
|
case id_or_sql
|
16
16
|
when Integer
|
17
|
-
Simple::SQL.
|
17
|
+
Simple::SQL.ask "SELECT * FROM postjobs WHERE id=$1", id_or_sql, into: Postjob::Job
|
18
18
|
else
|
19
|
-
Simple::SQL.
|
19
|
+
Simple::SQL.ask id_or_sql, *args, into: Postjob::Job
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
@@ -27,7 +27,7 @@ module TestHelper
|
|
27
27
|
def print_sql(sql, *args)
|
28
28
|
require "table_print"
|
29
29
|
|
30
|
-
records = Simple::SQL.
|
30
|
+
records = Simple::SQL.all(sql, *args)
|
31
31
|
tp records
|
32
32
|
end
|
33
33
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: postjob
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- radiospiel
|
@@ -120,20 +120,20 @@ dependencies:
|
|
120
120
|
requirements:
|
121
121
|
- - "~>"
|
122
122
|
- !ruby/object:Gem::Version
|
123
|
-
version: '0.
|
123
|
+
version: '0.3'
|
124
124
|
- - ">="
|
125
125
|
- !ruby/object:Gem::Version
|
126
|
-
version: 0.
|
126
|
+
version: 0.3.7
|
127
127
|
type: :runtime
|
128
128
|
prerelease: false
|
129
129
|
version_requirements: !ruby/object:Gem::Requirement
|
130
130
|
requirements:
|
131
131
|
- - "~>"
|
132
132
|
- !ruby/object:Gem::Version
|
133
|
-
version: '0.
|
133
|
+
version: '0.3'
|
134
134
|
- - ">="
|
135
135
|
- !ruby/object:Gem::Version
|
136
|
-
version: 0.
|
136
|
+
version: 0.3.7
|
137
137
|
- !ruby/object:Gem::Dependency
|
138
138
|
name: simple-cli
|
139
139
|
requirement: !ruby/object:Gem::Requirement
|