Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uninstall lru_cache and install sin_lru_redux #48

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ The `tailwind_merge` config is an object with several keys:
tailwind_merge_config = {
# ↓ *Optional* Define how many values should be stored in cache.
cache_size: 500,
# ↓ *Optional* Enable or disable caching nil values.
ignore_empty_cache: true,
# ↓ *Optional* modifier separator from Tailwind config
separator: ":",
# ↓ *Optional* prefix from Tailwind config
Expand Down
2 changes: 1 addition & 1 deletion lib/tailwind_merge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def initialize(config: {})
end

@class_utils = TailwindMerge::ClassUtils.new(@config)
@cache = LruRedux::Cache.new(@config[:cache_size])
@cache = LruRedux::Cache.new(@config[:cache_size], @config[:ignore_empty_cache])
end

def merge(classes)
Expand Down
1 change: 1 addition & 0 deletions lib/tailwind_merge/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ module Config

DEFAULTS = {
cache_size: 500,
ignore_empty_cache: true,
separator: ":",
theme: {
"colors" => [IS_ANY],
Expand Down
2 changes: 1 addition & 1 deletion lib/tailwind_merge/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module TailwindMerge
VERSION = "0.14.0"
VERSION = "0.15.0"
end
2 changes: 1 addition & 1 deletion tailwind_merge.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_dependency("lru_redux", "~> 1.1")
spec.add_dependency("sin_lru_redux", "~> 2.5")

spec.add_development_dependency("minitest", "~> 5.6")
spec.add_development_dependency("minitest-focus", "~> 1.1")
Expand Down
1 change: 1 addition & 0 deletions test/test_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ def test_default_config_has_correct_types
config = TailwindMerge::Config::DEFAULTS

assert_equal(500, config[:cache_size])
assert(config[:ignore_empty_cache])
refute(config[:nonexistent])
assert_equal("block", config[:class_groups]["display"].first)
assert_equal("auto", config[:class_groups]["overflow"].first["overflow"].first)
Expand Down
Loading