Skip to content

Commit

Permalink
Rename BucketKit (#680)
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldrapper committed Mar 16, 2024
1 parent b1049cb commit 3fda99e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
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

0 comments on commit 3fda99e

Please sign in to comment.