reality-generators 1.18.0 → 1.20.0

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: fc49b7084dd8c304b394d4239e66db433771c2be21644d833443fc64575d058a
4
- data.tar.gz: c9df932fbcd415525cb5357f33e3bd0e19b366fe5f7087102a398be634bae10d
3
+ metadata.gz: 82111a8ab71e331d0ec673a36b5ec56e4f19e84de0316cd00c246aca63512559
4
+ data.tar.gz: 632cbc111de977f63725442d7d70cb90da044b497621f14c14e5a5ec098b4281
5
5
  SHA512:
6
- metadata.gz: c2956dd24501a523e7afd2a492b8218dfce9a79544e3eeccd4d50ceae995f67eff43ea005db0e5cd4e0fecea5af937c001c3d5a8fc936e60cbed3153efd491d4
7
- data.tar.gz: 07ae6c65e4f97a0e4f40884f33fde589f900f79414c94a69f574e8117f8c734987a129aaee5d9ebb3bfc00f4d52bbd66e5092969e32c89ce5c4a06c2bb8dc225
6
+ metadata.gz: 97a5261683324a9e6813d498aa0f776d3fec0e92492947c0bf6211669d7baeea054f3863a02c318bb9294bbdc998fbd735983085c83a0df91e1d86d571d2b1b4
7
+ data.tar.gz: f992d99aa30624121674ab8659853ecdb03366253434929a997bd6f4d6de16278cf7333a877304f5e7e8d6f042e5eb6ac49ece8232572f51bb49fc95f511f07e
@@ -58,7 +58,7 @@ module Reality #nodoc
58
58
  # * :guard - The :guard option passed to the template.
59
59
  #
60
60
  def file_artifact(template_set_suffix, artifact_key, filename_pattern, options = {})
61
- Reality::Options.check(options, [:facets, :guard, :helpers], Reality::Generators, 'define artifact')
61
+ Reality::Options.check(options, [:output_filter, :facets, :guard, :helpers], Reality::Generators, 'define artifact')
62
62
 
63
63
  file_extension = File.extname(filename_pattern)[1...9999]
64
64
 
@@ -111,10 +111,12 @@ module Reality #nodoc
111
111
  # Base class for templates that generate a single file
112
112
  class SingleFileOutputTemplate < Template
113
113
  attr_reader :output_filename_pattern
114
+ attr_reader :output_filter
114
115
 
115
116
  def initialize(template_set, facets, target, template_key, output_filename_pattern, helpers = [], options = {})
116
117
  super(template_set, facets, target, template_key, helpers, options)
117
118
  @output_filename_pattern = output_filename_pattern
119
+ @output_filter = options[:output_filter]
118
120
  end
119
121
 
120
122
  def output_path
@@ -132,6 +134,7 @@ module Reality #nodoc
132
134
  output_filename = File.join(target_basedir, output_filename)
133
135
  unprocessed_files.delete(output_filename)
134
136
  result = self.render_to_string(context_binding)
137
+ result = self.output_filter.call(result) unless self.output_filter.nil?
135
138
  FileUtils.mkdir_p File.dirname(output_filename) unless File.directory?(File.dirname(output_filename))
136
139
  if File.exist?(output_filename) && IO.read(output_filename) == result
137
140
  Generators.debug "Skipped generation of #{self.name} for #{self.target} #{object_name} to #{output_filename} due to no changes"
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{reality-generators}
5
- s.version = '1.18.0'
5
+ s.version = '1.20.0'
6
6
  s.platform = Gem::Platform::RUBY
7
7
 
8
8
  s.authors = ['Peter Donald']
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reality-generators
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.18.0
4
+ version: 1.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Donald
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-16 00:00:00.000000000 Z
11
+ date: 2023-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: reality-core