stupidedi 1.2.11 → 1.2.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stupidedi/builder/constraint_table.rb +2 -2
- data/lib/stupidedi/builder/instruction.rb +2 -2
- data/lib/stupidedi/builder/navigation.rb +1 -1
- data/lib/stupidedi/inspect.rb +1 -1
- data/lib/stupidedi/reader/input/delegated_input.rb +1 -1
- data/lib/stupidedi/reader/input/file_input.rb +2 -2
- data/lib/stupidedi/reader/stream_reader.rb +1 -2
- data/lib/stupidedi/reader/token_reader.rb +1 -5
- data/lib/stupidedi/reader.rb +0 -1
- data/lib/stupidedi/version.rb +1 -1
- data/lib/stupidedi/versions/functional_groups/003010/element_types/fixnum_val.rb +2 -2
- data/lib/stupidedi/versions/functional_groups/003010/element_types/float_val.rb +2 -1
- data/lib/stupidedi/versions/functional_groups/003040/element_types/fixnum_val.rb +4 -4
- data/lib/stupidedi/versions/functional_groups/003040/element_types/float_val.rb +4 -3
- data/lib/stupidedi/versions/functional_groups/003050/element_types/fixnum_val.rb +4 -4
- data/lib/stupidedi/versions/functional_groups/003050/element_types/float_val.rb +4 -3
- data/lib/stupidedi/versions/functional_groups/004010/element_types/fixnum_val.rb +0 -2
- data/lib/stupidedi/versions/functional_groups/004010/element_types/float_val.rb +0 -1
- data/lib/stupidedi/versions/functional_groups/005010/element_types/fixnum_val.rb +0 -3
- data/lib/stupidedi/versions/functional_groups/005010/element_types/float_val.rb +4 -3
- data/lib/stupidedi/writer/claredi.rb +23 -23
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6c79cf377cf10c26a069203de16a7490729b691
|
4
|
+
data.tar.gz: 4f979f9cd4ce79ef213119eea58cf12aea4463c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1702828adf1d45725d4b8b6c8ac526f8131e7e32765c9c1675e064318a3c7048e999bf5bccc21142b0e4b52dbad683ed7aa9ed23785d144342a30c2655c443db
|
7
|
+
data.tar.gz: 7fec90e6d0a3c98104c37ff927d85632a02513215c0086639340bb703db38ba01ef9f41b61ade8cc1a398beef6efda1eff55faecd7ea4067e5b539a68e261898
|
@@ -126,7 +126,7 @@ module Stupidedi
|
|
126
126
|
else
|
127
127
|
if strict
|
128
128
|
designator = "#{segment_tok.id}#{'%02d' % (n + 1)}"
|
129
|
-
designator
|
129
|
+
designator = designator + "-%02d" % m unless m.nil?
|
130
130
|
|
131
131
|
raise ArgumentError,
|
132
132
|
"#{value.inspect} is not allowed in #{designator}"
|
@@ -160,7 +160,7 @@ module Stupidedi
|
|
160
160
|
else
|
161
161
|
if strict
|
162
162
|
designator = "#{segment_tok.id}#{'%02d' % n}"
|
163
|
-
designator
|
163
|
+
designator = designator + "-%02d" % m unless m.nil?
|
164
164
|
|
165
165
|
raise ArgumentError,
|
166
166
|
"#{value.inspect} is not allowed in #{designator}"
|
@@ -77,9 +77,9 @@ module Stupidedi
|
|
77
77
|
|
78
78
|
# Truncate the segment name to `width` characters
|
79
79
|
if name.length > width - 2
|
80
|
-
id
|
80
|
+
id = id + ": #{name.slice(0, width - 2)}.."
|
81
81
|
else
|
82
|
-
id
|
82
|
+
id = id + ": #{name.ljust(width)}"
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
data/lib/stupidedi/inspect.rb
CHANGED
@@ -73,7 +73,7 @@ module Stupidedi
|
|
73
73
|
|
74
74
|
until @io.eof?
|
75
75
|
buffer.slice!(0)
|
76
|
-
buffer
|
76
|
+
buffer = buffer + @io.read(1)
|
77
77
|
|
78
78
|
if buffer == value
|
79
79
|
return @io.tell - @offset - length
|
@@ -133,7 +133,7 @@ module Stupidedi
|
|
133
133
|
elsif preview.length <= 3
|
134
134
|
preview.inspect
|
135
135
|
else
|
136
|
-
(preview.take(3)
|
136
|
+
(preview.take(3) + "...").inspect
|
137
137
|
end
|
138
138
|
|
139
139
|
q.text preview
|
@@ -138,9 +138,8 @@ module Stupidedi
|
|
138
138
|
|
139
139
|
unless Reader.is_control_character?(character)
|
140
140
|
# Slide the "window" forward one character
|
141
|
-
# buffer = buffer.slice!(1..-1) << character.upcase
|
142
141
|
buffer = buffer.slice(1..-1)
|
143
|
-
buffer = buffer
|
142
|
+
buffer = buffer + character.upcase
|
144
143
|
if buffer == "ISA"
|
145
144
|
return success(advance(position))
|
146
145
|
end
|
@@ -64,7 +64,6 @@ module Stupidedi
|
|
64
64
|
position += 1
|
65
65
|
|
66
66
|
unless is_control?(character)
|
67
|
-
# buffer << character
|
68
67
|
buffer = buffer + character
|
69
68
|
|
70
69
|
if s.length == buffer.length
|
@@ -110,7 +109,7 @@ module Stupidedi
|
|
110
109
|
|
111
110
|
unless is_control?(character)
|
112
111
|
# Slide the "window" forward one character
|
113
|
-
buffer = buffer.slice(1..-1)
|
112
|
+
buffer = buffer.slice(1..-1) + character
|
114
113
|
end
|
115
114
|
|
116
115
|
position += 1
|
@@ -258,7 +257,6 @@ module Stupidedi
|
|
258
257
|
break
|
259
258
|
end
|
260
259
|
|
261
|
-
# buffer << character
|
262
260
|
buffer = buffer + character
|
263
261
|
end
|
264
262
|
end
|
@@ -337,7 +335,6 @@ module Stupidedi
|
|
337
335
|
# # @todo: Read this as data but sound the alarms
|
338
336
|
end
|
339
337
|
|
340
|
-
# buffer << character
|
341
338
|
buffer = buffer + character
|
342
339
|
end
|
343
340
|
|
@@ -374,7 +371,6 @@ module Stupidedi
|
|
374
371
|
end
|
375
372
|
end
|
376
373
|
|
377
|
-
# buffer << character
|
378
374
|
buffer = buffer + character
|
379
375
|
end
|
380
376
|
|
data/lib/stupidedi/reader.rb
CHANGED
data/lib/stupidedi/version.rb
CHANGED
@@ -257,10 +257,10 @@ module Stupidedi
|
|
257
257
|
# Leading zeros must be suppressed unless necessary to satisfy a
|
258
258
|
# minimum length requirement
|
259
259
|
if truncate
|
260
|
-
sign
|
260
|
+
sign = sign + nn.abs.to_s.take(definition.max_length).
|
261
261
|
rjust(definition.min_length, "0")
|
262
262
|
else
|
263
|
-
sign
|
263
|
+
sign = sign + nn.abs.to_s.rjust(definition.min_length, "0")
|
264
264
|
end
|
265
265
|
end
|
266
266
|
|
@@ -261,7 +261,8 @@ module Stupidedi
|
|
261
261
|
if truncate
|
262
262
|
int = @value.to_i.to_s
|
263
263
|
sign = (int < 0) ? "-" : ""
|
264
|
-
|
264
|
+
sign = sign + int.abs.to_s.take(definition.max_length)
|
265
|
+
return sign
|
265
266
|
else
|
266
267
|
return @value.to_i.abs
|
267
268
|
end
|
@@ -196,8 +196,8 @@ module Stupidedi
|
|
196
196
|
# @return [BigDecimal]
|
197
197
|
attr_reader :value
|
198
198
|
|
199
|
-
def_delegators :@value, :to_i, :to_d, :to_f, :to_r, :to_c
|
200
|
-
|
199
|
+
def_delegators :@value, :to_i, :to_d, :to_f, :to_r, :to_c
|
200
|
+
|
201
201
|
def initialize(value, usage, position)
|
202
202
|
@value = value
|
203
203
|
super(usage, position)
|
@@ -256,10 +256,10 @@ module Stupidedi
|
|
256
256
|
# Leading zeros must be suppressed unless necessary to satisfy a
|
257
257
|
# minimum length requirement
|
258
258
|
if truncate
|
259
|
-
sign
|
259
|
+
sign = sign + nn.abs.to_s.take(definition.max_length).
|
260
260
|
rjust(definition.min_length, "0")
|
261
261
|
else
|
262
|
-
sign
|
262
|
+
sign = sign + nn.abs.to_s.rjust(definition.min_length, "0")
|
263
263
|
end
|
264
264
|
end
|
265
265
|
|
@@ -185,9 +185,9 @@ module Stupidedi
|
|
185
185
|
# @return [BigDecimal]
|
186
186
|
attr_reader :value
|
187
187
|
|
188
|
-
def_delegators :@value, :to_i, :to_d, :to_f, :to_r, :to_c
|
188
|
+
def_delegators :@value, :to_i, :to_d, :to_f, :to_r, :to_c
|
189
|
+
|
189
190
|
|
190
|
-
|
191
191
|
def initialize(value, usage, position)
|
192
192
|
@value = value
|
193
193
|
super(usage, position)
|
@@ -262,7 +262,8 @@ module Stupidedi
|
|
262
262
|
if truncate
|
263
263
|
int = @value.to_i.to_s
|
264
264
|
sign = (int < 0) ? "-" : ""
|
265
|
-
|
265
|
+
sign = sign + int.abs.to_s.take(definition.max_length)
|
266
|
+
return sign
|
266
267
|
else
|
267
268
|
return @value.to_i.abs
|
268
269
|
end
|
@@ -197,8 +197,8 @@ module Stupidedi
|
|
197
197
|
attr_reader :value
|
198
198
|
|
199
199
|
def_delegators :@value, :to_i, :to_d, :to_f, :to_r, :to_c
|
200
|
-
|
201
|
-
|
200
|
+
|
201
|
+
|
202
202
|
def initialize(value, usage, position)
|
203
203
|
@value = value
|
204
204
|
super(usage, position)
|
@@ -257,10 +257,10 @@ module Stupidedi
|
|
257
257
|
# Leading zeros must be suppressed unless necessary to satisfy a
|
258
258
|
# minimum length requirement
|
259
259
|
if truncate
|
260
|
-
sign
|
260
|
+
sign = sign + nn.abs.to_s.take(definition.max_length).
|
261
261
|
rjust(definition.min_length, "0")
|
262
262
|
else
|
263
|
-
sign
|
263
|
+
sign = sign + nn.abs.to_s.rjust(definition.min_length, "0")
|
264
264
|
end
|
265
265
|
end
|
266
266
|
|
@@ -186,9 +186,9 @@ module Stupidedi
|
|
186
186
|
attr_reader :value
|
187
187
|
|
188
188
|
def_delegators :@value, :to_i, :to_d, :to_f, :to_r, :to_c
|
189
|
-
|
190
189
|
|
191
|
-
|
190
|
+
|
191
|
+
|
192
192
|
def initialize(value, usage, position)
|
193
193
|
@value = value
|
194
194
|
super(usage, position)
|
@@ -263,7 +263,8 @@ module Stupidedi
|
|
263
263
|
if truncate
|
264
264
|
int = @value.to_i.to_s
|
265
265
|
sign = (int < 0) ? "-" : ""
|
266
|
-
|
266
|
+
sign = sign + int.abs.to_s.take(definition.max_length)
|
267
|
+
return sign
|
267
268
|
else
|
268
269
|
return @value.to_i.abs
|
269
270
|
end
|
@@ -257,8 +257,6 @@ module Stupidedi
|
|
257
257
|
# Leading zeros must be suppressed unless necessary to satisfy a
|
258
258
|
# minimum length requirement
|
259
259
|
if truncate
|
260
|
-
# sign << nn.abs.to_s.take(definition.max_length).
|
261
|
-
# rjust(definition.min_length, "0")
|
262
260
|
sign = sign + nn.abs.to_s.take(definition.max_length).
|
263
261
|
rjust(definition.min_length, "0")
|
264
262
|
else
|
@@ -256,12 +256,9 @@ module Stupidedi
|
|
256
256
|
# Leading zeros must be suppressed unless necessary to satisfy a
|
257
257
|
# minimum length requirement
|
258
258
|
if truncate
|
259
|
-
# sign << nn.abs.to_s.take(definition.max_length).
|
260
|
-
# rjust(definition.min_length, "0")
|
261
259
|
sign = sign + nn.abs.to_s.take(definition.max_length).
|
262
260
|
rjust(definition.min_length, "0")
|
263
261
|
else
|
264
|
-
# sign << nn.abs.to_s.rjust(definition.min_length, "0")
|
265
262
|
sign = sign + nn.abs.to_s.rjust(definition.min_length, "0")
|
266
263
|
end
|
267
264
|
end
|
@@ -186,9 +186,9 @@ module Stupidedi
|
|
186
186
|
attr_reader :value
|
187
187
|
|
188
188
|
def_delegators :@value, :to_i, :to_d, :to_f, :to_r, :to_c
|
189
|
-
|
190
189
|
|
191
|
-
|
190
|
+
|
191
|
+
|
192
192
|
def initialize(value, usage, position)
|
193
193
|
@value = value
|
194
194
|
super(usage, position)
|
@@ -263,7 +263,8 @@ module Stupidedi
|
|
263
263
|
if truncate
|
264
264
|
int = @value.to_i.to_s
|
265
265
|
sign = (int < 0) ? "-" : ""
|
266
|
-
|
266
|
+
sign = sign + int.abs.to_s.take(definition.max_length)
|
267
|
+
return sign
|
267
268
|
else
|
268
269
|
return @value.to_i.abs
|
269
270
|
end
|
@@ -12,9 +12,9 @@ module Stupidedi
|
|
12
12
|
|
13
13
|
# @return [String]
|
14
14
|
def write(out = "")
|
15
|
-
out
|
15
|
+
out = out + "<html><head>\n#{style}</head>\n<body>\n"
|
16
16
|
build(@node, out)
|
17
|
-
out
|
17
|
+
out + "</body></html>"
|
18
18
|
end
|
19
19
|
|
20
20
|
private
|
@@ -81,62 +81,62 @@ module Stupidedi
|
|
81
81
|
if node.element?
|
82
82
|
|
83
83
|
if node.composite?
|
84
|
-
out
|
84
|
+
out = out + "*"
|
85
85
|
tmp = ""
|
86
86
|
node.children.each{|e| build(e, tmp) }
|
87
87
|
tmp = tmp.gsub(/:*$/, "")
|
88
|
-
out
|
88
|
+
out + tmp
|
89
89
|
elsif node.component?
|
90
|
-
out
|
90
|
+
out + "#{node}:"
|
91
91
|
elsif node.repeated?
|
92
|
-
out
|
92
|
+
out + "^"
|
93
93
|
node.children.each{|e| build(e, out) }
|
94
94
|
else
|
95
|
-
out
|
95
|
+
out + "*#{node}"
|
96
96
|
end
|
97
97
|
|
98
98
|
elsif node.segment?
|
99
|
-
out
|
100
|
-
out
|
101
|
-
# out
|
99
|
+
out = out + "<div class=segment><div class=label title='#{node.definition.name}'>"
|
100
|
+
out = out + '% 3s' % node.definition.id
|
101
|
+
# out = out + ": #{node.definition.name}</div></div>\n"
|
102
102
|
tmp = ""
|
103
103
|
node.children.each{|e| build(e, tmp) }
|
104
104
|
tmp = tmp.gsub(/\**$/, "")
|
105
|
-
out
|
105
|
+
out + "#{tmp}~</div></div>\n"
|
106
106
|
|
107
107
|
elsif node.loop?
|
108
108
|
m = /^(\w+) (.+)$/.match(node.definition.id)
|
109
109
|
id, name = m.captures
|
110
110
|
name = name.split(/\s+/).map(&:capitalize).join(" ")
|
111
111
|
|
112
|
-
out
|
112
|
+
out = out + "<div class=loop><div class=label>#{name} (#{id})</div>\n"
|
113
113
|
node.children.each{|c| build(c, out) }
|
114
|
-
out
|
114
|
+
out + "</div>\n"
|
115
115
|
|
116
116
|
elsif node.table?
|
117
|
-
out
|
117
|
+
out = out + "<div class=table><div class=label>#{node.definition.id}</div>\n"
|
118
118
|
node.children.each{|c| build(c, out) }
|
119
|
-
out
|
119
|
+
out + "</div>\n"
|
120
120
|
|
121
121
|
elsif node.transaction_set?
|
122
|
-
out
|
122
|
+
out = out + "<div class=transaction><div class=label>Transaction Set #{node.definition.id}</div>\n"
|
123
123
|
node.children.each{|c| build(c, out) }
|
124
|
-
out
|
124
|
+
out + "</div>\n"
|
125
125
|
|
126
126
|
elsif node.functional_group?
|
127
|
-
out
|
127
|
+
out = out + "<div class=functionalgr><div class=label>Functional Group #{node.definition.id}</div>\n"
|
128
128
|
node.children.each{|c| build(c, out) }
|
129
|
-
out
|
129
|
+
out + "</div>\n"
|
130
130
|
|
131
131
|
elsif node.interchange?
|
132
|
-
out
|
132
|
+
out = out + "<div class=interchange><div class=label>Interchange #{node.definition.id}</div>\n"
|
133
133
|
node.children.each{|c| build(c, out) }
|
134
|
-
out
|
134
|
+
out + "</div>\n"
|
135
135
|
|
136
136
|
elsif node.transmission?
|
137
|
-
out
|
137
|
+
out = out + "<div class=transmission>\n"
|
138
138
|
node.children.each{|c| build(c, out) }
|
139
|
-
out
|
139
|
+
out + "</div>\n"
|
140
140
|
end
|
141
141
|
end
|
142
142
|
end
|