gryphon_nest 2.0.0 → 2.0.1

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: 13f76380c2a03e716f50ee3d517a0af74a5423dcea83d563106984d524368e90
4
- data.tar.gz: 3bfd1e61ab10066a5a5256eca4081e6e38933dc7b6346af970b638a1eb264efe
3
+ metadata.gz: 19531d127171f4f388faf53f703b2b3f7529dcba0641d6d0eb781a778a7e1390
4
+ data.tar.gz: 8f90b27680df5977c8af25d7f35bb238960b86a1c6951d3ded1db56977178741
5
5
  SHA512:
6
- metadata.gz: f1e2a37c7033667a27292820001c85e826dc86792cd7c1a8a98428659432da7b84dab599870491716eba06c08f3432687fc5668ba7aaa8f9b373e4e31137c65e
7
- data.tar.gz: 55797182fcea5cba3af32c20ae18016b7ab2fb9a5653a1526e5c27fb540f973e0f27e4f2a450628ea4176d349c3fc0389f64d5b4fdff000517c227f815e0688b
6
+ metadata.gz: 1dae70b86362c2ae2c022ec1c0bb4f37787d65b04691ce828a624a2cc222f05a24bd11c68e4b1ea27b1a864cc7ee0ba29d8b81a5f0e4e9bc80109c93ffe67351
7
+ data.tar.gz: eeb408900bafc6c56de025c1edc502ad4354cfbe6c72d30c10c8df1b268747b8cf56dea9898d4ff71fbf0c28deab8d87e49037b717a748a3adc38027592fc2e5
data/bin/nest CHANGED
@@ -45,7 +45,7 @@ begin
45
45
  GryphonNest.serve_website(options[:port]) if command == 'serve'
46
46
  rescue OptionParser::ParseError => e
47
47
  usage_error(e.message, parser)
48
- rescue StandardError => e
49
- warn e.message
50
- exit(EXIT_FAILURE)
48
+ # rescue StandardError => e
49
+ # warn e.message
50
+ # exit(EXIT_FAILURE)
51
51
  end
@@ -15,6 +15,8 @@ module GryphonNest
15
15
  # @raise [Errors::YamlError]
16
16
  def process(file)
17
17
  dest = dest_name(file)
18
+ msg = File.exist?(dest) ? 'Recreating' : 'Creating'
19
+ puts "#{msg} #{dest}"
18
20
  context = read_context(file)
19
21
  content = @renderer.render_file(file, context)
20
22
  write_file(dest, content)
@@ -53,7 +55,6 @@ module GryphonNest
53
55
  def write_file(path, content)
54
56
  dir = path.dirname
55
57
  dir.mkpath
56
- puts "Creating #{path}"
57
58
  path.write(content)
58
59
  end
59
60
  end
@@ -12,28 +12,22 @@ module GryphonNest
12
12
  # @return [String]
13
13
  def render_file(template, context = {})
14
14
  content = super
15
-
16
- layout ||= read_layout_file
17
- unless layout.empty?
18
- context['yield'] = content
19
- content = render(layout, context)
20
- end
21
-
22
15
  HtmlBeautifier.beautify(content)
23
16
  end
24
17
 
25
18
  # @param name [String]
26
19
  # @return [String]
27
20
  def partial(name)
28
- File.read(name)
21
+ content = File.read(name)
22
+ layout ||= read_layout_file
23
+ layout.empty? ? content : layout.sub(/{{{\s*yield\s*}}}/, content)
29
24
  end
30
25
 
31
26
  private
32
27
 
33
28
  # @return [String]
34
29
  def read_layout_file
35
- layout_file = @options['layout_file']
36
- File.read(layout_file)
30
+ File.read(LAYOUT_FILE)
37
31
  rescue IOError, Errno::ENOENT
38
32
  ''
39
33
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GryphonNest
4
- VERSION = '2.0.0'
4
+ VERSION = '2.0.1'
5
5
  end
data/lib/gryphon_nest.rb CHANGED
@@ -45,7 +45,7 @@ module GryphonNest
45
45
  # @return [Array<Pathname>]
46
46
  def process_content
47
47
  processed_files = []
48
- renderer = Renderers::MustacheRenderer.new({ 'layout_file' => LAYOUT_FILE })
48
+ renderer = Renderers::MustacheRenderer.new
49
49
  asset_processor = Processors::AssetProcessor.new
50
50
 
51
51
  processors = {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gryphon_nest
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Birmingham
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-07 00:00:00.000000000 Z
11
+ date: 2024-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlbeautifier