Skip to content

Commit

Permalink
Pin CI to non-broken rails main (ViewComponent#1429)
Browse files Browse the repository at this point in the history
* Pin CI to non-broken rails main

rails/rails#45614 broke
our Global Output Buffer

* I don't know why standard failed here but 🤷

* add changelog
  • Loading branch information
joelhawksley authored and claudiob committed Dec 22, 2023
1 parent 1b8066a commit 1252eb8
Show file tree
Hide file tree
Showing 7 changed files with 121 additions and 99 deletions.
7 changes: 6 additions & 1 deletion Gemfile
Expand Up @@ -6,7 +6,12 @@ gemspec
rails_version = (ENV["RAILS_VERSION"] || "~> 7.0.0").to_s

gem "capybara", "~> 3"
gem "rails", rails_version == "main" ? {git: "https://github.com/rails/rails", ref: "main"} : rails_version

# https://github.com/rails/rails/pull/45614 broke our global output buffer
# code, which we plan to remove anyways. Pinning to before it was merged
# so CI will work.
gem "rails", rails_version == "main" ? {git: "https://github.com/rails/rails", ref: "71c59c69f40cef908d0a97ef4b4c5496778559e5"} : rails_version

gem "rspec-rails", "~> 5"

if RUBY_VERSION >= "3.1"
Expand Down
197 changes: 105 additions & 92 deletions Gemfile.lock
@@ -1,78 +1,107 @@
PATH
remote: .
specs:
view_component (2.61.0)
activesupport (>= 5.0.0, < 8.0)
method_source (~> 1.0)

GEM
remote: https://rubygems.org/
GIT
remote: https://github.com/rails/rails
revision: 71c59c69f40cef908d0a97ef4b4c5496778559e5
ref: 71c59c69f40cef908d0a97ef4b4c5496778559e5
specs:
actioncable (7.0.3)
actionpack (= 7.0.3)
activesupport (= 7.0.3)
actioncable (7.1.0.alpha)
actionpack (= 7.1.0.alpha)
activesupport (= 7.1.0.alpha)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.3)
actionpack (= 7.0.3)
activejob (= 7.0.3)
activerecord (= 7.0.3)
activestorage (= 7.0.3)
activesupport (= 7.0.3)
zeitwerk (~> 2.6)
actionmailbox (7.1.0.alpha)
actionpack (= 7.1.0.alpha)
activejob (= 7.1.0.alpha)
activerecord (= 7.1.0.alpha)
activestorage (= 7.1.0.alpha)
activesupport (= 7.1.0.alpha)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.3)
actionpack (= 7.0.3)
actionview (= 7.0.3)
activejob (= 7.0.3)
activesupport (= 7.0.3)
actionmailer (7.1.0.alpha)
actionpack (= 7.1.0.alpha)
actionview (= 7.1.0.alpha)
activejob (= 7.1.0.alpha)
activesupport (= 7.1.0.alpha)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.3)
actionview (= 7.0.3)
activesupport (= 7.0.3)
actionpack (7.1.0.alpha)
actionview (= 7.1.0.alpha)
activesupport (= 7.1.0.alpha)
rack (~> 2.0, >= 2.2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.3)
actionpack (= 7.0.3)
activerecord (= 7.0.3)
activestorage (= 7.0.3)
activesupport (= 7.0.3)
actiontext (7.1.0.alpha)
actionpack (= 7.1.0.alpha)
activerecord (= 7.1.0.alpha)
activestorage (= 7.1.0.alpha)
activesupport (= 7.1.0.alpha)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.3)
activesupport (= 7.0.3)
actionview (7.1.0.alpha)
activesupport (= 7.1.0.alpha)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (7.0.3)
activesupport (= 7.0.3)
activejob (7.1.0.alpha)
activesupport (= 7.1.0.alpha)
globalid (>= 0.3.6)
activemodel (7.0.3)
activesupport (= 7.0.3)
activerecord (7.0.3)
activemodel (= 7.0.3)
activesupport (= 7.0.3)
activestorage (7.0.3)
actionpack (= 7.0.3)
activejob (= 7.0.3)
activerecord (= 7.0.3)
activesupport (= 7.0.3)
activemodel (7.1.0.alpha)
activesupport (= 7.1.0.alpha)
activerecord (7.1.0.alpha)
activemodel (= 7.1.0.alpha)
activesupport (= 7.1.0.alpha)
activestorage (7.1.0.alpha)
actionpack (= 7.1.0.alpha)
activejob (= 7.1.0.alpha)
activerecord (= 7.1.0.alpha)
activesupport (= 7.1.0.alpha)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.3)
activesupport (7.1.0.alpha)
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
rails (7.1.0.alpha)
actioncable (= 7.1.0.alpha)
actionmailbox (= 7.1.0.alpha)
actionmailer (= 7.1.0.alpha)
actionpack (= 7.1.0.alpha)
actiontext (= 7.1.0.alpha)
actionview (= 7.1.0.alpha)
activejob (= 7.1.0.alpha)
activemodel (= 7.1.0.alpha)
activerecord (= 7.1.0.alpha)
activestorage (= 7.1.0.alpha)
activesupport (= 7.1.0.alpha)
bundler (>= 1.15.0)
railties (= 7.1.0.alpha)
railties (7.1.0.alpha)
actionpack (= 7.1.0.alpha)
activesupport (= 7.1.0.alpha)
method_source
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.6)

PATH
remote: .
specs:
view_component (2.61.0)
activesupport (>= 5.0.0, < 8.0)
method_source (~> 1.0)

GEM
remote: https://rubygems.org/
specs:
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
ansi (1.5.0)
Expand Down Expand Up @@ -102,6 +131,7 @@ GEM
xpath (~> 3.2)
coderay (1.1.3)
concurrent-ruby (1.1.10)
connection_pool (2.2.5)
crass (1.0.6)
diff-lcs (1.5.0)
digest (3.1.0)
Expand All @@ -121,11 +151,12 @@ GEM
temple (>= 0.8.0)
tilt
html_tokenizer (0.0.7)
i18n (1.10.0)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
jbuilder (2.11.5)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
json (2.6.2)
loofah (2.18.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
Expand All @@ -135,7 +166,7 @@ GEM
matrix (0.4.2)
method_source (1.0.0)
mini_mime (1.1.2)
mini_portile2 (2.4.0)
mini_portile2 (2.8.0)
minitest (5.6.0)
net-imap (0.2.3)
digest
Expand All @@ -152,47 +183,28 @@ GEM
net-protocol
timeout
nio4r (2.5.8)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
nokogiri (1.13.7)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
parallel (1.22.1)
parser (3.1.2.0)
ast (~> 2.4.1)
pry (0.14.1)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (4.0.7)
rack (2.2.3.1)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (7.0.3)
actioncable (= 7.0.3)
actionmailbox (= 7.0.3)
actionmailer (= 7.0.3)
actionpack (= 7.0.3)
actiontext (= 7.0.3)
actionview (= 7.0.3)
activejob (= 7.0.3)
activemodel (= 7.0.3)
activerecord (= 7.0.3)
activestorage (= 7.0.3)
activesupport (= 7.0.3)
bundler (>= 1.15.0)
railties (= 7.0.3)
racc (1.6.0)
rack (2.2.4)
rack-test (2.0.2)
rack (>= 1.3)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.4.3)
loofah (~> 2.3)
railties (7.0.3)
actionpack (= 7.0.3)
activesupport (= 7.0.3)
method_source
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.4.0)
regexp_parser (2.5.0)
rexml (3.2.5)
rspec-core (3.11.0)
rspec-support (~> 3.11.0)
Expand All @@ -211,18 +223,19 @@ GEM
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
rspec-support (3.11.0)
rubocop (1.13.0)
rubocop (1.31.2)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.0.0.0)
parser (>= 3.1.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.2.0, < 2.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.18.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.17.0)
rubocop-ast (1.19.1)
parser (>= 3.1.1.0)
rubocop-performance (1.11.1)
rubocop-performance (1.14.3)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
ruby-progressbar (1.11.0)
Expand All @@ -238,37 +251,37 @@ GEM
temple (>= 0.7.6, < 0.9)
tilt (>= 2.0.6, < 2.1)
smart_properties (1.17.0)
sprockets (4.0.3)
sprockets (4.1.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.2)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
standard (1.1.0)
rubocop (= 1.13.0)
rubocop-performance (= 1.11.1)
strscan (3.0.2)
standard (1.13.0)
rubocop (= 1.31.2)
rubocop-performance (= 1.14.3)
strscan (3.0.3)
temple (0.8.2)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
thor (1.2.1)
tilt (2.0.10)
timeout (0.2.0)
tzinfo (2.0.4)
timeout (0.3.0)
tzinfo (2.0.5)
concurrent-ruby (~> 1.0)
unicode-display_width (2.1.0)
unicode-display_width (2.2.0)
webrick (1.7.0)
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
yard (0.9.27)
yard (0.9.28)
webrick (~> 1.7.0)
yard-activesupport-concern (0.0.1)
yard (>= 0.8)
zeitwerk (2.5.4)
zeitwerk (2.6.0)

PLATFORMS
ruby
Expand All @@ -284,7 +297,7 @@ DEPENDENCIES
jbuilder (~> 2)
minitest (= 5.6.0)
pry (~> 0.13)
rails (~> 7.0.0)
rails!
rake (~> 13.0)
rspec-rails (~> 5)
simplecov (~> 0.18.0)
Expand Down
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Expand Up @@ -9,6 +9,10 @@ title: Changelog

## main

* Pin `rails` `main` dependency due to incompatibility with Global Output Buffer.

*Joel Hawksley*

## 2.61.0

* Ensure side-effects in `content` are consistently evaluated before components are rendered. This change effectively means that `content` is evaluated for every component render where `render?` returns true. As a result, code that is passed to a component via a block/content will now always be evaluated, before `#call`, which can reveal bugs in existing components.
Expand Down
4 changes: 2 additions & 2 deletions lib/view_component/polymorphic_slots.rb
Expand Up @@ -10,7 +10,7 @@ def self.included(base)
location = Kernel.caller_locations(1, 1)[0]

warn(
"warning: ViewComponent::PolymorphicSlots is now included in ViewComponent::Base by default "\
"warning: ViewComponent::PolymorphicSlots is now included in ViewComponent::Base by default " \
"and can be removed from #{location.path}:#{location.lineno}"
)
# :nocov:
Expand Down Expand Up @@ -58,7 +58,7 @@ def register_polymorphic_slot(slot_name, types, collection:)

define_method(setter_name) do |*args, &block|
ViewComponent::Deprecation.warn(
"polymorphic slot setters like `#{setter_name}` are deprecated and will be removed in"\
"polymorphic slot setters like `#{setter_name}` are deprecated and will be removed in" \
"ViewComponent v3.0.0.\n\nUse `with_#{setter_name}` instead."
)

Expand Down
4 changes: 2 additions & 2 deletions lib/view_component/slotable_v2.rb
Expand Up @@ -266,8 +266,8 @@ def raise_if_slot_registered(slot_name)
def raise_if_slot_ends_with_question_mark(slot_name)
if slot_name.to_s.ends_with?("?")
raise ArgumentError.new(
"#{self} declares a slot named #{slot_name}, which ends with a question mark.\n\n"\
"This is not allowed because the ViewComponent framework already provides predicate "\
"#{self} declares a slot named #{slot_name}, which ends with a question mark.\n\n" \
"This is not allowed because the ViewComponent framework already provides predicate " \
"methods ending in `?`.\n\n" \
"To fix this issue, choose a different name."
)
Expand Down
2 changes: 1 addition & 1 deletion test/sandbox/test/rendering_test.rb
Expand Up @@ -759,7 +759,7 @@ def test_collection_component_missing_custom_parameter_name_with_activemodel
end

assert_match(
"The initializer for MissingCollectionParameterWithActiveModelComponent doesn't accept the parameter `name`, "\
"The initializer for MissingCollectionParameterWithActiveModelComponent doesn't accept the parameter `name`, " \
"which is required in order to render it as a collection.\n\n" \
"To fix this issue, update the initializer to accept `name`.\n\n" \
"See https://viewcomponent.org/guide/collections.html for more information on rendering collections.",
Expand Down
2 changes: 1 addition & 1 deletion test/sandbox/test/translatable_test.rb
Expand Up @@ -61,7 +61,7 @@ def test_translate_marks_translations_with_a_html_suffix_as_safe_html
def test_translate_with_html_suffix_escapes_interpolated_arguments
translation = translate(".interpolated_html", horse_count: "<script type='text/javascript'>alert('foo');</script>")
assert_equal(
"There are &lt;script type=&#39;text/javascript&#39;&gt;alert(&#39;foo&#39;);&lt;/script&gt; horses in the "\
"There are &lt;script type=&#39;text/javascript&#39;&gt;alert(&#39;foo&#39;);&lt;/script&gt; horses in the " \
"<strong>barn</strong>!",
translation
)
Expand Down

0 comments on commit 1252eb8

Please sign in to comment.