tailwind_theme-rails 0.1.1 → 0.1.2

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: 81918734df2afa400433d070a33e054a7ecff27278ed8cb332a5d0d5b5ad6ff3
4
- data.tar.gz: 49e9fe555c24497dfa90cf99e4273f4dea35e159a49f3b034bde5887cd0e78e5
3
+ metadata.gz: 18191fa8841941cdc327577d881f84df3ca83ee896d17974a37fed3400c52544
4
+ data.tar.gz: e1f175bf51411ef809522e71ce34400f1a8305b2c8dcd5d73b402abf264faf96
5
5
  SHA512:
6
- metadata.gz: e3658df7908d3cdd4904a7ae09da72bb3a6417d629f5db329a0ceeebb175378429422e87de7ff10d6f9007b0a6491b0c33d29dd847891cc4d764a83fea32544f
7
- data.tar.gz: 016f4f1e791243164e404d1cf803849137bdd0be245828415589df9a08fa8c3fbe673e75de7cdbb99a61f82ead4180dc455c5bebcfa5c084ee5bc9c94c4a95b5
6
+ metadata.gz: ed16d1b3b95e90a6a4e7088e6723f10f596415296ffa9118252a66ff153ce66db95466bbe4dc3eac5f194dbcbded7019c42887dedd7d431b604ea0bd25000a73
7
+ data.tar.gz: eb65340148626e7c1183248a78184e9686717c06af3f76fb1ce6ed2c28b9a1ec983f92d92986b86536968256b88719c1a0b720a2eb95e1e3c52e042907f1200e
@@ -8,7 +8,7 @@ module TailwindTheme
8
8
  extend ActiveSupport::Concern
9
9
 
10
10
  included do
11
- class_attribute :_theme # :nodoc:
11
+ class_attribute :_theme, default: :default # :nodoc:
12
12
 
13
13
  # Add the helper method for the views
14
14
  helper_method :theme
@@ -23,13 +23,16 @@ module TailwindTheme
23
23
  #
24
24
  # See the [Factory](#Factory) class for more details
25
25
  def theme(name)
26
- self._theme = name
26
+ self._theme = name.presence || :default
27
27
  end
28
28
  end
29
29
 
30
30
  # The specified TailwindTheme for the controller
31
- def theme
32
- theme_factory.theme self.class._theme
31
+ # @param [String, Symbol, NilClass] name the name of the theme to use. Defaults to the theme set by the `theme`
32
+ # class method.
33
+ # @return [TailwindTheme::Theme, NilClass] returns the specified theme or Nil if the theme is not defined.
34
+ def theme(name = nil)
35
+ theme_factory.theme(name.presence || self.class._theme)
33
36
  end
34
37
 
35
38
  private
@@ -1,5 +1,5 @@
1
1
  module TailwindTheme
2
2
  module Rails
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
@@ -13,4 +13,6 @@ module TailwindTheme
13
13
  def self.load_paths
14
14
  @@load_paths ||= [::Rails.root.join("config")]
15
15
  end
16
- end
16
+
17
+ ActiveSupport.run_load_hooks :tailwind_theme, self
18
+ end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tailwind_theme-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Fawks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-29 00:00:00.000000000 Z
11
+ date: 2024-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tailwind_theme
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: '0.1'
19
+ version: 0.1.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: '0.1'
26
+ version: 0.1.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: railties
29
29
  requirement: !ruby/object:Gem::Requirement