autodesk_backburner_client 0.3.0 → 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.
data/README.md CHANGED
@@ -1,24 +1,27 @@
1
- # Autodesk Backburner Client
1
+ # Autodesk Backburner Client v0.3.1
2
2
 
3
- TODO: Write a gem description
3
+ This is quite simple Autodesk Backburner client. It allows users to communicate with Autodesk Backburner manager and request an information about jobs and servers.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  Add this line to your application's Gemfile:
8
8
 
9
- gem 'backburner', git: 'git@github.com:panasyuk/autodesk_backburner_client'
9
+ gem "autodesk_backburner_client", "~> 0.3.1"
10
10
 
11
11
  And then execute:
12
12
 
13
- $ bundle
13
+ $ bundle install
14
14
 
15
15
  ## Usage
16
+ ### Simple example
16
17
  ```ruby
17
18
  require 'backburner'
18
19
 
19
20
  c = Backburner::Client.new '127.0.0.1', 3234
20
21
  jobs = c.jobs
21
22
  jobs[0].name # => "Test Job"
23
+ jobs[0].server_time # => 0.32345
24
+ jobs[0].servers # => [ Array of servers addressed to this job ]
22
25
  ```
23
26
 
24
27
  ## Contributing
@@ -2,6 +2,8 @@ module Backburner
2
2
 
3
3
  class Job < BackburnerObject
4
4
 
5
+ JOB_STATES = [:complete, :not_started, :waiting, :suspended, :running]
6
+
5
7
  def load_raw_data
6
8
  @connection.job.get(handler)
7
9
  end
@@ -20,10 +22,29 @@ module Backburner
20
22
  end
21
23
  end
22
24
 
25
+ def walltime
26
+ @raw_data.job.job_info.ended - @raw_data.job.job_info.started
27
+ rescue
28
+ 0.0
29
+ end
30
+
23
31
  def name
24
32
  @raw_data.job.job_info.name
25
33
  end
26
34
 
35
+ def state
36
+ @connection.jobstate.get(@raw_data.job.job_info.handle)
37
+ case @connection.last_size
38
+ when 0 then :complete
39
+ when 1 then :not_started
40
+ when 2 then :waiting
41
+ when 3 then :suspended
42
+ when 4 then :running
43
+ else :undefined
44
+ end
45
+ end
46
+
47
+
27
48
  end
28
49
 
29
50
  end
@@ -1,3 +1,3 @@
1
1
  module Backburner
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autodesk_backburner_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
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: 2013-12-30 00:00:00.000000000 Z
12
+ date: 2014-01-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nori