pbs 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6b983a1e056e48ac1fb0973f565910ecaa7b59e8
4
- data.tar.gz: 72ea5ac4e9b96137f9d234f44ea9912bb4aef298
3
+ metadata.gz: 2ad4146d23f9e6cdabb8fd29d0acef07e9ebc931
4
+ data.tar.gz: 2af9fd377f59eba1a511a4437777d8fc83b9ca52
5
5
  SHA512:
6
- metadata.gz: afe01c15267f13df46e452dab396cf568af6751fe4a92648f174b2d3a2af30443b902115938a28c9e4e7e37b0e436e1d37f13f616c3eff0a61c68f1912956c64
7
- data.tar.gz: ef15244b9433ffff530d12da0a90a01a3e7d017c127028005f3831322f7cfac1a7c84c07cdf0c9ffdfc64d8ba3c47f53ae62cec06bd1d37d7141cfdf287e0a61
6
+ metadata.gz: 1dc0e94fc987178c1b6044206b1e9f1bd288b6448638d57c29aa18762c8dbccacf8f04def9e4ae868d9fd0bff1c9c9dcfc7473a0b9d833fd94dc8dca3c260b00
7
+ data.tar.gz: e8d0dbf079d8e4512ce5d54dcab71326bb78e7548c0597d6a16622b4e3d28511f203164b4d294bf8a53ea5c2452177b89c92ddcec7e6822e7b66a6ffc550d616
@@ -1,5 +1,11 @@
1
1
  ## Unreleased
2
2
 
3
+ ## 2.0.1 (2016-08-10)
4
+
5
+ Features:
6
+
7
+ - batch object can be initialized with lib/bin directories
8
+
3
9
  ## 2.0.0 (2016-08-05)
4
10
 
5
11
  Features:
@@ -9,23 +9,51 @@ module PBS
9
9
  # @return [String] the batch server host
10
10
  attr_reader :host
11
11
 
12
- # The path to the Torque client installation
12
+ # The path to the Torque client installation libraries
13
13
  # @example For Torque 5.0.0
14
- # my_conn.prefix.to_s #=> "/usr/local/torque/5.0.0"
15
- # @return [Pathname, nil] path to torque installation
16
- attr_reader :prefix
14
+ # my_conn.lib.to_s #=> "/usr/local/torque/5.0.0/lib"
15
+ # @return [Pathname] path to torque libraries
16
+ def lib
17
+ @lib ||=
18
+ if @prefix.join('lib').directory?
19
+ @prefix.join('lib')
20
+ elsif @prefix.join('lib32').directory?
21
+ @prefix.join('lib32')
22
+ elsif @prefix.join('lib64').directory?
23
+ @prefix.join('lib64')
24
+ else
25
+ @prefix
26
+ end
27
+ end
28
+
29
+ # The path to the Torque client installation binaries
30
+ # @example For Torque 5.0.0
31
+ # my_conn.bin.to_s #=> "/usr/local/torque/5.0.0/bin"
32
+ # @return [Pathname] path to torque binaries
33
+ def bin
34
+ @bin ||=
35
+ if @prefix.join('bin').directory?
36
+ @prefix.join('bin')
37
+ else
38
+ @prefix
39
+ end
40
+ end
17
41
 
18
42
  # @param host [#to_s] the batch server host
19
- # @param prefix [#to_s, nil] path to torque installation
20
- def initialize(host:, prefix: nil, **_)
43
+ # @param prefix [#to_s] path to torque installation
44
+ # @param lib [#to_s, nil] path to torque installation libraries
45
+ # @param bin [#to_s, nil] path to torque installation binaries
46
+ def initialize(host:, prefix: '', lib: nil, bin: nil, **_)
21
47
  @host = host.to_s
22
- @prefix = Pathname.new(prefix) if prefix
48
+ @prefix = Pathname.new(prefix)
49
+ @lib = Pathname.new(lib) if lib
50
+ @bin = Pathname.new(bin) if bin
23
51
  end
24
52
 
25
53
  # Convert object to hash
26
54
  # @return [Hash] the hash describing this object
27
55
  def to_h
28
- {host: host, prefix: prefix}
56
+ {host: host, lib: lib, bin: bin}
29
57
  end
30
58
 
31
59
  # The comparison operator
@@ -54,7 +82,7 @@ module PBS
54
82
  # @yieldparam cid [Fixnum] connection id from established batch server connection
55
83
  # @yieldreturn the final value of the block
56
84
  def connect(&block)
57
- Torque.lib = prefix ? prefix.join('lib', 'libtorque.so') : nil
85
+ Torque.lib = lib.join('libtorque.so')
58
86
  cid = Torque.pbs_connect(host)
59
87
  Torque.raise_error(cid.abs) if cid < 0 # raise error if negative connection id
60
88
  begin
@@ -326,7 +354,11 @@ module PBS
326
354
  end.flatten
327
355
  params << script.to_s
328
356
 
329
- o, e, s = Open3.capture3(prefix.join("bin", "qsub").to_s, *params)
357
+ env = {
358
+ "LD_LIBRARY_PATH" => "#{lib}:#{ENV['LD_LIBRARY_PATH']}"
359
+ }
360
+ cmd = bin.join("qsub").to_s
361
+ o, e, s = Open3.capture3(env, cmd, *params)
330
362
  raise PBS::Error, e unless s.success?
331
363
  o.chomp
332
364
  end
@@ -1,4 +1,4 @@
1
1
  module PBS
2
2
  # The current version of PBS
3
- VERSION = "2.0.0"
3
+ VERSION = "2.0.1"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pbs
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Nicklas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-05 00:00:00.000000000 Z
11
+ date: 2016-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi