burner 1.5.0 → 1.6.0.pre.alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +1 -1
- data/lib/burner/library/io/write.rb +28 -1
- data/lib/burner/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5d81ad3d936aefde8cb52a299a1b28d8baf8ca40cfefee478a1c1e525578aec
|
4
|
+
data.tar.gz: f69f993fa1a51a4c5ed6e88a7225a1646c7ef47a38369b09680532854e961f84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c670ad08031fc43df3aa1b995828ce507aa213e294c3ac4cfdef6a8d187a53224ad31bb44a959bb72cc220f06e9094dea4af6301bee5fea3d375c241bd0b493
|
7
|
+
data.tar.gz: 11ef5e19a6160c0a9e943de848beb2b03ffa35bb5c8401eab9884cdddb5d4e43d2bd31ee4bc2f36479b28f7409afe32d7941f969a87f28743a50fceb7ec4342c
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -246,7 +246,7 @@ By default all jobs will use the `Burner::Disks::Local` disk for its persistence
|
|
246
246
|
* **b/io/exist** [disk, path, short_circuit]: Check to see if a file exists. The path parameter can be interpolated using `Payload#params`. If short_circuit was set to true (defaults to false) and the file does not exist then the pipeline will be short-circuited.
|
247
247
|
* **b/io/read** [binary, disk, path, register]: Read in a local file. The path parameter can be interpolated using `Payload#params`. If the contents are binary, pass in `binary: true` to open it up in binary+read mode.
|
248
248
|
* **b/io/row_reader** [data_key, disk, ignore_blank_path, ignore_file_not_found, path_key, register, separator]: Iterates over an array of objects, extracts a filepath from a key in each object, and attempts to load the file's content for each record. The file's content will be stored at the specified data_key. By default missing paths or files will be treated as hard errors. If you wish to ignore these then pass in true for ignore_blank_path and/or ignore_file_not_found.
|
249
|
-
* **b/io/write** [binary, disk, path, register]: Write to a local file. The path parameter can be interpolated using `Payload#params`. If the contents are binary, pass in `binary: true` to open it up in binary+write mode.
|
249
|
+
* **b/io/write** [binary, disk, path, register, supress_side_effect]: Write to a local file. The path parameter can be interpolated using `Payload#params`. If the contents are binary, pass in `binary: true` to open it up in binary+write mode. By default, written files are also logged as WrittenFile instances to the Payload#side_effects array. You can pass in supress_side_effect: true to disable this behavior.
|
250
250
|
|
251
251
|
#### Serialization
|
252
252
|
|
@@ -12,11 +12,34 @@ require_relative 'open_file_base'
|
|
12
12
|
module Burner
|
13
13
|
module Library
|
14
14
|
module IO
|
15
|
-
# Write value to disk.
|
15
|
+
# Write value to disk. By default, written files are also logged as WrittenFile
|
16
|
+
# instances to the Payload#side_effects array. You can pass in
|
17
|
+
# supress_side_effect: true to disable this behavior.
|
16
18
|
#
|
17
19
|
# Expected Payload[register] input: anything.
|
18
20
|
# Payload[register] output: whatever was passed in.
|
19
21
|
class Write < OpenFileBase
|
22
|
+
attr_reader :supress_side_effect
|
23
|
+
|
24
|
+
def initialize(
|
25
|
+
name:,
|
26
|
+
path:,
|
27
|
+
binary: false,
|
28
|
+
disk: {},
|
29
|
+
register: DEFAULT_REGISTER,
|
30
|
+
supress_side_effect: false
|
31
|
+
)
|
32
|
+
@supress_side_effect = supress_side_effect || false
|
33
|
+
|
34
|
+
super(
|
35
|
+
binary: binary,
|
36
|
+
disk: disk,
|
37
|
+
name: name,
|
38
|
+
path: path,
|
39
|
+
register: register
|
40
|
+
)
|
41
|
+
end
|
42
|
+
|
20
43
|
def perform(output, payload)
|
21
44
|
logical_filename = job_string_template(path, output, payload)
|
22
45
|
physical_filename = nil
|
@@ -29,6 +52,10 @@ module Burner
|
|
29
52
|
|
30
53
|
output.detail("Wrote to: #{physical_filename}")
|
31
54
|
|
55
|
+
return if supress_side_effect
|
56
|
+
|
57
|
+
output.detail("Saving to side effects: #{logical_filename}")
|
58
|
+
|
32
59
|
side_effect = SideEffects::WrittenFile.new(
|
33
60
|
logical_filename: logical_filename,
|
34
61
|
physical_filename: physical_filename,
|
data/lib/burner/version.rb
CHANGED
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.
|
4
|
+
version: 1.6.0.pre.alpha
|
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-12-
|
11
|
+
date: 2020-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: acts_as_hashable
|
@@ -310,9 +310,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
310
310
|
version: '2.5'
|
311
311
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
312
312
|
requirements:
|
313
|
-
- - "
|
313
|
+
- - ">"
|
314
314
|
- !ruby/object:Gem::Version
|
315
|
-
version:
|
315
|
+
version: 1.3.1
|
316
316
|
requirements: []
|
317
317
|
rubygems_version: 3.0.3
|
318
318
|
signing_key:
|