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

Rename BucketKit #680

Merged
merged 1 commit into from
Mar 16, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion fixtures/components.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

module Components
extend Phlex::Bucket
extend Phlex::Kit

autoload :SayHi, "components/say_hi"
end
2 changes: 1 addition & 1 deletion lib/phlex.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module Phlex
autoload :BlackHole, "phlex/black_hole"
autoload :CSV, "phlex/csv"
autoload :Callable, "phlex/callable"
autoload :Bucket, "phlex/bucket"
autoload :Kit, "phlex/kit"

# Included in all Phlex exceptions allowing you to match any Phlex error.
# @example Rescue any Phlex error:
Expand Down
4 changes: 2 additions & 2 deletions lib/phlex/bucket.rb → lib/phlex/kit.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# frozen_string_literal: true

module Phlex::Bucket
module Phlex::Kit
def self.extended(mod)
warn "🚨 [WARNING] Phlex::Bucket is experimental and may be removed from future versions of Phlex."
super
end

# When a bucket is included in a module, we need to load all of its components.
# When a kit is included in a module, we need to load all of its components.
def included(mod)
constants.each { |c| mod.const_get(c) if autoload?(c) }
super
Expand Down
2 changes: 1 addition & 1 deletion test/phlex/bucket.rb → test/phlex/kit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def template

# This feature is only supported in Ruby 3.2 or later.
if RUBY_VERSION >= "3.2"
describe Phlex::Bucket do
describe Phlex::Kit do
it "defines methods for its components" do
expect(Example.new.call).to be == %(<article><h1>Hi Joel</h1><h1>Hi Joel</h1>Inside</article><article><h1>Hi Will</h1>Inside</article>)
end
Expand Down