bridgetown-core 1.0.0.alpha2 → 1.0.0.alpha3

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: a735962a1880837aa59641e65afa3985f0ebb091861ae32972d0b875229cfc7d
4
- data.tar.gz: a64d7710c18a4c80805bd7196eacd07387fa1b3061616e8ed2b4de8b9a228871
3
+ metadata.gz: 2c5f6a5f0fc27c9e3f7d45161e91317fd42e7dbeb789d8c38a103a610efb9d46
4
+ data.tar.gz: 68431d8ead8cdb11107db03aa57ae3d4607d0809e60f3fd30d7045d58e1c67f0
5
5
  SHA512:
6
- metadata.gz: 7c136fee524ff82c30ceedcc8ef0ef11fc877ac82066c6bd1d16e0d55cc47391b2b211b72c9f2229d7d83685edb98968e516d2eea09510a1c7c3c4ab0466e6e9
7
- data.tar.gz: 05b65d5c57dfdbd0dcea25ab15875b637868ecd4c69a76a288fe23dd64dc06eb2c3ee6ec980f30b3957888859fbed2e7771a007cf7188cf7572808a17a5c9372
6
+ metadata.gz: 57daec3a249941fc6303a22e470cd8fc8e1641be8527a6533c7c73527a93fc04321b774407865a07fb99df95566902d035cfdf84fd68f8aa6e440fac6860d266
7
+ data.tar.gz: f42ce24666c948ad8616ef25cb36a766392279e216716a397d27308ae5b06acb58305887264f04c83faedf3ed6a68fcdbbf716e648935bb92de8c019997c1c03
@@ -30,7 +30,7 @@ module Bridgetown
30
30
  #
31
31
  # @param ext [String] erb, slim, etc.
32
32
  def renderer_for_ext(ext, &block)
33
- @_tmpl ||= case ext
33
+ @_tmpl ||= case ext.to_s
34
34
  when "erb"
35
35
  include ERBCapture
36
36
  Tilt::ErubiTemplate.new(component_template_path,
@@ -14,10 +14,10 @@ module Bridgetown
14
14
  end
15
15
 
16
16
  def liquid_engine_configured?
17
- data["template_engine"] == "liquid" ||
17
+ data["template_engine"].to_s == "liquid" ||
18
18
  (
19
19
  data["template_engine"].nil? && (
20
- site.config[:template_engine].nil? || site.config[:template_engine] == "liquid"
20
+ site.config[:template_engine].nil? || site.config[:template_engine].to_s == "liquid"
21
21
  )
22
22
  )
23
23
  end
@@ -110,7 +110,7 @@ module Bridgetown
110
110
  #
111
111
  # @return [String] The converted content.
112
112
  def convert(content, convertible)
113
- return content if convertible.data[:template_engine] != "erb"
113
+ return content if convertible.data[:template_engine].to_s != "erb"
114
114
 
115
115
  erb_view = Bridgetown::ERBView.new(convertible)
116
116
 
@@ -131,10 +131,12 @@ module Bridgetown
131
131
  end
132
132
  end
133
133
 
134
+ # @param ext [String]
135
+ # @param convertible [Bridgetown::Resource::Base, Bridgetown::GeneratedPage]
134
136
  def matches(ext, convertible)
135
- if convertible.data[:template_engine] == "erb" ||
137
+ if convertible.data[:template_engine].to_s == "erb" ||
136
138
  (convertible.data[:template_engine].nil? &&
137
- @config[:template_engine] == "erb")
139
+ @config[:template_engine].to_s == "erb")
138
140
  convertible.data[:template_engine] = "erb"
139
141
  return true
140
142
  end
@@ -56,6 +56,8 @@ module Bridgetown
56
56
  # rubocop: enable Metrics/MethodLength
57
57
  # rubocop: enable Metrics/AbcSize
58
58
 
59
+ # @param ext [String]
60
+ # @param convertible [Bridgetown::Resource::Base, Bridgetown::GeneratedPage]
59
61
  def matches(ext, convertible)
60
62
  if convertible.render_with_liquid?
61
63
  convertible.data[:template_engine] = "liquid"
@@ -38,9 +38,9 @@ module Bridgetown
38
38
 
39
39
  def read_data_from_builder
40
40
  builder = Kernel.const_get(url.host.gsub(".", "::"))
41
- raise NameError unless builder.respond_to?(:resource_data_for_id)
41
+ raise NameError unless builder.instance_methods.include?(:resource_data_for_id)
42
42
 
43
- builder.resource_data_for_id(id)
43
+ builder.new.resource_data_for_id(id) || raise(NameError)
44
44
  rescue NameError
45
45
  raise(
46
46
  Bridgetown::Errors::FatalException,
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bridgetown
4
- VERSION = "1.0.0.alpha2"
4
+ VERSION = "1.0.0.alpha3"
5
5
  CODE_NAME = "Pearl"
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridgetown-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.alpha2
4
+ version: 1.0.0.alpha3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bridgetown Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-16 00:00:00.000000000 Z
11
+ date: 2021-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel