cdo 1.3.1 → 1.3.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 +4 -4
- data/gemspec +1 -1
- data/lib/cdo.rb +28 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcb1d6e5d4eb860ecac4dff8836cf77acb2edbe4
|
4
|
+
data.tar.gz: f20b0fbc63fdaab0f46cda08612d1551cc6b640b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4aed663d81cbc14d38e742648a1817fcb3ee63c539a19994305a880e2b5d09d9723f195b30da93f49117b2b99441f4d28f2ff8ed96653550377bce3972757d7
|
7
|
+
data.tar.gz: ed6543a9bc4bfc88eb152fefab720a76192daeea1a3413e76d1929de207e1a3750de62deea3596bc85f5494a0cf0d5fc1037124ce34736d3a39fc62ee111a11b
|
data/gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.unshift File.join(File.dirname(__FILE__),"..","lib")
|
|
3
3
|
|
4
4
|
spec = Gem::Specification.new do |s|
|
5
5
|
s.name = "cdo"
|
6
|
-
s.version = '1.3.
|
6
|
+
s.version = '1.3.2'
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.files = ["lib/cdo.rb","lib/cdo_lib.rb"] + ["gemspec","LICENSE"]
|
9
9
|
s.test_file = "test/test_cdo.rb"
|
data/lib/cdo.rb
CHANGED
@@ -6,6 +6,18 @@ require 'stringio'
|
|
6
6
|
class Cdo
|
7
7
|
OutputOperatorsPattern = /(diff|info|output|griddes|zaxisdes|show|ncode|ndate|nlevel|nmon|nvar|nyear|ntime|npar|gradsdes|pardes)/
|
8
8
|
|
9
|
+
OutputOperators = %w[cdiread cmor codetab conv_cmor_table diff diffc diffn diffp
|
10
|
+
diffv dump_cmor_table dumpmap filedes ggstat ggstats gmtcells gmtxyz gradsdes
|
11
|
+
griddes griddes2 gridverify info infoc infon infop infos infov map ncode
|
12
|
+
ncode ndate ngridpoints ngrids nlevel nmon npar ntime nvar nyear output
|
13
|
+
outputarr outputbounds outputboundscpt outputcenter outputcenter2
|
14
|
+
outputcentercpt outputext outputf outputfld outputint outputkey outputsrv
|
15
|
+
outputtab outputtri outputts outputvector outputvrml outputxyz pardes partab
|
16
|
+
partab2 seinfo seinfoc seinfon seinfop showcode showdate showformat showlevel
|
17
|
+
showltype showmon showname showparam showstdname showtime showtimestamp
|
18
|
+
showunit showvar showyear sinfo sinfoc sinfon sinfop sinfov
|
19
|
+
spartab specinfo tinfo vardes vct vct2 verifygrid vlist zaxisdes]
|
20
|
+
|
9
21
|
attr_accessor :cdo, :returnCdf, :forceOutput, :env, :debug, :logging, :logFile
|
10
22
|
attr_reader :operators, :filetypes
|
11
23
|
|
@@ -83,23 +95,28 @@ class Cdo
|
|
83
95
|
|
84
96
|
# Execute the given cdo call and return all outputs
|
85
97
|
def _call(cmd,env={})
|
86
|
-
if (@debug)
|
87
|
-
puts '# DEBUG ====================================================================='
|
88
|
-
pp @env unless @env.empty?
|
89
|
-
pp env unless env.empty?
|
90
|
-
puts 'CMD: '
|
91
|
-
puts cmd
|
92
|
-
puts '# DEBUG ====================================================================='
|
93
|
-
end
|
94
|
-
|
95
98
|
@logger.info(cmd+"\n") if @logging
|
96
99
|
|
97
100
|
stdin, stdout, stderr, wait_thr = Open3.popen3(@env.merge(env),cmd)
|
98
|
-
{
|
101
|
+
status = {
|
99
102
|
:stdout => stdout.read,
|
100
103
|
:stderr => stderr.read,
|
101
104
|
:returncode => wait_thr.value.exitstatus
|
102
105
|
}
|
106
|
+
|
107
|
+
if (@debug)
|
108
|
+
puts '# DEBUG - start ============================================================='
|
109
|
+
pp @env unless @env.empty?
|
110
|
+
pp env unless env.empty?
|
111
|
+
puts 'CALL:' + cmd
|
112
|
+
puts 'STDOUT:'
|
113
|
+
puts status[:stdout] unless status[:stdout].strip.empty?
|
114
|
+
puts 'STDERR:'
|
115
|
+
puts status[:stderr] unless status[:stderr].strip.empty?
|
116
|
+
puts '# DEBUG - end ==============================================================='
|
117
|
+
end
|
118
|
+
|
119
|
+
status
|
103
120
|
end
|
104
121
|
|
105
122
|
# Error handling for the given command
|
@@ -183,7 +200,7 @@ class Cdo
|
|
183
200
|
|
184
201
|
if @operators.include?(sym.to_s)
|
185
202
|
io, opts = Cdo.parseArgs(args)
|
186
|
-
if
|
203
|
+
if OutputOperators.include?(sym.to_s)
|
187
204
|
_run(" -#{sym.to_s}#{opts} #{io[:input]} ",$stdout,nil,nil,nil,nil,nil,env)
|
188
205
|
else
|
189
206
|
_run(" -#{sym.to_s}#{opts} #{io[:input]} ",io[:output],io[:options],io[:returnCdf],io[:force],io[:returnArray],io[:returnMaArray],io[:env])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cdo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ralf Mueller
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unifiedPlot
|