burner 1.5.0 → 1.6.0.pre.alpha

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 432bc8b6df5023860fce0b34698d777e30389d3af17c800c978f304ec5eef53c
4
- data.tar.gz: e75d8dac2a871e44b427f62dd727aefe32beefaad9838af28d7d5a34da6bf6ed
3
+ metadata.gz: a5d81ad3d936aefde8cb52a299a1b28d8baf8ca40cfefee478a1c1e525578aec
4
+ data.tar.gz: f69f993fa1a51a4c5ed6e88a7225a1646c7ef47a38369b09680532854e961f84
5
5
  SHA512:
6
- metadata.gz: 2c040e39a740139a320a98fc76e75180558585546a97218d7842cb746e9f0d451665b6abd647595b64ecf0ffb8e67de8c1103649bae80d88f801f228f0cb1980
7
- data.tar.gz: a39ea1c4eca448a39e969d52bae28f1fc30c3e50009a96058beb9f519ca73d1dd3ee46adb8ca99a5c9e63edffdb5a858e561869d93b26adc36cc4e7f7f05f611
6
+ metadata.gz: 4c670ad08031fc43df3aa1b995828ce507aa213e294c3ac4cfdef6a8d187a53224ad31bb44a959bb72cc220f06e9094dea4af6301bee5fea3d375c241bd0b493
7
+ data.tar.gz: 11ef5e19a6160c0a9e943de848beb2b03ffa35bb5c8401eab9884cdddb5d4e43d2bd31ee4bc2f36479b28f7409afe32d7941f969a87f28743a50fceb7ec4342c
@@ -1,4 +1,9 @@
1
1
 
2
+ # 1.6.0 (TBD)
3
+
4
+ Additions:
5
+
6
+ * b/io/write now provides an optional `supress_side_effect` option.
2
7
  # 1.5.0 (December 21st, 2020)
3
8
 
4
9
  Added Jobs:
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,
@@ -8,5 +8,5 @@
8
8
  #
9
9
 
10
10
  module Burner
11
- VERSION = '1.5.0'
11
+ VERSION = '1.6.0-alpha'
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.5.0
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-21 00:00:00.000000000 Z
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: '0'
315
+ version: 1.3.1
316
316
  requirements: []
317
317
  rubygems_version: 3.0.3
318
318
  signing_key: