fluentd 0.10.36 → 0.10.37
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fluentd might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/.travis.yml +2 -2
- data/ChangeLog +8 -0
- data/lib/fluent/config.rb +285 -289
- data/lib/fluent/config_dsl.rb +74 -0
- data/lib/fluent/engine.rb +250 -247
- data/lib/fluent/env.rb +5 -5
- data/lib/fluent/event.rb +120 -124
- data/lib/fluent/input.rb +13 -17
- data/lib/fluent/load.rb +1 -0
- data/lib/fluent/log.rb +238 -242
- data/lib/fluent/match.rb +132 -137
- data/lib/fluent/mixin.rb +151 -155
- data/lib/fluent/parser.rb +201 -205
- data/lib/fluent/plugin.rb +117 -121
- data/lib/fluent/plugin/buf_file.rb +8 -0
- data/lib/fluent/plugin/exec_util.rb +49 -0
- data/lib/fluent/plugin/in_exec.rb +44 -30
- data/lib/fluent/plugin/in_forward.rb +4 -2
- data/lib/fluent/plugin/in_http.rb +5 -0
- data/lib/fluent/plugin/in_stream.rb +5 -2
- data/lib/fluent/plugin/out_exec_filter.rb +4 -47
- data/lib/fluent/plugin/out_stdout.rb +21 -1
- data/lib/fluent/process.rb +358 -362
- data/lib/fluent/status.rb +25 -30
- data/lib/fluent/supervisor.rb +277 -281
- data/lib/fluent/test/base.rb +35 -39
- data/lib/fluent/test/input_test.rb +68 -63
- data/lib/fluent/test/output_test.rb +98 -101
- data/lib/fluent/version.rb +1 -1
- data/test/configdsl.rb +77 -0
- data/test/plugin/in_exec.rb +73 -13
- data/test/plugin/in_gc_stat.rb +1 -1
- data/test/plugin/in_object_space.rb +2 -2
- data/test/plugin/out_stdout.rb +45 -2
- data/test/scripts/exec_script.rb +26 -0
- metadata +31 -46
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 29c756777b0a1c1f7e1aa306760485def2792c6f
|
4
|
+
data.tar.gz: 78dc6cbf225f2ce1c418a4b9e65b0a214a7518a7
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0937333ccf02b3b3fa11806e117b917d1e10f331881db4aa2bb5934ac57a1e75765bfa529683904d91e9fd41464e834981fc54f59adf9bb1ca6c0c42b803bc16
|
7
|
+
data.tar.gz: bac6fa8072ece0d4479a3a75e00b5274b2a28454be52785856384748af98c594daae353d5f5c7a607ef966094cb97e31dea6ca4b6a362b14be9ec331653dc973
|
data/.travis.yml
CHANGED
data/ChangeLog
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
Release 0.10.37 - 2013/08/29
|
2
|
+
|
3
|
+
* in_exec: Add format option to support tsv, json and msgpack. Default is tsv
|
4
|
+
* out_stdout: Add output_type to print non-jsonable object
|
5
|
+
* Engine: Skip nil record in emit
|
6
|
+
* Check buffere_path duplication across buffer configurations.
|
7
|
+
* Add experimental DSL to configuration format
|
8
|
+
|
1
9
|
Release 0.10.36 - 2013/07/31
|
2
10
|
|
3
11
|
* Log: add class name on each error logs
|
data/lib/fluent/config.rb
CHANGED
@@ -16,369 +16,365 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
module Fluent
|
19
|
+
class ConfigError < StandardError
|
20
|
+
end
|
19
21
|
|
22
|
+
class ConfigParseError < ConfigError
|
23
|
+
end
|
20
24
|
|
21
|
-
class ConfigError < StandardError
|
22
|
-
end
|
23
25
|
|
24
|
-
|
25
|
-
|
26
|
+
module Config
|
27
|
+
class Element < Hash
|
28
|
+
def initialize(name, arg, attrs, elements, used=[])
|
29
|
+
@name = name
|
30
|
+
@arg = arg
|
31
|
+
@elements = elements
|
32
|
+
super()
|
33
|
+
attrs.each {|k,v|
|
34
|
+
self[k] = v
|
35
|
+
}
|
36
|
+
@used = used
|
37
|
+
end
|
26
38
|
|
39
|
+
attr_accessor :name, :arg, :elements, :used
|
27
40
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
@elements = elements
|
34
|
-
super()
|
35
|
-
attrs.each {|k,v|
|
36
|
-
self[k] = v
|
37
|
-
}
|
38
|
-
@used = used
|
39
|
-
end
|
41
|
+
def add_element(name, arg='')
|
42
|
+
e = Element.new(name, arg, {}, [])
|
43
|
+
@elements << e
|
44
|
+
e
|
45
|
+
end
|
40
46
|
|
41
|
-
|
47
|
+
def +(o)
|
48
|
+
Element.new(@name.dup, @arg.dup, o.merge(self), @elements+o.elements, @used+o.used)
|
49
|
+
end
|
42
50
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
51
|
+
def has_key?(key)
|
52
|
+
@used << key
|
53
|
+
super
|
54
|
+
end
|
55
|
+
|
56
|
+
def [](key)
|
57
|
+
@used << key
|
58
|
+
super
|
59
|
+
end
|
60
|
+
|
61
|
+
def check_not_fetched(&block)
|
62
|
+
each_key {|key|
|
63
|
+
unless @used.include?(key)
|
64
|
+
block.call(key, self)
|
65
|
+
end
|
66
|
+
}
|
67
|
+
@elements.each {|e|
|
68
|
+
e.check_not_fetched(&block)
|
69
|
+
}
|
70
|
+
end
|
48
71
|
|
49
|
-
|
50
|
-
|
72
|
+
def to_s(nest = 0)
|
73
|
+
indent = " "*nest
|
74
|
+
nindent = " "*(nest+1)
|
75
|
+
out = ""
|
76
|
+
if @arg.empty?
|
77
|
+
out << "#{indent}<#{@name}>\n"
|
78
|
+
else
|
79
|
+
out << "#{indent}<#{@name} #{@arg}>\n"
|
80
|
+
end
|
81
|
+
each_pair {|k,v|
|
82
|
+
out << "#{nindent}#{k} #{v}\n"
|
83
|
+
}
|
84
|
+
@elements.each {|e|
|
85
|
+
out << e.to_s(nest+1)
|
86
|
+
}
|
87
|
+
out << "#{indent}</#{@name}>\n"
|
88
|
+
out
|
89
|
+
end
|
51
90
|
end
|
52
91
|
|
53
|
-
def
|
54
|
-
|
55
|
-
super
|
92
|
+
def self.read(path)
|
93
|
+
Parser.read(path)
|
56
94
|
end
|
57
95
|
|
58
|
-
def
|
59
|
-
|
60
|
-
super
|
96
|
+
def self.parse(str, fname, basepath=Dir.pwd)
|
97
|
+
Parser.parse(str, fname, basepath)
|
61
98
|
end
|
62
99
|
|
63
|
-
def
|
64
|
-
|
65
|
-
unless @used.include?(key)
|
66
|
-
block.call(key, self)
|
67
|
-
end
|
68
|
-
}
|
69
|
-
@elements.each {|e|
|
70
|
-
e.check_not_fetched(&block)
|
71
|
-
}
|
100
|
+
def self.new(name='')
|
101
|
+
Element.new('', '', {}, [])
|
72
102
|
end
|
73
103
|
|
74
|
-
def
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
104
|
+
def self.size_value(str)
|
105
|
+
case str.to_s
|
106
|
+
when /([0-9]+)k/i
|
107
|
+
$~[1].to_i * 1024
|
108
|
+
when /([0-9]+)m/i
|
109
|
+
$~[1].to_i * (1024**2)
|
110
|
+
when /([0-9]+)g/i
|
111
|
+
$~[1].to_i * (1024**3)
|
112
|
+
when /([0-9]+)t/i
|
113
|
+
$~[1].to_i * (1024**4)
|
80
114
|
else
|
81
|
-
|
115
|
+
str.to_i
|
82
116
|
end
|
83
|
-
each_pair {|k,v|
|
84
|
-
out << "#{nindent}#{k} #{v}\n"
|
85
|
-
}
|
86
|
-
@elements.each {|e|
|
87
|
-
out << e.to_s(nest+1)
|
88
|
-
}
|
89
|
-
out << "#{indent}</#{@name}>\n"
|
90
|
-
out
|
91
117
|
end
|
92
|
-
end
|
93
|
-
|
94
|
-
def self.read(path)
|
95
|
-
Parser.read(path)
|
96
|
-
end
|
97
|
-
|
98
|
-
def self.parse(str, fname, basepath=Dir.pwd)
|
99
|
-
Parser.parse(str, fname, basepath)
|
100
|
-
end
|
101
|
-
|
102
|
-
def self.new(name='')
|
103
|
-
Element.new('', '', {}, [])
|
104
|
-
end
|
105
|
-
|
106
|
-
def self.size_value(str)
|
107
|
-
case str.to_s
|
108
|
-
when /([0-9]+)k/i
|
109
|
-
$~[1].to_i * 1024
|
110
|
-
when /([0-9]+)m/i
|
111
|
-
$~[1].to_i * (1024**2)
|
112
|
-
when /([0-9]+)g/i
|
113
|
-
$~[1].to_i * (1024**3)
|
114
|
-
when /([0-9]+)t/i
|
115
|
-
$~[1].to_i * (1024**4)
|
116
|
-
else
|
117
|
-
str.to_i
|
118
|
-
end
|
119
|
-
end
|
120
118
|
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
119
|
+
def self.time_value(str)
|
120
|
+
case str.to_s
|
121
|
+
when /([0-9]+)s/
|
122
|
+
$~[1].to_i
|
123
|
+
when /([0-9]+)m/
|
124
|
+
$~[1].to_i * 60
|
125
|
+
when /([0-9]+)h/
|
126
|
+
$~[1].to_i * 60*60
|
127
|
+
when /([0-9]+)d/
|
128
|
+
$~[1].to_i * 24*60*60
|
129
|
+
else
|
130
|
+
str.to_f
|
131
|
+
end
|
133
132
|
end
|
134
|
-
end
|
135
133
|
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
134
|
+
def self.bool_value(str)
|
135
|
+
case str.to_s
|
136
|
+
when 'true', 'yes'
|
137
|
+
true
|
138
|
+
when 'false', 'no'
|
139
|
+
false
|
140
|
+
else
|
141
|
+
nil
|
142
|
+
end
|
144
143
|
end
|
145
|
-
end
|
146
144
|
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
145
|
+
private
|
146
|
+
class Parser
|
147
|
+
def self.read(path)
|
148
|
+
path = File.expand_path(path)
|
149
|
+
File.open(path) {|io|
|
150
|
+
parse(io, File.basename(path), File.dirname(path))
|
151
|
+
}
|
152
|
+
end
|
155
153
|
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
154
|
+
def self.parse(io, fname, basepath=Dir.pwd)
|
155
|
+
attrs, elems = Parser.new(basepath, io.each_line, fname).parse!(true)
|
156
|
+
Element.new('ROOT', '', attrs, elems)
|
157
|
+
end
|
160
158
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
159
|
+
def initialize(basepath, iterator, fname, i=0)
|
160
|
+
@basepath = basepath
|
161
|
+
@iterator = iterator
|
162
|
+
@i = i
|
163
|
+
@fname = fname
|
164
|
+
end
|
167
165
|
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
166
|
+
def parse!(allow_include, elem_name=nil, attrs={}, elems=[])
|
167
|
+
while line = @iterator.next
|
168
|
+
line.force_encoding('UTF-8')
|
169
|
+
@i += 1
|
170
|
+
line.lstrip!
|
171
|
+
line.gsub!(/\s*(?:\#.*)?$/,'')
|
172
|
+
if line.empty?
|
173
|
+
next
|
174
|
+
elsif m = /^\<([a-zA-Z0-9_]+)\s*(.+?)?\>$/.match(line)
|
175
|
+
e_name = m[1]
|
176
|
+
e_arg = m[2] || ""
|
177
|
+
e_attrs, e_elems = parse!(false, e_name)
|
178
|
+
elems << Element.new(e_name, e_arg, e_attrs, e_elems)
|
179
|
+
elsif line == "</#{elem_name}>"
|
180
|
+
break
|
181
|
+
elsif m = /^([a-zA-Z0-9_]+)\s*(.*)$/.match(line)
|
182
|
+
key = m[1]
|
183
|
+
value = m[2]
|
184
|
+
if allow_include && key == 'include'
|
185
|
+
process_include(attrs, elems, value)
|
186
|
+
else
|
187
|
+
attrs[key] = value
|
188
|
+
end
|
189
|
+
next
|
188
190
|
else
|
189
|
-
|
191
|
+
raise ConfigParseError, "parse error at #{@fname} line #{@i}"
|
190
192
|
end
|
191
|
-
next
|
192
|
-
else
|
193
|
-
raise ConfigParseError, "parse error at #{@fname} line #{@i}"
|
194
193
|
end
|
194
|
+
|
195
|
+
return attrs, elems
|
196
|
+
rescue StopIteration
|
197
|
+
return attrs, elems
|
195
198
|
end
|
196
199
|
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
200
|
+
def process_include(attrs, elems, uri)
|
201
|
+
u = URI.parse(uri)
|
202
|
+
if u.scheme == 'file' || u.path == uri # file path
|
203
|
+
path = u.path
|
204
|
+
if path[0] != ?/
|
205
|
+
pattern = File.expand_path("#{@basepath}/#{path}")
|
206
|
+
else
|
207
|
+
pattern = path
|
208
|
+
end
|
201
209
|
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
pattern = path
|
210
|
-
end
|
210
|
+
Dir.glob(pattern).each {|path|
|
211
|
+
basepath = File.dirname(path)
|
212
|
+
fname = File.basename(path)
|
213
|
+
File.open(path) {|f|
|
214
|
+
Parser.new(basepath, f.each_line, fname).parse!(true, nil, attrs, elems)
|
215
|
+
}
|
216
|
+
}
|
211
217
|
|
212
|
-
|
213
|
-
basepath =
|
214
|
-
fname =
|
215
|
-
|
218
|
+
else
|
219
|
+
basepath = '/'
|
220
|
+
fname = path
|
221
|
+
require 'open-uri'
|
222
|
+
open(uri) {|f|
|
216
223
|
Parser.new(basepath, f.each_line, fname).parse!(true, nil, attrs, elems)
|
217
224
|
}
|
218
|
-
|
225
|
+
end
|
219
226
|
|
220
|
-
|
221
|
-
|
222
|
-
fname = path
|
223
|
-
require 'open-uri'
|
224
|
-
open(uri) {|f|
|
225
|
-
Parser.new(basepath, f.each_line, fname).parse!(true, nil, attrs, elems)
|
226
|
-
}
|
227
|
+
rescue SystemCallError
|
228
|
+
raise ConfigParseError, "include error at #{@fname} line #{@i}: #{$!.to_s}"
|
227
229
|
end
|
228
|
-
|
229
|
-
rescue SystemCallError
|
230
|
-
raise ConfigParseError, "include error at #{@fname} line #{@i}: #{$!.to_s}"
|
231
230
|
end
|
232
231
|
end
|
233
|
-
end
|
234
|
-
|
235
|
-
|
236
|
-
module Configurable
|
237
|
-
attr_reader :config
|
238
232
|
|
239
|
-
def self.included(mod)
|
240
|
-
mod.extend(ClassMethods)
|
241
|
-
end
|
242
233
|
|
243
|
-
|
244
|
-
|
245
|
-
varname = :"@#{name}"
|
246
|
-
instance_variable_set(varname, defval)
|
247
|
-
}
|
248
|
-
end
|
234
|
+
module Configurable
|
235
|
+
attr_reader :config
|
249
236
|
|
250
|
-
|
251
|
-
|
237
|
+
def self.included(mod)
|
238
|
+
mod.extend(ClassMethods)
|
239
|
+
end
|
252
240
|
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
unless instance_variable_defined?(varname)
|
260
|
-
$log.error "config error in:\n#{conf}"
|
261
|
-
raise ConfigError, "'#{name}' parameter is required"
|
262
|
-
end
|
263
|
-
}
|
264
|
-
end
|
241
|
+
def initialize
|
242
|
+
self.class.config_defaults.each_pair {|name,defval|
|
243
|
+
varname = :"@#{name}"
|
244
|
+
instance_variable_set(varname, defval)
|
245
|
+
}
|
246
|
+
end
|
265
247
|
|
266
|
-
|
267
|
-
|
268
|
-
name = name.to_sym
|
248
|
+
def configure(conf)
|
249
|
+
@config = conf
|
269
250
|
|
270
|
-
|
271
|
-
|
272
|
-
if
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
251
|
+
self.class.config_params.each_pair {|name,(block,opts)|
|
252
|
+
varname = :"@#{name}"
|
253
|
+
if val = conf[name.to_s]
|
254
|
+
val = self.instance_exec(val, opts, name, &block)
|
255
|
+
instance_variable_set(varname, val)
|
256
|
+
end
|
257
|
+
unless instance_variable_defined?(varname)
|
258
|
+
$log.error "config error in:\n#{conf}"
|
259
|
+
raise ConfigError, "'#{name}' parameter is required"
|
278
260
|
end
|
279
261
|
}
|
262
|
+
end
|
280
263
|
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
end
|
264
|
+
module ClassMethods
|
265
|
+
def config_param(name, *args, &block)
|
266
|
+
name = name.to_sym
|
285
267
|
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
Proc.new {|val| val.to_f }
|
293
|
-
when :size
|
294
|
-
Proc.new {|val| Config.size_value(val) }
|
295
|
-
when :bool
|
296
|
-
Proc.new {|val| Config.bool_value(val) }
|
297
|
-
when :time
|
298
|
-
Proc.new {|val| Config.time_value(val) }
|
268
|
+
opts = {}
|
269
|
+
args.each {|a|
|
270
|
+
if a.is_a?(Symbol)
|
271
|
+
opts[:type] = a
|
272
|
+
elsif a.is_a?(Hash)
|
273
|
+
opts.merge!(a)
|
299
274
|
else
|
300
|
-
raise ArgumentError, "
|
275
|
+
raise ArgumentError, "wrong number of arguments (#{1+args.length} for #{block ? 2 : 3})"
|
301
276
|
end
|
277
|
+
}
|
302
278
|
|
303
|
-
|
304
|
-
|
305
|
-
|
279
|
+
type = opts[:type]
|
280
|
+
if block && type
|
281
|
+
raise ArgumentError, "wrong number of arguments (#{1+args.length} for #{block ? 2 : 3})"
|
282
|
+
end
|
306
283
|
|
307
|
-
|
308
|
-
|
284
|
+
block ||= case type
|
285
|
+
when :string, nil
|
286
|
+
Proc.new {|val| val }
|
287
|
+
when :integer
|
288
|
+
Proc.new {|val| val.to_i }
|
289
|
+
when :float
|
290
|
+
Proc.new {|val| val.to_f }
|
291
|
+
when :size
|
292
|
+
Proc.new {|val| Config.size_value(val) }
|
293
|
+
when :bool
|
294
|
+
Proc.new {|val| Config.bool_value(val) }
|
295
|
+
when :time
|
296
|
+
Proc.new {|val| Config.time_value(val) }
|
297
|
+
else
|
298
|
+
raise ArgumentError, "unknown config_param type `#{type}'"
|
299
|
+
end
|
300
|
+
|
301
|
+
params = config_params_set
|
302
|
+
params.delete(name)
|
303
|
+
params[name] = [block, opts]
|
304
|
+
|
305
|
+
if opts.has_key?(:default)
|
306
|
+
config_set_default(name, opts[:default])
|
307
|
+
end
|
308
|
+
|
309
|
+
attr_accessor name
|
309
310
|
end
|
310
311
|
|
311
|
-
|
312
|
-
|
312
|
+
def config_set_default(name, defval)
|
313
|
+
name = name.to_sym
|
313
314
|
|
314
|
-
|
315
|
-
|
315
|
+
defaults = config_defaults_set
|
316
|
+
defaults.delete(name)
|
317
|
+
defaults[name] = defval
|
316
318
|
|
317
|
-
|
318
|
-
|
319
|
-
defaults[name] = defval
|
319
|
+
nil
|
320
|
+
end
|
320
321
|
|
321
|
-
|
322
|
-
|
322
|
+
def config_params
|
323
|
+
singleton_value(:_config_params)
|
324
|
+
end
|
323
325
|
|
324
|
-
|
325
|
-
|
326
|
-
|
326
|
+
def config_defaults
|
327
|
+
singleton_value(:_config_defaults)
|
328
|
+
end
|
327
329
|
|
328
|
-
|
329
|
-
|
330
|
-
|
330
|
+
private
|
331
|
+
def config_params_set
|
332
|
+
singleton_value_set(:_config_params)
|
333
|
+
end
|
331
334
|
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
end
|
335
|
+
def config_defaults_set
|
336
|
+
singleton_value_set(:_config_defaults)
|
337
|
+
end
|
336
338
|
|
337
|
-
|
338
|
-
|
339
|
-
|
339
|
+
def singleton_value_set(name)
|
340
|
+
if methods(false).include?(name)
|
341
|
+
__send__(name)
|
342
|
+
else
|
343
|
+
val = {}
|
344
|
+
define_singleton_method(name) { val }
|
345
|
+
val
|
346
|
+
end
|
347
|
+
end
|
340
348
|
|
341
|
-
|
342
|
-
if methods(false).include?(name)
|
343
|
-
__send__(name)
|
344
|
-
else
|
349
|
+
def singleton_value(name)
|
345
350
|
val = {}
|
346
|
-
|
351
|
+
ancestors.reverse_each {|c|
|
352
|
+
if c.methods(false).include?(name)
|
353
|
+
val.merge!(c.__send__(name))
|
354
|
+
end
|
355
|
+
}
|
347
356
|
val
|
348
357
|
end
|
349
358
|
end
|
350
|
-
|
351
|
-
def singleton_value(name)
|
352
|
-
val = {}
|
353
|
-
ancestors.reverse_each {|c|
|
354
|
-
if c.methods(false).include?(name)
|
355
|
-
val.merge!(c.__send__(name))
|
356
|
-
end
|
357
|
-
}
|
358
|
-
val
|
359
|
-
end
|
360
359
|
end
|
361
|
-
end
|
362
360
|
|
363
361
|
|
364
|
-
module PluginId
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
362
|
+
module PluginId
|
363
|
+
def configure(conf)
|
364
|
+
@id = conf['id']
|
365
|
+
super
|
366
|
+
end
|
369
367
|
|
370
|
-
|
371
|
-
|
372
|
-
|
368
|
+
def require_id
|
369
|
+
unless @id
|
370
|
+
raise ConfigError, "'id' parameter is required"
|
371
|
+
end
|
372
|
+
@id
|
373
373
|
end
|
374
|
-
@id
|
375
|
-
end
|
376
374
|
|
377
|
-
|
378
|
-
|
375
|
+
def plugin_id
|
376
|
+
@id ? @id : "object:#{object_id.to_s(16)}"
|
377
|
+
end
|
379
378
|
end
|
380
379
|
end
|
381
380
|
|
382
|
-
|
383
|
-
end
|
384
|
-
|