norikra 0.0.14-java → 0.0.15-java
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/norikra/engine.rb +10 -9
- data/lib/norikra/target.rb +0 -4
- data/lib/norikra/typedef.rb +1 -1
- data/lib/norikra/version.rb +1 -1
- data/spec/typedef_manager_spec.rb +7 -8
- metadata +2 -2
data/lib/norikra/engine.rb
CHANGED
@@ -133,26 +133,27 @@ module Norikra
|
|
133
133
|
|
134
134
|
def send(target_name, events)
|
135
135
|
trace "send messages", :target => target_name, :events => events
|
136
|
-
unless @targets.
|
136
|
+
unless @targets.any?{|t| t.name == target_name} # discard events for target not registered
|
137
137
|
trace "messages skipped for non-opened target", :target => target_name
|
138
138
|
return
|
139
139
|
end
|
140
140
|
return if events.size < 1
|
141
141
|
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
142
|
+
target = @targets.select{|t| t.name == target_name}.first
|
143
|
+
|
144
|
+
if @typedef_manager.lazy?(target.name)
|
145
|
+
info "opening lazy target", :target => target
|
146
|
+
debug "generating base fieldset from event", :target => target.name, :event => events.first
|
147
|
+
base_fieldset = @typedef_manager.generate_base_fieldset(target.name, events.first)
|
146
148
|
|
147
|
-
debug "registering base fieldset", :target =>
|
148
|
-
register_base_fieldset(
|
149
|
+
debug "registering base fieldset", :target => target.name, :base => base_fieldset
|
150
|
+
register_base_fieldset(target.name, base_fieldset)
|
149
151
|
|
150
|
-
info "target successfully opened with fieldset", :target =>
|
152
|
+
info "target successfully opened with fieldset", :target => target, :base => base_fieldset
|
151
153
|
end
|
152
154
|
|
153
155
|
registered_data_fieldset = @registered_fieldsets[target_name][:data]
|
154
156
|
|
155
|
-
target = @targets.select{|t| t.name == target_name}.first
|
156
157
|
strict_refer = (not target.auto_field?)
|
157
158
|
|
158
159
|
events.each do |event|
|
data/lib/norikra/target.rb
CHANGED
data/lib/norikra/typedef.rb
CHANGED
data/lib/norikra/version.rb
CHANGED
@@ -224,24 +224,23 @@ describe Norikra::TypedefManager do
|
|
224
224
|
end
|
225
225
|
end
|
226
226
|
|
227
|
-
describe '#
|
228
|
-
it 'returns
|
227
|
+
describe '#dump_target' do
|
228
|
+
it 'returns target typedef dump' do
|
229
229
|
m = Norikra::TypedefManager.new
|
230
230
|
m.add_target('sample', {'a'=>'string','b'=>'string','c'=>'double'})
|
231
231
|
m.reserve('sample', 'z', 'boolean')
|
232
232
|
m.add_target('sample_next', {'a'=>'string','b'=>'string','c'=>'double','d'=>'double'})
|
233
233
|
|
234
|
-
r = m.
|
235
|
-
expect(r
|
236
|
-
expect(r[0][:name]).to eql('sample')
|
237
|
-
expect(r[0][:fields]).to eql({
|
234
|
+
r = m.dump_target('sample')
|
235
|
+
expect(r).to eql({
|
238
236
|
a: {name: 'a', type: 'string', optional: false},
|
239
237
|
b: {name: 'b', type: 'string', optional: false},
|
240
238
|
c: {name: 'c', type: 'double', optional: false},
|
241
239
|
z: {name: 'z', type: 'boolean', optional: true},
|
242
240
|
})
|
243
|
-
|
244
|
-
|
241
|
+
|
242
|
+
r = m.dump_target('sample_next')
|
243
|
+
expect(r).to eql({
|
245
244
|
a: {name: 'a', type: 'string', optional: false},
|
246
245
|
b: {name: 'b', type: 'string', optional: false},
|
247
246
|
c: {name: 'c', type: 'double', optional: false},
|
metadata
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
name: norikra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.15
|
6
6
|
platform: java
|
7
7
|
authors:
|
8
8
|
- TAGOMORI Satoshi
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-10-
|
12
|
+
date: 2013-10-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mizuno
|