k_builder 0.0.39 → 0.0.40
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/k_builder/base_builder.rb +0 -68
- data/lib/k_builder/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 323fb5218f6098e38b7aedb951f8ff7c6aa93e891a9bbe77ffecf4ef2b0385ad
|
4
|
+
data.tar.gz: '085e4f77356020cb7bbbf8b45332d635ef915c80d109fe5101b81ae101446874'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86eb1f2f02fea68c10bfa428e4e415931378ca6d696b041abeb995590f14488e01aa90a19832e697c4faff6dca97b9522d7ac5e3ca734a004ff3b2f7c821c1c3
|
7
|
+
data.tar.gz: 76c486d493078154cafe97ab96870b856cbd9813a18fc6b353210c1aed82a11df7ae039fcef291c4806c505788acef4d85fa1f3199e324cbab293405c653743d
|
@@ -41,16 +41,6 @@ module KBuilder
|
|
41
41
|
|
42
42
|
@target_folders = configuration.target_folders.clone
|
43
43
|
@template_folders = configuration.template_folders.clone
|
44
|
-
|
45
|
-
define_builder_setter_methods
|
46
|
-
end
|
47
|
-
|
48
|
-
# Return an array of symbols to represent the fluent
|
49
|
-
# setter methods that you want on your builder.
|
50
|
-
#
|
51
|
-
# Abstract method
|
52
|
-
def builder_setter_methods
|
53
|
-
[]
|
54
44
|
end
|
55
45
|
|
56
46
|
# @return [Hash/StrongType] Returns data object, can be a hash
|
@@ -254,63 +244,5 @@ module KBuilder
|
|
254
244
|
system(build_command)
|
255
245
|
end
|
256
246
|
alias rc run_command
|
257
|
-
|
258
|
-
# TODO
|
259
|
-
# Support Nesting
|
260
|
-
# Support Generation fo the following
|
261
|
-
# - fluent set_
|
262
|
-
# - Support setter (non-fluent)
|
263
|
-
# - Support getter (non-fluent)
|
264
|
-
|
265
|
-
# # builds a nested structure by either builder block or hash
|
266
|
-
# # @param data_structure [type=DataStructure]
|
267
|
-
# # @param builder [type=Builder]
|
268
|
-
# # @param attributes [type=Hash|DataStructure instance]
|
269
|
-
# # @param &block
|
270
|
-
# #
|
271
|
-
# # @return [type=Hash]
|
272
|
-
# def build_nested(data_structure, builder, attributes = {}, &block)
|
273
|
-
# if block_given?
|
274
|
-
# builder.build(&block).to_h
|
275
|
-
# else
|
276
|
-
# build_hash(data_structure, attributes)
|
277
|
-
# end
|
278
|
-
# end
|
279
|
-
|
280
|
-
private
|
281
|
-
|
282
|
-
# #
|
283
|
-
# # @param data_structure [type=DataStructure]
|
284
|
-
# # @param attributes [type=Hash, DataStructure]
|
285
|
-
# #
|
286
|
-
# # @return [type=Hash]
|
287
|
-
# def build_hash(data_structure, attributes)
|
288
|
-
# if attributes.is_a?(data_structure)
|
289
|
-
# attributes.to_h
|
290
|
-
# else
|
291
|
-
# data_structure.new(attributes).to_h
|
292
|
-
# end
|
293
|
-
# end
|
294
|
-
|
295
|
-
# Defines all of the necessary builder setter methods
|
296
|
-
#
|
297
|
-
# @return [Builder] Returns the builder via fluent interface
|
298
|
-
def define_builder_setter_methods
|
299
|
-
builder_setter_methods.each { |method| define_builder_method(method) }
|
300
|
-
self
|
301
|
-
end
|
302
|
-
|
303
|
-
# Defines a method using the convention set_[method_name]
|
304
|
-
#
|
305
|
-
# Convention: Setter methods (are Fluent) and use the prefix set_
|
306
|
-
# Getter methods (are NOT fluent) and return the stored value
|
307
|
-
#
|
308
|
-
# @return [Builder] Returns the builder via fluent interface
|
309
|
-
def define_builder_method(method_name)
|
310
|
-
self.class.send(:define_method, "set_#{method_name}") do |value|
|
311
|
-
@hash[method_name.to_s] = value
|
312
|
-
self
|
313
|
-
end
|
314
|
-
end
|
315
247
|
end
|
316
248
|
end
|
data/lib/k_builder/version.rb
CHANGED