burner 1.0.0.pre.alpha.2 → 1.0.0.pre.alpha.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +2 -0
  3. data/README.md +57 -25
  4. data/burner.gemspec +3 -0
  5. data/exe/burner +2 -3
  6. data/lib/burner.rb +11 -0
  7. data/lib/burner/cli.rb +11 -9
  8. data/lib/burner/job.rb +29 -9
  9. data/lib/burner/job_with_register.rb +24 -0
  10. data/lib/burner/jobs.rb +21 -23
  11. data/lib/burner/library.rb +32 -0
  12. data/lib/burner/library/collection/arrays_to_objects.rb +75 -0
  13. data/lib/burner/library/collection/graph.rb +42 -0
  14. data/lib/burner/library/collection/objects_to_arrays.rb +88 -0
  15. data/lib/burner/library/collection/shift.rb +42 -0
  16. data/lib/burner/library/collection/transform.rb +66 -0
  17. data/lib/burner/library/collection/unpivot.rb +53 -0
  18. data/lib/burner/library/collection/validate.rb +89 -0
  19. data/lib/burner/library/collection/values.rb +49 -0
  20. data/lib/burner/library/deserialize/csv.rb +27 -0
  21. data/lib/burner/{jobs → library}/deserialize/json.rb +7 -6
  22. data/lib/burner/{jobs → library}/deserialize/yaml.rb +14 -8
  23. data/lib/burner/{jobs → library}/dummy.rb +4 -4
  24. data/lib/burner/{jobs → library}/echo.rb +5 -5
  25. data/lib/burner/{jobs → library}/io/base.rb +4 -10
  26. data/lib/burner/{jobs → library}/io/exist.rb +13 -11
  27. data/lib/burner/{jobs → library}/io/read.rb +9 -8
  28. data/lib/burner/{jobs → library}/io/write.rb +11 -8
  29. data/lib/burner/library/serialize/csv.rb +37 -0
  30. data/lib/burner/{jobs → library}/serialize/json.rb +7 -6
  31. data/lib/burner/{jobs → library}/serialize/yaml.rb +7 -6
  32. data/lib/burner/{jobs/set.rb → library/set_value.rb} +9 -8
  33. data/lib/burner/{jobs → library}/sleep.rb +4 -4
  34. data/lib/burner/modeling.rb +13 -0
  35. data/lib/burner/modeling/attribute.rb +29 -0
  36. data/lib/burner/modeling/attribute_renderer.rb +32 -0
  37. data/lib/burner/modeling/key_index_mapping.rb +29 -0
  38. data/lib/burner/modeling/validations.rb +23 -0
  39. data/lib/burner/modeling/validations/base.rb +35 -0
  40. data/lib/burner/modeling/validations/blank.rb +31 -0
  41. data/lib/burner/modeling/validations/present.rb +31 -0
  42. data/lib/burner/payload.rb +55 -10
  43. data/lib/burner/pipeline.rb +25 -6
  44. data/lib/burner/side_effects.rb +10 -0
  45. data/lib/burner/side_effects/written_file.rb +28 -0
  46. data/lib/burner/step.rb +2 -8
  47. data/lib/burner/util.rb +11 -0
  48. data/lib/burner/util/arrayable.rb +30 -0
  49. data/lib/burner/util/string_template.rb +42 -0
  50. data/lib/burner/version.rb +1 -1
  51. metadata +81 -16
  52. data/lib/burner/string_template.rb +0 -40
  53. data/lib/burner/written_file.rb +0 -28
@@ -8,5 +8,5 @@
8
8
  #
9
9
 
10
10
  module Burner
11
- VERSION = '1.0.0-alpha.2'
11
+ VERSION = '1.0.0-alpha.7'
12
12
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: burner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.alpha.2
4
+ version: 1.0.0.pre.alpha.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Ruggio
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-15 00:00:00.000000000 Z
11
+ date: 2020-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: acts_as_hashable
@@ -24,6 +24,34 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: hashematics
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: hash_math
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.2'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.2'
27
55
  - !ruby/object:Gem::Dependency
28
56
  name: objectable
29
57
  requirement: !ruby/object:Gem::Requirement
@@ -38,6 +66,20 @@ dependencies:
38
66
  - - "~>"
39
67
  - !ruby/object:Gem::Version
40
68
  version: '1.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: realize
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.2'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.2'
41
83
  - !ruby/object:Gem::Dependency
42
84
  name: stringento
43
85
  requirement: !ruby/object:Gem::Requirement
@@ -178,26 +220,49 @@ files:
178
220
  - lib/burner.rb
179
221
  - lib/burner/cli.rb
180
222
  - lib/burner/job.rb
223
+ - lib/burner/job_with_register.rb
181
224
  - lib/burner/jobs.rb
182
- - lib/burner/jobs/deserialize/json.rb
183
- - lib/burner/jobs/deserialize/yaml.rb
184
- - lib/burner/jobs/dummy.rb
185
- - lib/burner/jobs/echo.rb
186
- - lib/burner/jobs/io/base.rb
187
- - lib/burner/jobs/io/exist.rb
188
- - lib/burner/jobs/io/read.rb
189
- - lib/burner/jobs/io/write.rb
190
- - lib/burner/jobs/serialize/json.rb
191
- - lib/burner/jobs/serialize/yaml.rb
192
- - lib/burner/jobs/set.rb
193
- - lib/burner/jobs/sleep.rb
225
+ - lib/burner/library.rb
226
+ - lib/burner/library/collection/arrays_to_objects.rb
227
+ - lib/burner/library/collection/graph.rb
228
+ - lib/burner/library/collection/objects_to_arrays.rb
229
+ - lib/burner/library/collection/shift.rb
230
+ - lib/burner/library/collection/transform.rb
231
+ - lib/burner/library/collection/unpivot.rb
232
+ - lib/burner/library/collection/validate.rb
233
+ - lib/burner/library/collection/values.rb
234
+ - lib/burner/library/deserialize/csv.rb
235
+ - lib/burner/library/deserialize/json.rb
236
+ - lib/burner/library/deserialize/yaml.rb
237
+ - lib/burner/library/dummy.rb
238
+ - lib/burner/library/echo.rb
239
+ - lib/burner/library/io/base.rb
240
+ - lib/burner/library/io/exist.rb
241
+ - lib/burner/library/io/read.rb
242
+ - lib/burner/library/io/write.rb
243
+ - lib/burner/library/serialize/csv.rb
244
+ - lib/burner/library/serialize/json.rb
245
+ - lib/burner/library/serialize/yaml.rb
246
+ - lib/burner/library/set_value.rb
247
+ - lib/burner/library/sleep.rb
248
+ - lib/burner/modeling.rb
249
+ - lib/burner/modeling/attribute.rb
250
+ - lib/burner/modeling/attribute_renderer.rb
251
+ - lib/burner/modeling/key_index_mapping.rb
252
+ - lib/burner/modeling/validations.rb
253
+ - lib/burner/modeling/validations/base.rb
254
+ - lib/burner/modeling/validations/blank.rb
255
+ - lib/burner/modeling/validations/present.rb
194
256
  - lib/burner/output.rb
195
257
  - lib/burner/payload.rb
196
258
  - lib/burner/pipeline.rb
259
+ - lib/burner/side_effects.rb
260
+ - lib/burner/side_effects/written_file.rb
197
261
  - lib/burner/step.rb
198
- - lib/burner/string_template.rb
262
+ - lib/burner/util.rb
263
+ - lib/burner/util/arrayable.rb
264
+ - lib/burner/util/string_template.rb
199
265
  - lib/burner/version.rb
200
- - lib/burner/written_file.rb
201
266
  homepage: https://github.com/bluemarblepayroll/burner
202
267
  licenses:
203
268
  - MIT
@@ -1,40 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- #
4
- # Copyright (c) 2020-present, Blue Marble Payroll, LLC
5
- #
6
- # This source code is licensed under the MIT license found in the
7
- # LICENSE file in the root directory of this source tree.
8
- #
9
-
10
- module Burner
11
- # Can take in a string and an object and use the object for formatting string interpolations
12
- # using tokens of form: {attribute_name}. This templating class does not understand nested
13
- # structures, so input should be a flat object/hash in the form of key-value pairs. A benefit of
14
- # using Objectable for resolution is that it can understand almost any type of
15
- # object: Hash, Struct, OpenStruct, custom objects, etc.
16
- # For more information see underlying libraries:
17
- # * Stringento: https://github.com/bluemarblepayroll/stringento
18
- # * Objectable: https://github.com/bluemarblepayroll/objectable
19
- class StringTemplate
20
- include Singleton
21
-
22
- attr_reader :resolver
23
-
24
- def initialize
25
- @resolver = Objectable.resolver(separator: '')
26
-
27
- freeze
28
- end
29
-
30
- # For general consumption
31
- def evaluate(expression, input)
32
- Stringento.evaluate(expression, input, resolver: self)
33
- end
34
-
35
- # For Stringento consumption
36
- def resolve(value, input)
37
- resolver.get(input, value)
38
- end
39
- end
40
- end
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- #
4
- # Copyright (c) 2020-present, Blue Marble Payroll, LLC
5
- #
6
- # This source code is licensed under the MIT license found in the
7
- # LICENSE file in the root directory of this source tree.
8
- #
9
-
10
- module Burner
11
- # Describes a file that was generated by a Job. If a Job emits a file, it should also add the
12
- # file details to the Payload#written_files array using the Payload#add_written_file method.
13
- class WrittenFile
14
- acts_as_hashable
15
-
16
- attr_reader :logical_filename,
17
- :physical_filename,
18
- :time_in_seconds
19
-
20
- def initialize(logical_filename:, physical_filename:, time_in_seconds:)
21
- @logical_filename = logical_filename.to_s
22
- @physical_filename = physical_filename.to_s
23
- @time_in_seconds = time_in_seconds.to_f
24
-
25
- freeze
26
- end
27
- end
28
- end