staf4ruby 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +3 -3
  3. data/lib/staf4ruby.rb +5 -1
  4. data/test/test.rb +25 -21
  5. metadata +7 -9
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5741be4fabde2b9deab05bc0d3196782e7d8a785
4
+ data.tar.gz: 4589690159dbda541b898e097532fdf0c32c280f
5
+ SHA512:
6
+ metadata.gz: fda9cd0582bd9b5f25ce27157093c4a9d373fcd8c2b3c371df54de8937cfaf1b40c3f4a97bb50fd380c654d98770d8df894475e6d723d683cff0aac2d0983921
7
+ data.tar.gz: f1ba26d2ffe2545f8fd6f58452af5c8d1f3b6f679a1126b19e16d302fba0c4860c87ded7b4a82ddbad37a31579ced193010e5dda3b72245675439962f67d1e76
data/Rakefile CHANGED
@@ -28,12 +28,12 @@ task :test => "lib/staf4ruby_ext.so"
28
28
 
29
29
  CLEAN.include('ext/Makefile')
30
30
  CLEAN.include('ext/*.{o,so}')
31
- CLOBBER.include('lib/*.{o,so}')
31
+ CLEAN.include('lib/*.{o,so}')
32
32
 
33
33
  gem_spec = Gem::Specification.new do |s|
34
34
  s.name=%q{staf4ruby}
35
- s.version="0.1.2"
36
- s.date=%q{2014-04-29}
35
+ s.version="0.1.3"
36
+ s.date=%q{2017-08-02}
37
37
  s.authors=["Alan Somers"]
38
38
  s.email=%q{asomers@gmail.com}
39
39
  s.extensions="ext/extconf.rb"
@@ -397,7 +397,7 @@ module Staf
397
397
 
398
398
  # Create an array for the data
399
399
  myArray = []
400
- for i in (1..numItems).to_a
400
+ (1..numItems).each do
401
401
  # Get the next item in the list and unmarshall it and add it
402
402
  # to the list
403
403
  colonIndex1 = data.index(":", dataIndex)
@@ -560,5 +560,9 @@ module Staf
560
560
  STAFMarshallingContext.new(data)
561
561
  end
562
562
 
563
+ # Equivalent to PyStaf's PySTAF.wrapData
564
+ def self.wrapData(s)
565
+ return ":#{s.size}:#{s}"
566
+ end
563
567
 
564
568
  end
@@ -9,13 +9,13 @@
9
9
 
10
10
  require File.join(File.dirname(__FILE__), 'test_helper')
11
11
  require 'rbconfig'
12
- require 'test/unit'
12
+ require 'minitest/autorun'
13
13
 
14
14
  require 'staf4ruby'
15
15
 
16
16
  module Staf
17
17
 
18
- class TestHandleRegister < Test::Unit::TestCase
18
+ class TestHandleRegister < Minitest::Test
19
19
  def setup
20
20
  @handle = nil
21
21
  end
@@ -41,14 +41,12 @@ module Staf
41
41
  end
42
42
 
43
43
  def test_ConstructWithStandardHandle_pos1
44
- assert_nothing_raised() do
45
- @handle = STAFHandle.new("test_ConstructWithStandardHandle_pos1")
46
- assert @handle.is_a? STAFHandle
47
- end
44
+ @handle = STAFHandle.new("test_ConstructWithStandardHandle_pos1")
45
+ assert @handle.is_a? STAFHandle
48
46
  end
49
47
  end
50
48
 
51
- class TestSubmitWithStandardHandle < Test::Unit::TestCase
49
+ class TestSubmitWithStandardHandle < Minitest::Test
52
50
  def setup
53
51
  @handle = STAFHandle.new("TestSubmitWithStandardHandle")
54
52
  end
@@ -82,7 +80,7 @@ module Staf
82
80
  end
83
81
  end
84
82
 
85
- class TestSubmitWithStaticHandle < Test::Unit::TestCase
83
+ class TestSubmitWithStaticHandle < Minitest::Test
86
84
  def setup
87
85
  @standard_handle = STAFHandle.new("TestSubmitWithStaticHandle1")
88
86
  result = @standard_handle.submit("local", "HANDLE", "CREATE HANDLE NAME TestSubmitWithStaticHandle2");
@@ -131,7 +129,7 @@ module Staf
131
129
  end
132
130
  end
133
131
 
134
- class TestDoUnmarshallResult < Test::Unit::TestCase
132
+ class TestDoUnmarshallResult < Minitest::Test
135
133
  def setup
136
134
  @handle = STAFHandle.new("TestSubmitWithStandardHandle")
137
135
  end
@@ -146,8 +144,8 @@ module Staf
146
144
  assert_equal @handle.doUnmarshallResult, false
147
145
  result = @handle.submit("local", "MISC", "WHOAMI")
148
146
  assert_equal STAFResult::Ok, result.rc
149
- assert_equal nil, result.resultContext
150
- assert_equal nil, result.resultObj
147
+ assert_nil result.resultContext
148
+ assert_nil result.resultObj
151
149
  end
152
150
 
153
151
  def do_true
@@ -184,12 +182,12 @@ module Staf
184
182
  end
185
183
 
186
184
 
187
- class TestLogService < Test::Unit::TestCase
185
+ class TestLogService < Minitest::Test
188
186
  #TODO: implement the STAFLog class for the bindings to be complete
189
187
  #SpectraLogic doesn't need it, though.
190
188
  end
191
189
 
192
- class TestMarshall < Test::Unit::TestCase
190
+ class TestMarshall < Minitest::Test
193
191
  # Test the marshall function
194
192
  def test_array
195
193
  expected = "@SDT/[3:33:@SDT/$S:1:1@SDT/$S:1:2@SDT/$S:1:3"
@@ -235,7 +233,7 @@ module Staf
235
233
  end
236
234
  end
237
235
 
238
- class TestUnMarshall < Test::Unit::TestCase
236
+ class TestUnMarshall < Minitest::Test
239
237
  def test_array
240
238
  data = "@SDT/[3:33:@SDT/$S:1:1@SDT/$S:1:2@SDT/$S:1:3"
241
239
  expected = ["1","2","3"]
@@ -323,7 +321,7 @@ module Staf
323
321
  end
324
322
  end
325
323
 
326
- class TestUnMarshallQuery < Test::Unit::TestCase
324
+ class TestUnMarshallQuery < Minitest::Test
327
325
  def setup
328
326
  @handle = STAFHandle.new("TestSubmitWithStandardHandle")
329
327
  @myTestMap = {'name' => 'TestA', 'exec' => '/tests/TestA.py',
@@ -404,7 +402,7 @@ module Staf
404
402
  end
405
403
  end
406
404
 
407
- class TestMapClass < Test::Unit::TestCase
405
+ class TestMapClass < Minitest::Test
408
406
  include MapClassHelper
409
407
  def setup
410
408
  mapClassHelperSetup
@@ -427,7 +425,7 @@ module Staf
427
425
  end
428
426
  end
429
427
 
430
- class TestStafMarshallingContext < Test::Unit::TestCase
428
+ class TestStafMarshallingContext < Minitest::Test
431
429
  include MapClassHelper
432
430
  def setup
433
431
  mapClassHelperSetup
@@ -456,7 +454,7 @@ module Staf
456
454
  end
457
455
  end
458
456
 
459
- class TestStafMarshallingContextRootObject < Test::Unit::TestCase
457
+ class TestStafMarshallingContextRootObject < Minitest::Test
460
458
  include MapClassHelper
461
459
  def setup
462
460
  mapClassHelperSetup
@@ -545,7 +543,7 @@ module Staf
545
543
  # TODO: add tests for mc.to_s and mc.inspect
546
544
  end
547
545
 
548
- class TestStafMarshallingContextClone < Test::Unit::TestCase
546
+ class TestStafMarshallingContextClone < Minitest::Test
549
547
  include MapClassHelper
550
548
  def setup
551
549
  mapClassHelperSetup
@@ -572,13 +570,13 @@ module Staf
572
570
  end
573
571
 
574
572
 
575
- class TestMonitor < Test::Unit::TestCase
573
+ class TestMonitor < Minitest::Test
576
574
  #TODO: implement the STAFMonitor class for the bindings to be complete
577
575
  #SpectraLogic doesn't need it, though.
578
576
  end
579
577
 
580
578
 
581
- class TestPrivateData < Test::Unit::TestCase
579
+ class TestPrivateData < Minitest::Test
582
580
  def all_privacy_removed(data)
583
581
  escapedData = Staf::escapePrivacyDelimiters(data)[1]
584
582
  dataWithPrivacy = Staf::addPrivacyDelimiters(escapedData)[1]
@@ -659,4 +657,10 @@ module Staf
659
657
  end
660
658
 
661
659
  end
660
+
661
+ class TestWrapData < Minitest::Test
662
+ def test_hello_world
663
+ assert_equal(":11:Hello world", Staf.wrapData("Hello world"))
664
+ end
665
+ end
662
666
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: staf4ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
5
- prerelease:
4
+ version: 0.1.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Alan Somers
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-04-29 00:00:00.000000000Z
11
+ date: 2017-08-02 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: Ruby interface to the STAF C APIs.
15
14
  email: asomers@gmail.com
@@ -27,26 +26,25 @@ files:
27
26
  homepage: https://bitbucket.org/asomers/staf4ruby
28
27
  licenses:
29
28
  - EPL
29
+ metadata: {}
30
30
  post_install_message:
31
31
  rdoc_options: []
32
32
  require_paths:
33
33
  - lib
34
34
  required_ruby_version: !ruby/object:Gem::Requirement
35
- none: false
36
35
  requirements:
37
- - - ! '>='
36
+ - - ">="
38
37
  - !ruby/object:Gem::Version
39
38
  version: '0'
40
39
  required_rubygems_version: !ruby/object:Gem::Requirement
41
- none: false
42
40
  requirements:
43
- - - ! '>='
41
+ - - ">="
44
42
  - !ruby/object:Gem::Version
45
43
  version: '0'
46
44
  requirements: []
47
45
  rubyforge_project: none
48
- rubygems_version: 1.8.10
46
+ rubygems_version: 2.5.1
49
47
  signing_key:
50
- specification_version: 3
48
+ specification_version: 4
51
49
  summary: Ruby interface to STAF.
52
50
  test_files: []