Skip to content
Snippets Groups Projects
Commit b08dd7e1 authored by Ralf Mueller's avatar Ralf Mueller
Browse files

Add CDO version number a method for ruby bindings

parent b8b54ec8
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,10 @@ require 'pp'
# ==============================================================================
# CDO calling mechnism
module Cdo
State = {
VERSION = "1.0.10"
Stats = {
:debug => false,
:returnArray => false,
:operators => []
......@@ -126,7 +129,11 @@ module Cdo
State[:debug]
end
def Cdo.version
"1.0.10rc1"
cmd = @@CDO + ' 2>&1'
help = IO.popen(cmd).readlines.map {|l| l.chomp.lstrip}
regexp = %r{CDO version (\d.*), Copyright}
line = help.find {|v| v =~ regexp}
version = regexp.match(line)[1]
end
def Cdo.setReturnArray(value=true)
if value
......
......@@ -44,6 +44,9 @@ class TestCdo < Test::Unit::TestCase
values = Cdo.outputkey("level",:in => "-stdatm,0,10000")
assert_equal(["0", "10000","0", "10000"],values)
end
def test_CDO_version
assert("1.4.3.1" < Cdo.version,"Version to low: #{Cdo.version}")
end
def test_args
#Cdo.Debug = true
#MyTempfile.setPersist(true)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment