rethinkdb_job 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/rethinkdb_job.rb CHANGED
@@ -20,7 +20,7 @@ class RethinkDBJob
20
20
 
21
21
  def create
22
22
  ensure_setup
23
- result = @r.table(@table).insert({}, :return_vals => true).run(@rdb)
23
+ result = @r.table(@table).insert({}, :return_vals => true).run(rdb)
24
24
  if result["inserted"] == 1
25
25
  result["new_val"]["id"]
26
26
  else
@@ -29,14 +29,14 @@ class RethinkDBJob
29
29
  end
30
30
 
31
31
  def find(job_id)
32
- @r.table(@table).get(job_id).run(@rdb)
32
+ @r.table(@table).get(job_id).run(rdb)
33
33
  end
34
34
 
35
35
  TIMESTAMP_COLUMNS = [:job_start, :job_finish]
36
36
  def set_timestamp(job_id, column, time=Time.now)
37
37
  ensure_setup
38
38
  if TIMESTAMP_COLUMNS.include?(column.to_sym)
39
- @r.table(@table).get(job_id).update(column => time).run(@rdb)
39
+ @r.table(@table).get(job_id).update(column => time).run(rdb)
40
40
  time
41
41
  else
42
42
  raise "expected column to be one of #{timestamp_columns.inspect} (#{column.inspect})"
@@ -44,6 +44,7 @@ class RethinkDBJob
44
44
  end
45
45
 
46
46
  def logdir
47
+ raise "RethinkDBJob :logdir not set" if @rdb_config[:logdir].nil?
47
48
  @rdb_config[:logdir]
48
49
  end
49
50
 
@@ -1,3 +1,3 @@
1
1
  module RethinkdbJob
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rethinkdb_job
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-08-24 00:00:00.000000000 Z
12
+ date: 2014-08-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rethinkdb