file_pipeline 0.0.5 → 0.0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 322625abd230234c894c2301fd0e0c1b3796468990a5afaecce49420bc6867f9
4
- data.tar.gz: 24d827592c3d395b26b60091197c03eb066a5692515756d9e626c43b7d900df8
3
+ metadata.gz: 51b495ebce21752d34f27eef33a350539f8918076774063323e603cde82a7726
4
+ data.tar.gz: f6bd55e7129fe2308193af2e12630a867cca866ae6ce71dd177a9deea3e2aa00
5
5
  SHA512:
6
- metadata.gz: b0e4a5ab15d7e2249eef4bafb01c7aa4ddc1c1781e7f916992f06859497d1a61309157d9fc46a271cea13b226f3abeb10bc787914bcda4fe2ecfb3d0ac8900ed
7
- data.tar.gz: e232e47c1870c5e01a884bcaf3ba0caf7ad0151e310222a1bc3adbdb7ac0a3203f29d34901fb642fc8f4b85f014d4f9f66d18d82e6517688ff723b7110766ee5
6
+ metadata.gz: 47077cb546d41be57b9c662718710c815dda1c3d77b1834946800d2ddf5472abfde8ecf9e107f58b69f6eb573ea536464a316c5d60a5ae97e94a4d5deb6fbc01
7
+ data.tar.gz: 25b006ee9e71a989eea5f22eece86918feabe4f7579cf96425110cf64efe5f0e00ab40335b6002298d552f979894bbcd210869ce8e724c35628306d8da701e1e
@@ -71,6 +71,7 @@ module FilePipeline
71
71
  if info&.failure
72
72
  raise Errors::FailedModificationError, info: info, file: original
73
73
  end
74
+
74
75
  version = validate(file)
75
76
  @history[version] = info
76
77
  self
@@ -147,6 +148,9 @@ module FilePipeline
147
148
  # resets the #history to an empty Hash. Returns the path to the written
148
149
  # file.
149
150
  #
151
+ # If the optional block is passed, it will be evaluated before the file is
152
+ # finalized.
153
+ #
150
154
  # ===== Options
151
155
  #
152
156
  # * +overwrite+ - +true+ or +false+
@@ -154,6 +158,7 @@ module FilePipeline
154
158
  # #basename and the #original will be preserved.
155
159
  # * +true+ - The finalized version will replace the #original.
156
160
  def finalize(overwrite: false)
161
+ yield(self) if block_given?
157
162
  filename = overwrite ? replacing_trarget : preserving_taget
158
163
  FileUtils.rm original if overwrite
159
164
  @original = VersionedFile.copy(current, original_dir, filename)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: file_pipeline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Stein