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

Extract c helpers #161

Merged
merged 4 commits 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,021 changes: 935 additions & 1,086 deletions lib/phlex/rails/helpers.rb

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions lib/phlex/rails/helpers/build_tag_values.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

module Phlex::Rails::Helpers::BuildTagValues
extend Phlex::Rails::HelperMacros

# @!method build_tag_values(...)
define_value_helper :build_tag_values
end
9 changes: 9 additions & 0 deletions lib/phlex/rails/helpers/button_tag.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

module Phlex::Rails::Helpers::ButtonTag
extend Phlex::Rails::HelperMacros

# @!method button_tag(...)
# @return [nil]
define_output_helper_with_capture_block :button_tag
end
9 changes: 9 additions & 0 deletions lib/phlex/rails/helpers/button_to.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

module Phlex::Rails::Helpers::ButtonTo
extend Phlex::Rails::HelperMacros

# @!method button_to(...)
# @return [nil]
define_output_helper_with_capture_block :button_to
end
9 changes: 9 additions & 0 deletions lib/phlex/rails/helpers/check_box.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

module Phlex::Rails::Helpers::CheckBox
extend Phlex::Rails::HelperMacros

# @!method check_box(...)
# @return [nil]
define_output_helper :check_box
end
9 changes: 9 additions & 0 deletions lib/phlex/rails/helpers/check_box_tag.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

module Phlex::Rails::Helpers::CheckBoxTag
extend Phlex::Rails::HelperMacros

# @!method check_box_tag(...)
# @return [nil]
define_output_helper :check_box_tag
end
5 changes: 5 additions & 0 deletions lib/phlex/rails/helpers/checkbox.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

warn "[DEPRECATION] Phlex::Rails::Helpers::Checkbox is deprecated. Please use Phlex::Rails::Helpers::CheckBox instead."

Phlex::Rails::Helpers::Checkbox = Phlex::Rails::Helpers::CheckBox
5 changes: 5 additions & 0 deletions lib/phlex/rails/helpers/checkbox_tag.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

warn "[DEPRECATION] Phlex::Rails::Helpers::CheckboxTag is deprecated. Please use Phlex::Rails::Helpers::CheckBoxTag instead."

Phlex::Rails::Helpers::CheckboxTag = Phlex::Rails::Helpers::CheckBoxTag
8 changes: 8 additions & 0 deletions lib/phlex/rails/helpers/class_names.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

module Phlex::Rails::Helpers::ClassNames
extend Phlex::Rails::HelperMacros

# @!method class_names(...)
define_value_helper :class_names
end
10 changes: 10 additions & 0 deletions lib/phlex/rails/helpers/collection_check_boxes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

module Phlex::Rails::Helpers::CollectionCheckBoxes
extend Phlex::Rails::HelperMacros

# @!method collection_check_boxes(...)
# @yield [builder]
# @yieldparam builder [Phlex::Rails::BufferedCheckboxBuilder]
define_builder_yielding_helper :collection_check_boxes, Phlex::Rails::BufferedCheckboxBuilder
end
5 changes: 5 additions & 0 deletions lib/phlex/rails/helpers/collection_checkboxes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

warn "[DEPRECATION] Phlex::Rails::Helpers::CollectionCheckboxes is deprecated. Please use Phlex::Rails::Helpers::CollectionCheckBoxes instead."

Phlex::Rails::Helpers::CollectionCheckboxes = Phlex::Rails::Helpers::CollectionCheckBoxes
10 changes: 10 additions & 0 deletions lib/phlex/rails/helpers/collection_radio_buttons.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

module Phlex::Rails::Helpers::CollectionRadioButtons
extend Phlex::Rails::HelperMacros

# @!method collection_radio_buttons(...)
# @yield [builder]
# @yieldparam builder [Phlex::Rails::BufferedRadioButtonBuilder]
define_builder_yielding_helper :collection_radio_buttons, Phlex::Rails::BufferedRadioButtonBuilder
end
9 changes: 9 additions & 0 deletions lib/phlex/rails/helpers/collection_select.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

module Phlex::Rails::Helpers::CollectionSelect
extend Phlex::Rails::HelperMacros

# @!method collection_select(...)
# @return [nil]
define_output_helper :collection_select
end
9 changes: 9 additions & 0 deletions lib/phlex/rails/helpers/color_field.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

module Phlex::Rails::Helpers::ColorField
extend Phlex::Rails::HelperMacros

# @!method color_field(...)
# @return [nil]
define_output_helper :color_field
end
9 changes: 9 additions & 0 deletions lib/phlex/rails/helpers/color_field_tag.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

module Phlex::Rails::Helpers::ColorFieldTag
extend Phlex::Rails::HelperMacros

# @!method color_field_tag(...)
# @return [nil]
define_output_helper :color_field_tag
end
8 changes: 8 additions & 0 deletions lib/phlex/rails/helpers/compute_asset_extname.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

module Phlex::Rails::Helpers::ComputeAssetExtname
extend Phlex::Rails::HelperMacros

# @!method compute_asset_extname(...)
define_value_helper :compute_asset_extname
end
8 changes: 8 additions & 0 deletions lib/phlex/rails/helpers/compute_asset_host.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

module Phlex::Rails::Helpers::ComputeAssetHost
extend Phlex::Rails::HelperMacros

# @!method compute_asset_host(...)
define_value_helper :compute_asset_host
end
8 changes: 8 additions & 0 deletions lib/phlex/rails/helpers/compute_asset_path.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

module Phlex::Rails::Helpers::ComputeAssetPath
extend Phlex::Rails::HelperMacros

# @!method compute_asset_path(...)
define_value_helper :compute_asset_path
end
11 changes: 11 additions & 0 deletions lib/phlex/rails/helpers/content_for.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

module Phlex::Rails::Helpers::ContentFor
extend Phlex::Rails::HelperMacros

# @!method content_for?(...)
define_value_helper :content_for?

# @!method content_for(...)
define_value_helper_with_capture_block :content_for
end
9 changes: 9 additions & 0 deletions lib/phlex/rails/helpers/content_tag.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

module Phlex::Rails::Helpers::ContentTag
extend Phlex::Rails::HelperMacros

# @!method content_tag(...)
# @return [nil]
define_output_helper_with_capture_block :content_tag
end
8 changes: 8 additions & 0 deletions lib/phlex/rails/helpers/controller_name.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

module Phlex::Rails::Helpers::ControllerName
extend Phlex::Rails::HelperMacros

# @!method controller_name(...)
define_value_helper :controller_name
end
8 changes: 8 additions & 0 deletions lib/phlex/rails/helpers/controller_path.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

module Phlex::Rails::Helpers::ControllerPath
extend Phlex::Rails::HelperMacros

# @!method controller_path(...)
define_value_helper :controller_path
end
9 changes: 9 additions & 0 deletions lib/phlex/rails/helpers/csp_meta_tag.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

module Phlex::Rails::Helpers::CSPMetaTag
extend Phlex::Rails::HelperMacros

# @!method csp_meta_tag(...)
# @return [nil]
define_output_helper :csp_meta_tag
end
9 changes: 9 additions & 0 deletions lib/phlex/rails/helpers/csrf_meta_tags.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

module Phlex::Rails::Helpers::CSRFMetaTags
extend Phlex::Rails::HelperMacros

# @!method csrf_meta_tags(...)
# @return [nil]
define_output_helper :csrf_meta_tags
end
8 changes: 8 additions & 0 deletions lib/phlex/rails/helpers/current_cycle.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

module Phlex::Rails::Helpers::CurrentCycle
extend Phlex::Rails::HelperMacros

# @!method current_cycle(...)
define_value_helper :current_cycle
end
8 changes: 8 additions & 0 deletions lib/phlex/rails/helpers/current_page.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

module Phlex::Rails::Helpers::CurrentPage
extend Phlex::Rails::HelperMacros

# @!method current_page?(...)
define_value_helper :current_page?
end
8 changes: 8 additions & 0 deletions lib/phlex/rails/helpers/cycle.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

module Phlex::Rails::Helpers::Cycle
extend Phlex::Rails::HelperMacros

# @!method cycle(...)
define_value_helper :cycle
end