pbs 2.0.1 → 2.0.2

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: 2ad4146d23f9e6cdabb8fd29d0acef07e9ebc931
4
- data.tar.gz: 2af9fd377f59eba1a511a4437777d8fc83b9ca52
3
+ metadata.gz: c42c7352f3bed19c09615d1478787d9a806c1231
4
+ data.tar.gz: e97cd9bbecb3f5c3cc032a8c6d98eda8e48228b0
5
5
  SHA512:
6
- metadata.gz: 1dc0e94fc987178c1b6044206b1e9f1bd288b6448638d57c29aa18762c8dbccacf8f04def9e4ae868d9fd0bff1c9c9dcfc7473a0b9d833fd94dc8dca3c260b00
7
- data.tar.gz: e8d0dbf079d8e4512ce5d54dcab71326bb78e7548c0597d6a16622b4e3d28511f203164b4d294bf8a53ea5c2452177b89c92ddcec7e6822e7b66a6ffc550d616
6
+ metadata.gz: c54720352ae8cb8fa44a2c00738bfba451cdfebad7d73b00a310e5e88d6083bd6db9271dccb48918ba64df9b3dd8083101125fafa5fc0a30264f1f31ca3df89e
7
+ data.tar.gz: a50902c7b82d77d6e17d502b6f19e7a6aa36f346478831728b5edea822aaebb01c7740cf860bf16b737539382ea4b4d610df983cd820e6b0403913dcd28ee81c
@@ -1,5 +1,12 @@
1
1
  ## Unreleased
2
2
 
3
+ ## 2.0.2 (2016-08-17)
4
+
5
+ Bugfixes:
6
+
7
+ - fixes Ruby version requirement to 2.2.0+
8
+ - removes unused prefix directory option
9
+
3
10
  ## 2.0.1 (2016-08-10)
4
11
 
5
12
  Features:
data/README.md CHANGED
@@ -27,7 +27,11 @@ installation as:
27
27
 
28
28
  ```ruby
29
29
  # Create new batch object for OSC's Oakley batch server
30
- oakley = PBS::Batch.new(host: 'oak-batch.osc.edu', prefix: '/usr/local/torque/default')
30
+ oakley = PBS::Batch.new(
31
+ host: 'oak-batch.osc.edu',
32
+ lib: '/usr/local/torque/default/lib',
33
+ bin: '/usr/local/torque/bin'
34
+ )
31
35
 
32
36
  # Get status information for this batch server
33
37
  # see http://linux.die.net/man/7/pbs_server_attributes
@@ -13,41 +13,21 @@ module PBS
13
13
  # @example For Torque 5.0.0
14
14
  # my_conn.lib.to_s #=> "/usr/local/torque/5.0.0/lib"
15
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
16
+ attr_reader :lib
28
17
 
29
18
  # The path to the Torque client installation binaries
30
19
  # @example For Torque 5.0.0
31
20
  # my_conn.bin.to_s #=> "/usr/local/torque/5.0.0/bin"
32
21
  # @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
22
+ attr_reader :bin
41
23
 
42
24
  # @param host [#to_s] the batch server host
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, **_)
25
+ # @param lib [#to_s] path to torque installation libraries
26
+ # @param bin [#to_s] path to torque installation binaries
27
+ def initialize(host:, lib: "", bin: "", **_)
47
28
  @host = host.to_s
48
- @prefix = Pathname.new(prefix)
49
- @lib = Pathname.new(lib) if lib
50
- @bin = Pathname.new(bin) if bin
29
+ @lib = Pathname.new(lib.to_s)
30
+ @bin = Pathname.new(bin.to_s)
51
31
  end
52
32
 
53
33
  # Convert object to hash
@@ -252,7 +232,7 @@ module PBS
252
232
  # @example Put job '10219837.oak-batch.osc.edu' on hold
253
233
  # my_conn.hold_job('10219837.oak-batch.osc.edu')
254
234
  # @param id [#to_s] the id of the job
255
- # @param type [Symbol] type of hold to be applied
235
+ # @param type [#to_s] type of hold to be applied
256
236
  # @return [void]
257
237
  def hold_job(id, type: :u)
258
238
  connect do |cid|
@@ -268,7 +248,7 @@ module PBS
268
248
  # @example Release job '10219837.oak-batch.osc.edu' from hold
269
249
  # my_conn.release_job('10219837.oak-batch.osc.edu')
270
250
  # @param id [#to_s] the id of the job
271
- # @param type [Symbol] type of hold to be removed
251
+ # @param type [#to_s] type of hold to be removed
272
252
  # @return [void]
273
253
  def release_job(id, type: :u)
274
254
  connect do |cid|
@@ -311,7 +291,7 @@ module PBS
311
291
  # @param qsub [Boolean] whether use library or binary for submission
312
292
  # @return [String] the id of the job that was created
313
293
  def submit_script(script, queue: nil, headers: {}, resources: {}, envvars: {}, qsub: true)
314
- send(qsub ? :qsub_submit : :pbs_submit, script, queue, headers, resources, envvars)
294
+ send(qsub ? :qsub_submit : :pbs_submit, script.to_s, queue.to_s, headers, resources, envvars)
315
295
  end
316
296
 
317
297
  # Submit a script expanded into a string to the batch server
@@ -335,7 +315,7 @@ module PBS
335
315
 
336
316
  connect do |cid|
337
317
  attropl = Torque::Attropl.from_hash attribs
338
- Torque.pbs_submit cid, attropl, script.to_s, queue.to_s, nil
318
+ Torque.pbs_submit cid, attropl, script, queue, nil
339
319
  end
340
320
  end
341
321
 
@@ -352,7 +332,7 @@ module PBS
352
332
  ["-W", "#{k}=#{v}"]
353
333
  end
354
334
  end.flatten
355
- params << script.to_s
335
+ params << script
356
336
 
357
337
  env = {
358
338
  "LD_LIBRARY_PATH" => "#{lib}:#{ENV['LD_LIBRARY_PATH']}"
@@ -1,4 +1,4 @@
1
1
  module PBS
2
2
  # The current version of PBS
3
- VERSION = "2.0.1"
3
+ VERSION = "2.0.2"
4
4
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
20
  spec.require_paths = ["lib"]
21
- spec.required_ruby_version = '~> 2.2'
21
+ spec.required_ruby_version = '>= 2.2.0'
22
22
 
23
23
  spec.add_runtime_dependency "ffi", "~> 1.9", ">= 1.9.6"
24
24
  spec.add_development_dependency "bundler", "~> 1.7"
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.1
4
+ version: 2.0.2
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-10 00:00:00.000000000 Z
11
+ date: 2016-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -89,9 +89,9 @@ require_paths:
89
89
  - lib
90
90
  required_ruby_version: !ruby/object:Gem::Requirement
91
91
  requirements:
92
- - - "~>"
92
+ - - ">="
93
93
  - !ruby/object:Gem::Version
94
- version: '2.2'
94
+ version: 2.2.0
95
95
  required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  requirements:
97
97
  - - ">="