Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
PauloMiranda98 authored Sep 4, 2023
2 parents b786bf1 + 1d0cebb commit bfd375e
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 98 deletions.
194 changes: 101 additions & 93 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
GIT
remote: https://github.com/thoughtbot/appraisal.git
revision: b200e636903700098bef25f4f51dbc4c46e4c04c
revision: feb78bcc6177038399bff098cb6c2bd4bca4972a
branch: main
specs:
appraisal (2.4.1)
appraisal (2.5.0)
bundler
rake
thor (>= 0.14.0)
Expand All @@ -27,76 +27,77 @@ PATH
GEM
remote: https://rubygems.org/
specs:
actioncable (7.0.5)
actionpack (= 7.0.5)
activesupport (= 7.0.5)
actioncable (7.0.7.2)
actionpack (= 7.0.7.2)
activesupport (= 7.0.7.2)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.5)
actionpack (= 7.0.5)
activejob (= 7.0.5)
activerecord (= 7.0.5)
activestorage (= 7.0.5)
activesupport (= 7.0.5)
actionmailbox (7.0.7.2)
actionpack (= 7.0.7.2)
activejob (= 7.0.7.2)
activerecord (= 7.0.7.2)
activestorage (= 7.0.7.2)
activesupport (= 7.0.7.2)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.5)
actionpack (= 7.0.5)
actionview (= 7.0.5)
activejob (= 7.0.5)
activesupport (= 7.0.5)
actionmailer (7.0.7.2)
actionpack (= 7.0.7.2)
actionview (= 7.0.7.2)
activejob (= 7.0.7.2)
activesupport (= 7.0.7.2)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.5)
actionview (= 7.0.5)
activesupport (= 7.0.5)
actionpack (7.0.7.2)
actionview (= 7.0.7.2)
activesupport (= 7.0.7.2)
rack (~> 2.0, >= 2.2.4)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.5)
actionpack (= 7.0.5)
activerecord (= 7.0.5)
activestorage (= 7.0.5)
activesupport (= 7.0.5)
actiontext (7.0.7.2)
actionpack (= 7.0.7.2)
activerecord (= 7.0.7.2)
activestorage (= 7.0.7.2)
activesupport (= 7.0.7.2)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.5)
activesupport (= 7.0.5)
actionview (7.0.7.2)
activesupport (= 7.0.7.2)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (7.0.5)
activesupport (= 7.0.5)
activejob (7.0.7.2)
activesupport (= 7.0.7.2)
globalid (>= 0.3.6)
activemodel (7.0.5)
activesupport (= 7.0.5)
activerecord (7.0.5)
activemodel (= 7.0.5)
activesupport (= 7.0.5)
activestorage (7.0.5)
actionpack (= 7.0.5)
activejob (= 7.0.5)
activerecord (= 7.0.5)
activesupport (= 7.0.5)
activemodel (7.0.7.2)
activesupport (= 7.0.7.2)
activerecord (7.0.7.2)
activemodel (= 7.0.7.2)
activesupport (= 7.0.7.2)
activestorage (7.0.7.2)
actionpack (= 7.0.7.2)
activejob (= 7.0.7.2)
activerecord (= 7.0.7.2)
activesupport (= 7.0.7.2)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.5)
activesupport (7.0.7.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
addressable (2.8.4)
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
ast (2.4.2)
base64 (0.1.1)
builder (3.2.4)
capybara (3.39.1)
capybara (3.39.2)
addressable
matrix
mini_mime (>= 0.1.3)
Expand All @@ -112,10 +113,10 @@ GEM
thor (>= 0.14.6)
concurrent-ruby (1.2.2)
crass (1.0.6)
css_parser (1.14.0)
css_parser (1.15.0)
addressable
date (3.3.3)
erb (4.0.2)
erb (4.0.3)
cgi (>= 0.3.3)
erubi (1.12.0)
factory_bot (6.2.1)
Expand All @@ -124,11 +125,11 @@ GEM
activesupport (>= 5.0)
htmlbeautifier (1.4.2)
htmlentities (4.3.4)
i18n (1.14.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
json (2.6.3)
language_server-protocol (3.17.0.3)
lint_roller (1.0.0)
lint_roller (1.1.0)
loofah (2.21.3)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
Expand All @@ -140,9 +141,10 @@ GEM
marcel (1.0.2)
matrix (0.4.2)
method_source (1.0.0)
mini_mime (1.1.2)
minitest (5.18.0)
net-imap (0.3.4)
mini_mime (1.1.5)
mini_portile2 (2.8.4)
minitest (5.19.0)
net-imap (0.3.7)
date
net-protocol
net-pop (0.1.2)
Expand All @@ -152,13 +154,15 @@ GEM
net-smtp (0.3.3)
net-protocol
nio4r (2.5.9)
nokogiri (1.15.2-arm64-darwin)
nokogiri (1.15.4)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.15.2-x86_64-linux)
nokogiri (1.15.4-arm64-darwin)
racc (~> 1.4)
parallel (1.23.0)
parser (3.2.2.1)
parser (3.2.2.3)
ast (~> 2.4.1)
racc
phlex (1.8.1)
concurrent-ruby (~> 1.2)
erb (>= 4)
Expand All @@ -167,59 +171,62 @@ GEM
phlex (~> 1.7)
rails (>= 6.1, < 8)
zeitwerk (~> 2.6)
public_suffix (5.0.1)
puma (6.3.0)
public_suffix (5.0.3)
puma (6.3.1)
nio4r (~> 2.0)
racc (1.6.2)
rack (2.2.7)
racc (1.7.1)
rack (2.2.8)
rack-test (2.1.0)
rack (>= 1.3)
rails (7.0.5)
actioncable (= 7.0.5)
actionmailbox (= 7.0.5)
actionmailer (= 7.0.5)
actionpack (= 7.0.5)
actiontext (= 7.0.5)
actionview (= 7.0.5)
activejob (= 7.0.5)
activemodel (= 7.0.5)
activerecord (= 7.0.5)
activestorage (= 7.0.5)
activesupport (= 7.0.5)
rails (7.0.7.2)
actioncable (= 7.0.7.2)
actionmailbox (= 7.0.7.2)
actionmailer (= 7.0.7.2)
actionpack (= 7.0.7.2)
actiontext (= 7.0.7.2)
actionview (= 7.0.7.2)
activejob (= 7.0.7.2)
activemodel (= 7.0.7.2)
activerecord (= 7.0.7.2)
activestorage (= 7.0.7.2)
activesupport (= 7.0.7.2)
bundler (>= 1.15.0)
railties (= 7.0.5)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
railties (= 7.0.7.2)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.0.5)
actionpack (= 7.0.5)
activesupport (= 7.0.5)
railties (7.0.7.2)
actionpack (= 7.0.7.2)
activesupport (= 7.0.7.2)
method_source
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
rainbow (3.1.1)
rake (13.0.6)
redcarpet (3.6.0)
regexp_parser (2.8.0)
rexml (3.2.5)
rouge (4.1.2)
rubocop (1.52.0)
regexp_parser (2.8.1)
rexml (3.2.6)
rouge (4.1.3)
rubocop (1.56.2)
base64 (~> 0.1.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.0.0)
parser (>= 3.2.2.3)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.0, < 2.0)
rubocop-ast (>= 1.28.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0)
parser (>= 3.2.1.0)
rubocop-performance (1.18.0)
rubocop-performance (1.19.0)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
ruby-progressbar (1.13.0)
Expand All @@ -228,40 +235,41 @@ GEM
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
standard (1.29.0)
standard (1.31.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.52.0)
rubocop (~> 1.56.0)
standard-custom (~> 1.0.0)
standard-performance (~> 1.1.0)
standard-custom (1.0.0)
lint_roller (~> 1.0)
standard-performance (1.1.0)
standard-performance (~> 1.2)
standard-custom (1.0.2)
lint_roller (~> 1.0)
rubocop-performance (~> 1.18.0)
rubocop (~> 1.50)
standard-performance (1.2.0)
lint_roller (~> 1.1)
rubocop-performance (~> 1.19.0)
thor (1.2.2)
timeout (0.3.2)
timeout (0.4.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.4.2)
view_component (3.1.0)
view_component (3.5.0)
activesupport (>= 5.2.0, < 8.0)
concurrent-ruby (~> 1.0)
method_source (~> 1.0)
websocket (1.2.9)
websocket-driver (0.7.5)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
yard (0.9.34)
yard-activesupport-concern (0.0.1)
yard (>= 0.8)
zeitwerk (2.6.8)
zeitwerk (2.6.11)

PLATFORMS
arm64-darwin-22
x86_64-linux
ruby

DEPENDENCIES
appraisal!
Expand All @@ -278,4 +286,4 @@ DEPENDENCIES
yard-activesupport-concern

BUNDLED WITH
2.4.7
2.4.19
9 changes: 8 additions & 1 deletion app/components/lookbook/tag_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ def call
end

def self.escape_attribute_key
@escape_attribute_key ||= (Gem::Version.new(Rails.version) < Gem::Version.new("6.1.5.1")) ? :escape_attributes : :escape
@escape_attribute_key ||= (
(
Gem::Version.new(Rails.version) < Gem::Version.new("5.2.7.1")
) || (
Gem::Version.new(Rails.version) >= Gem::Version.new("6") &&
Gem::Version.new(Rails.version) < Gem::Version.new("6.1.5.1")
)
) ? :escape_attributes : :escape
end
end
end
4 changes: 2 additions & 2 deletions docs/src/_data/config_options.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,10 @@ debugging:
system:
- name: reload_on_change
types: Boolean
default: "config.reload_classes_only_on_change"
default: "!config.cache_classes && config.reload_classes_only_on_change"
example: config.lookbook.reload_on_change = true
description: |
By default Lookbook uses the value of the `reload_classes_only_on_change` Rails config option to decide if
By default Lookbook uses the value of the `cache_classes` and `reload_classes_only_on_change` Rails config options to decide if
it should attempt to update the preview data after changes. If set the value of this config option will take precedence and be used instead.
- name: live_updates
Expand Down
4 changes: 3 additions & 1 deletion lib/lookbook/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ class Engine < Rails::Engine
ViewComponent::Preview.extend(Lookbook::PreviewAfterRender)
end

opts.reload_on_change = host_config.reload_classes_only_on_change if opts.reload_on_change.nil?
if opts.reload_on_change.nil?
opts.reload_on_change = !host_config.cache_classes && host_config.reload_classes_only_on_change
end
end

config.after_initialize do
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/previews_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
it "doesn't beautify HTML in the preview" do
get lookbook_preview_path("whitespace_significant/default")

expect(response.parsed_body.to_s.include?("<div>one</div><div>two</div><div>three</div>")).to be true
expect(response.body.include?("<div>one</div><div>two</div><div>three</div>")).to be true
end

context "ViewComponents" do
Expand Down

0 comments on commit bfd375e

Please sign in to comment.