bives 0.1 → 0.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.
- checksums.yaml +8 -8
- data/lib/bives.rb +9 -2
- data/lib/bives/version.rb +1 -1
- data/test/bives_test.rb +9 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZGNmYjBhMjYxM2IwMjAyMjdmOWU3ZTViMzlmYTU5M2ZjMjAzMDYwMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
N2E4ZDhhZjJhMzMyY2E4YTAyNGJjMDRiYmVlZTBiNjZmODQyZmQ4Yw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzNhM2M1YTllMDA1MzhlMTU5ZmVkZDEwYmEzNjljMDM2YzMxNGNjNTI4ZGMz
|
10
|
+
YWNlMDM3ZWUyMjgyNjM1MjM5OTlmYTM5ZmVlZWE2OTJkOTkyMzgyZGNhZGUx
|
11
|
+
MDNlOWE1ODFiNjUxNjM1NGFlZDhlOTMzNGFhMzUyZmJmZTU1MTc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
M2MyN2MwZmRjODViMDg3MjA4NThiM2RiYjYxNDAxZmJjNzc3MjcwOWFlNjY0
|
14
|
+
ZTI0Yjg4MzFkMGYzNzlhZGViMTlmZDMzOGI3MzdjZjJkZDE1ZmQ3OGU1YmQ5
|
15
|
+
OWRhODFiZDU2YWY0MGVhYTk4ZDQwYThiMTdkMDg3MGUzYzcyOGU=
|
data/lib/bives.rb
CHANGED
@@ -2,6 +2,10 @@ require_relative "bives/version"
|
|
2
2
|
require 'open4'
|
3
3
|
|
4
4
|
module Bives
|
5
|
+
class ConversionException < Exception
|
6
|
+
|
7
|
+
end
|
8
|
+
|
5
9
|
JAR_FILENAME = "BiVeS-1.1.2-SNAPSHOT-fat.jar"
|
6
10
|
JAR_FILEPATH = File.join File.dirname(__FILE__),"jars","#{JAR_FILENAME}"
|
7
11
|
|
@@ -31,10 +35,13 @@ module Bives
|
|
31
35
|
stderr.close
|
32
36
|
end
|
33
37
|
|
38
|
+
output=output.strip
|
39
|
+
|
34
40
|
if status.to_i != 0
|
35
|
-
|
41
|
+
err_message = output if err_message.empty?
|
42
|
+
raise ConversionException.new(err_message)
|
36
43
|
end
|
37
44
|
|
38
|
-
output
|
45
|
+
output
|
39
46
|
end
|
40
47
|
end
|
data/lib/bives/version.rb
CHANGED
data/test/bives_test.rb
CHANGED
@@ -14,8 +14,15 @@ class BivesTest < MiniTest::Unit::TestCase
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def test_compare
|
17
|
-
|
18
|
-
|
17
|
+
result = compare(@potato1,@potato2)
|
18
|
+
refute_nil result
|
19
|
+
refute_empty result.strip
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_exception_thrown
|
23
|
+
assert_raises Bives::ConversionException do
|
24
|
+
compare(@potato1,"",[])
|
25
|
+
end
|
19
26
|
end
|
20
27
|
|
21
28
|
end
|