gtm 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +8 -0
- data/lib/gtm.so +0 -0
- data/test/gtm001.rb +36 -0
- data/test/gtm002.rb +34 -0
- data/test/gtm003.rb +37 -0
- data/test/gtm004.rb +38 -0
- data/test/gtm005.rb +78 -0
- data/test/gtm006.rb +78 -0
- metadata +58 -0
data/Rakefile
ADDED
data/lib/gtm.so
ADDED
Binary file
|
data/test/gtm001.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
#=========================================================================
|
2
|
+
#
|
3
|
+
# Copyright OSEHRA
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0.txt
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
#=========================================================================*/
|
18
|
+
|
19
|
+
|
20
|
+
# load gtm module
|
21
|
+
require "./gtm"
|
22
|
+
|
23
|
+
#
|
24
|
+
# Simply test constructor, destructor and connection to GT.M
|
25
|
+
#
|
26
|
+
|
27
|
+
db = Gtm::GTM.new()
|
28
|
+
|
29
|
+
version = db.version()
|
30
|
+
|
31
|
+
puts "Version = ", version
|
32
|
+
|
33
|
+
about = db.about()
|
34
|
+
|
35
|
+
puts "About = ", about
|
36
|
+
|
data/test/gtm002.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
#=========================================================================
|
2
|
+
#
|
3
|
+
# Copyright OSEHRA
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0.txt
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
#=========================================================================*/
|
18
|
+
|
19
|
+
|
20
|
+
# load gtm module
|
21
|
+
require "./gtm"
|
22
|
+
|
23
|
+
#
|
24
|
+
# Test the Set and Get methods
|
25
|
+
#
|
26
|
+
|
27
|
+
db = Gtm::GTM.new()
|
28
|
+
|
29
|
+
db.set("^Capital","London")
|
30
|
+
|
31
|
+
capital = db.get("^Capital")
|
32
|
+
|
33
|
+
puts "Capital = ", capital
|
34
|
+
|
data/test/gtm003.rb
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
#=========================================================================
|
2
|
+
#
|
3
|
+
# Copyright OSEHRA
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0.txt
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
#=========================================================================*/
|
18
|
+
|
19
|
+
|
20
|
+
# load gtm module
|
21
|
+
require "./gtm"
|
22
|
+
|
23
|
+
#
|
24
|
+
# Test the Set and Get methods
|
25
|
+
#
|
26
|
+
|
27
|
+
db = Gtm::GTM.new()
|
28
|
+
|
29
|
+
globalName = "^Capital"
|
30
|
+
setValue = "London"
|
31
|
+
|
32
|
+
db.set( globalName, setValue )
|
33
|
+
|
34
|
+
getValue = db.get( globalName )
|
35
|
+
|
36
|
+
puts globalName, " = ", getValue
|
37
|
+
|
data/test/gtm004.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
#=========================================================================
|
2
|
+
#
|
3
|
+
# Copyright OSEHRA
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0.txt
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
#=========================================================================*/
|
18
|
+
|
19
|
+
|
20
|
+
# load gtm module
|
21
|
+
require "./gtm"
|
22
|
+
|
23
|
+
#
|
24
|
+
# Test the Set, Get and Kill methods
|
25
|
+
#
|
26
|
+
|
27
|
+
db = Gtm::GTM.new()
|
28
|
+
|
29
|
+
globalName = "^Capital"
|
30
|
+
setValue = "London"
|
31
|
+
|
32
|
+
db.set( globalName, setValue )
|
33
|
+
|
34
|
+
getValue = db.get( globalName )
|
35
|
+
|
36
|
+
puts globalName, " = ", getValue
|
37
|
+
|
38
|
+
db.kill( globalName )
|
data/test/gtm005.rb
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
#=========================================================================
|
2
|
+
#
|
3
|
+
# Copyright OSEHRA
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0.txt
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
#=========================================================================*/
|
18
|
+
|
19
|
+
|
20
|
+
# load gtm module
|
21
|
+
require "./gtm"
|
22
|
+
|
23
|
+
#
|
24
|
+
# Test the Set, Get and Order methods
|
25
|
+
#
|
26
|
+
|
27
|
+
db = Gtm::GTM.new()
|
28
|
+
|
29
|
+
#
|
30
|
+
# Exercise the string API
|
31
|
+
#
|
32
|
+
|
33
|
+
globalName = '^Capital("US")'
|
34
|
+
setValue = 'Washington'
|
35
|
+
|
36
|
+
db.set( globalName, setValue )
|
37
|
+
|
38
|
+
globalName = '^Capital("UK")'
|
39
|
+
setValue = 'London'
|
40
|
+
|
41
|
+
db.set( globalName, setValue )
|
42
|
+
|
43
|
+
getValue = db.order( globalName )
|
44
|
+
|
45
|
+
puts "Order of ", globalName, " = ", getValue
|
46
|
+
|
47
|
+
expectedValue = "US"
|
48
|
+
|
49
|
+
db.kill('^Capital')
|
50
|
+
|
51
|
+
if getValue != expectedValue
|
52
|
+
puts "Test FAILED !"
|
53
|
+
puts "Expected value = ", expectedValue
|
54
|
+
puts "Received value = ", getValue
|
55
|
+
raise "Incorrect Value"
|
56
|
+
end
|
57
|
+
|
58
|
+
#
|
59
|
+
# Exercise the same pattern with direct strings
|
60
|
+
#
|
61
|
+
|
62
|
+
db.set( '^Capital("US")', 'Washington' )
|
63
|
+
db.set( '^Capital("UK")', 'London' )
|
64
|
+
|
65
|
+
getValue = db.order( '^Capital("UK")' )
|
66
|
+
|
67
|
+
puts "Order of ", globalName, " = ", getValue
|
68
|
+
|
69
|
+
expectedValue = "US"
|
70
|
+
|
71
|
+
db.kill('^Capital')
|
72
|
+
|
73
|
+
if getValue != expectedValue
|
74
|
+
puts "Test FAILED !"
|
75
|
+
puts "Expected value = ", expectedValue
|
76
|
+
puts "Received value = ", getValue
|
77
|
+
raise "Incorrect Value"
|
78
|
+
end
|
data/test/gtm006.rb
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
#=========================================================================
|
2
|
+
#
|
3
|
+
# Copyright OSEHRA
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0.txt
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
#=========================================================================*/
|
18
|
+
|
19
|
+
|
20
|
+
# load gtm module
|
21
|
+
require "./gtm"
|
22
|
+
|
23
|
+
#
|
24
|
+
# Test the Set, Get and Query methods
|
25
|
+
#
|
26
|
+
|
27
|
+
db = Gtm::GTM.new()
|
28
|
+
|
29
|
+
#
|
30
|
+
# Exercise the string API
|
31
|
+
#
|
32
|
+
|
33
|
+
globalName = '^Capital("US")'
|
34
|
+
setValue = 'Washington'
|
35
|
+
|
36
|
+
db.set( globalName, setValue )
|
37
|
+
|
38
|
+
globalName = '^Capital("UK")'
|
39
|
+
setValue = 'London'
|
40
|
+
|
41
|
+
db.set( globalName, setValue )
|
42
|
+
|
43
|
+
getValue = db.query( globalName )
|
44
|
+
|
45
|
+
puts "Order of ", globalName, " = ", getValue
|
46
|
+
|
47
|
+
expectedValue = '^Capital("US")'
|
48
|
+
|
49
|
+
db.kill('^Capital')
|
50
|
+
|
51
|
+
if getValue != expectedValue
|
52
|
+
puts "Test FAILED !"
|
53
|
+
puts "Expected value = ", expectedValue
|
54
|
+
puts "Received value = ", getValue
|
55
|
+
raise "Incorrect Value"
|
56
|
+
end
|
57
|
+
|
58
|
+
#
|
59
|
+
# Exercise the same pattern with direct strings
|
60
|
+
#
|
61
|
+
|
62
|
+
db.set( '^Capital("US")', 'Washington' )
|
63
|
+
db.set( '^Capital("UK")', 'London' )
|
64
|
+
|
65
|
+
getValue = db.query( '^Capital("UK")' )
|
66
|
+
|
67
|
+
puts "Order of ", globalName, " = ", getValue
|
68
|
+
|
69
|
+
expectedValue = '^Capital("US")'
|
70
|
+
|
71
|
+
db.kill('^Capital')
|
72
|
+
|
73
|
+
if getValue != expectedValue
|
74
|
+
puts "Test FAILED !"
|
75
|
+
puts "Expected value = ", expectedValue
|
76
|
+
puts "Received value = ", getValue
|
77
|
+
raise "Incorrect Value"
|
78
|
+
end
|
metadata
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gtm
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Luis Ibanez
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-03-02 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: Driver for the GT.M database
|
15
|
+
email: luis.ibanez@kitware.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- Rakefile
|
21
|
+
- lib/gtm.so
|
22
|
+
- test/gtm001.rb
|
23
|
+
- test/gtm002.rb
|
24
|
+
- test/gtm003.rb
|
25
|
+
- test/gtm004.rb
|
26
|
+
- test/gtm005.rb
|
27
|
+
- test/gtm006.rb
|
28
|
+
homepage: https://github.com/OSEHRA-Sandbox/gtm-bindings
|
29
|
+
licenses: []
|
30
|
+
post_install_message:
|
31
|
+
rdoc_options: []
|
32
|
+
require_paths:
|
33
|
+
- lib
|
34
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
35
|
+
none: false
|
36
|
+
requirements:
|
37
|
+
- - ! '>='
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
requirements: []
|
47
|
+
rubyforge_project:
|
48
|
+
rubygems_version: 1.8.23
|
49
|
+
signing_key:
|
50
|
+
specification_version: 3
|
51
|
+
summary: GT.M Database!
|
52
|
+
test_files:
|
53
|
+
- test/gtm001.rb
|
54
|
+
- test/gtm002.rb
|
55
|
+
- test/gtm003.rb
|
56
|
+
- test/gtm004.rb
|
57
|
+
- test/gtm005.rb
|
58
|
+
- test/gtm006.rb
|