bullet_train-themes 1.0.2 → 1.0.3

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: b887cc1683a78e19df263a0ae451f8e926517bee14785408483a686f3e7045d2
4
- data.tar.gz: 4634ae00490cd02fe0758bda07cade5370833fcf758a09ffe0db41d2a2189320
3
+ metadata.gz: 76ca864a0a22a814f45e2b8a89c8b38b73adabf72abfa772eff87e1f6d1694d8
4
+ data.tar.gz: e30fe8df989ba8d9726dc27b3db7845ddaf4ee2bd7d4a0a4456db34d61c8b399
5
5
  SHA512:
6
- metadata.gz: 075d43fa0fe5c2a52d88eda8835e645cb12efe6b5f78685db71bfb14f6b82a685ba12791f969859dabcaaae9a54db9ef09f7f956ccbfdd456f2ed38a4525175a
7
- data.tar.gz: bf007da695280d3223471a6c43356bda55a71fd48acc973b3e19f4f4e9ba70b4004a3ed9c935e8446a9880acd0cb223c284bd11fadd3792f9bf152e177e84856
6
+ metadata.gz: 634172a9f9fbe15608388aa3a440ccd8d91843abe81030a944074bc6b14cbebfa01dd42865a6647f0e5db21585b265e38cf5853626333bf59fe721c86225812f
7
+ data.tar.gz: 90c8cdc8f9a6bca8b141bbf9b7e3534cc87d17dd8922caff40523a492ae0520cf946022d585ff5d7361b1c25b42f778281846152202497c705cfc6ec93ce65a3
@@ -44,7 +44,7 @@ module ThemeHelper
44
44
  #
45
45
  # However, if one of those two situations isn't true, then this call here will throw an exception and we can
46
46
  # perform the appropriate magic to figure out where amongst the themes the partial should be rendering from.
47
- return super
47
+ super
48
48
  rescue ActionView::MissingTemplate => exception
49
49
  # The theme engine only supports `<%= render 'shared/box' ... %>` style calls to `render`.
50
50
  if options.is_a?(String)
@@ -59,25 +59,23 @@ module ThemeHelper
59
59
 
60
60
  # TODO We're hard-coding this for now, but this should probably come from the `Current` model.
61
61
  current_theme_object.directory_order.each do |theme_path|
62
- begin
63
- # Update our options from something like `shared/box` to `themes/light/box`.
64
- options = "themes/#{theme_path}/#{requested_partial}"
62
+ # Update our options from something like `shared/box` to `themes/light/box`.
63
+ options = "themes/#{theme_path}/#{requested_partial}"
65
64
 
66
- # Try rendering the partial again with the updated options.
67
- body = super
65
+ # Try rendering the partial again with the updated options.
66
+ body = super
68
67
 
69
- # 🏆 If we get this far, then we've found the actual path of the theme partial. We should cache it!
70
- $resolved_theme_partial_paths[original_options] = options
68
+ # 🏆 If we get this far, then we've found the actual path of the theme partial. We should cache it!
69
+ $resolved_theme_partial_paths[original_options] = options
71
70
 
72
- # We also need to return whatever the rendered body was.
73
- return body
71
+ # We also need to return whatever the rendered body was.
72
+ return body
74
73
 
75
- # If calling `render` with the updated options is still resulting in a missing template, we need to
76
- # keep iterating over `directory_order` to work our way up the theme stack and see if we can find the
77
- # partial there, e.g. going from `light` to `tailwind` to `base`.
78
- rescue ActionView::MissingTemplate => _
79
- next
80
- end
74
+ # If calling `render` with the updated options is still resulting in a missing template, we need to
75
+ # keep iterating over `directory_order` to work our way up the theme stack and see if we can find the
76
+ # partial there, e.g. going from `light` to `tailwind` to `base`.
77
+ rescue ActionView::MissingTemplate => _
78
+ next
81
79
  end
82
80
  end
83
81
  end
@@ -1,5 +1,3 @@
1
- require_relative "../../theme_partials"
2
-
3
1
  module BulletTrain
4
2
  module Themes
5
3
  class Engine < ::Rails::Engine
@@ -1,5 +1,5 @@
1
1
  module BulletTrain
2
2
  module Themes
3
- VERSION = "1.0.2"
3
+ VERSION = "1.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train-themes
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver