Skip to content

Commit

Permalink
Rename textplain (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoroth authored Apr 22, 2023
1 parent 5cb7c95 commit b619ce4
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 58 deletions.
2 changes: 1 addition & 1 deletion gem/lib/phlexing/template_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def call(source)
end

def handle_text_output(text)
output("text", text)
output("plain", text)
end

def handle_html_comment_output(text)
Expand Down
4 changes: 2 additions & 2 deletions gem/test/phlexing/converter/blocks_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Phlexing::Converter::BlocksTest < Minitest::Spec
html = %(<%= tag.div do %>Content<% end %>)

expected = <<~PHLEX.strip
tag.div { text "Content" }
tag.div { plain "Content" }
PHLEX

assert_phlex_template expected, html do
Expand All @@ -31,7 +31,7 @@ class Phlexing::Converter::BlocksTest < Minitest::Spec
html = %(<%= tag.div do %><%= content %><% end %>)

expected = <<~PHLEX.strip
tag.div { text content }
tag.div { plain content }
PHLEX

assert_phlex_template expected, html do
Expand Down
2 changes: 1 addition & 1 deletion gem/test/phlexing/converter/custom_elements_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Component < Phlex::HTML
def template
my_custom do
text "Hello"
plain "Hello"
another_custom { "World" }
end
end
Expand Down
20 changes: 10 additions & 10 deletions gem/test/phlexing/converter/erb_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ class Phlexing::Converter::ErbTest < Minitest::Spec

expected = <<~PHLEX.strip
div do
text "\#{some_method}_text"
text " More Text"
plain "\#{some_method}_text"
plain " More Text"
end
PHLEX

Expand Down Expand Up @@ -162,7 +162,7 @@ class Phlexing::Converter::ErbTest < Minitest::Spec

expected = <<~PHLEX.strip
div do # The Next line has text on it
text " More Text"
plain " More Text"
end
PHLEX

Expand All @@ -185,7 +185,7 @@ class Phlexing::Converter::ErbTest < Minitest::Spec
expected = <<~PHLEX.strip
div do
unsafe_raw "<p>Some safe HTML</p>"
text some_method
plain some_method
span { "Text" }
end
PHLEX
Expand All @@ -201,7 +201,7 @@ class Phlexing::Converter::ErbTest < Minitest::Spec
expected = <<~PHLEX.strip
div do
unsafe_raw "<p>Some safe HTML</p>"
text "Another output"
plain "Another output"
end
PHLEX

Expand All @@ -219,8 +219,8 @@ class Phlexing::Converter::ErbTest < Minitest::Spec
expected = <<~PHLEX.strip
@greeting =
capture do
text " Welcome to my shiny new web page! The date and time is "
text Time.now
plain " Welcome to my shiny new web page! The date and time is "
plain Time.now
end
PHLEX

Expand All @@ -236,9 +236,9 @@ class Phlexing::Converter::ErbTest < Minitest::Spec

expected = <<~PHLEX.strip
div do
text "Text"
text "ERB Text"
text "#{'interpolate'} text"
plain "Text"
plain "ERB Text"
plain "#{'interpolate'} text"
end
PHLEX

Expand Down
52 changes: 26 additions & 26 deletions gem/test/phlexing/converter/rails_helpers_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Phlexing::Converter::RailsHelpersTest < Minitest::Spec
html = %(<%= tag.div do %>Content<% end %>)

expected = <<~PHLEX.strip
tag.div { text "Content" }
tag.div { plain "Content" }
PHLEX

assert_phlex_template expected, html do
Expand All @@ -19,7 +19,7 @@ class Phlexing::Converter::RailsHelpersTest < Minitest::Spec
html = %(<%= tag.div do %><%= content %><% end %>)

expected = <<~PHLEX.strip
tag.div { text content }
tag.div { plain content }
PHLEX

assert_phlex_template expected, html do
Expand All @@ -33,7 +33,7 @@ class Phlexing::Converter::RailsHelpersTest < Minitest::Spec

expected = <<~PHLEX.strip
content_tag :div do
text "Content"
plain "Content"
end
PHLEX

Expand All @@ -47,7 +47,7 @@ class Phlexing::Converter::RailsHelpersTest < Minitest::Spec

expected = <<~PHLEX.strip
content_tag :div, class: "container", data: { controller: "content" } do
text "Content"
plain "Content"
end
PHLEX

Expand All @@ -61,7 +61,7 @@ class Phlexing::Converter::RailsHelpersTest < Minitest::Spec

expected = <<~PHLEX.strip
content_tag :div do
text content
plain content
end
PHLEX

Expand All @@ -76,7 +76,7 @@ class Phlexing::Converter::RailsHelpersTest < Minitest::Spec

expected = <<~PHLEX.strip
content_tag :div do
text content
plain content
end
PHLEX

Expand All @@ -91,7 +91,7 @@ class Phlexing::Converter::RailsHelpersTest < Minitest::Spec

expected = <<~PHLEX.strip
form_for :article, @article do |f|
text f.blah
plain f.blah
end
PHLEX

Expand All @@ -106,7 +106,7 @@ class Phlexing::Converter::RailsHelpersTest < Minitest::Spec

expected = <<~PHLEX.strip
form_with :article, @article do |f|
text f.blah
plain f.blah
end
PHLEX

Expand All @@ -122,7 +122,7 @@ class Phlexing::Converter::RailsHelpersTest < Minitest::Spec
expected = <<~PHLEX.strip
image_tag image_path("/asset")
text "Text"
plain "Text"
PHLEX

assert_phlex_template expected, html do
Expand All @@ -136,7 +136,7 @@ class Phlexing::Converter::RailsHelpersTest < Minitest::Spec
expected = <<~PHLEX.strip
check_box_tag(:pet_dog)
text "Text"
plain "Text"
PHLEX

assert_phlex_template expected, html do
Expand All @@ -150,7 +150,7 @@ class Phlexing::Converter::RailsHelpersTest < Minitest::Spec
expected = <<~PHLEX.strip
text_field(:person, :name)
text "Text"
plain "Text"
PHLEX

assert_phlex_template expected, html do
Expand All @@ -164,7 +164,7 @@ class Phlexing::Converter::RailsHelpersTest < Minitest::Spec
expected = <<~PHLEX.strip
options_for_select([["Lisbon", 1], ["Madrid", 2]])
text "Text"
plain "Text"
PHLEX

assert_phlex_template expected, html do
Expand All @@ -178,7 +178,7 @@ class Phlexing::Converter::RailsHelpersTest < Minitest::Spec
expected = <<~PHLEX.strip
collection_select([])
text "Text"
plain "Text"
PHLEX

assert_phlex_template expected, html do
Expand All @@ -192,7 +192,7 @@ class Phlexing::Converter::RailsHelpersTest < Minitest::Spec
expected = <<~PHLEX.strip
options_from_collection_for_select([])
text "Text"
plain "Text"
PHLEX

assert_phlex_template expected, html do
Expand All @@ -206,7 +206,7 @@ class Phlexing::Converter::RailsHelpersTest < Minitest::Spec
expected = <<~PHLEX.strip
select_date Date.today, prefix: :start_date
text "Text"
plain "Text"
PHLEX

assert_phlex_template expected, html do
Expand All @@ -221,7 +221,7 @@ class Phlexing::Converter::RailsHelpersTest < Minitest::Spec
expected = <<~PHLEX.strip
select_year(2009)
text "Text"
plain "Text"
PHLEX

assert_phlex_template expected, html do
Expand All @@ -235,7 +235,7 @@ class Phlexing::Converter::RailsHelpersTest < Minitest::Spec
expected = <<~PHLEX.strip
link_to "Abc", "/users"
text "Text"
plain "Text"
PHLEX

assert_phlex_template expected, html do
Expand All @@ -249,7 +249,7 @@ class Phlexing::Converter::RailsHelpersTest < Minitest::Spec
expected = <<~PHLEX.strip
url_for post
text "Text"
plain "Text"
PHLEX

assert_phlex_template expected, html do
Expand All @@ -267,7 +267,7 @@ class Phlexing::Converter::RailsHelpersTest < Minitest::Spec
expected = <<~PHLEX.strip
ul { content_for :navigation }
text "Text"
plain "Text"
PHLEX

assert_phlex_template expected, html do
Expand All @@ -288,7 +288,7 @@ class Phlexing::Converter::RailsHelpersTest < Minitest::Spec
li { link_to "Home", action: "index" }
end
text "Text"
plain "Text"
PHLEX

assert_phlex_template expected, html do
Expand All @@ -302,7 +302,7 @@ class Phlexing::Converter::RailsHelpersTest < Minitest::Spec
expected = <<~PHLEX.strip
t("hello")
text "Text"
plain "Text"
PHLEX

assert_phlex_template expected, html do
Expand All @@ -316,7 +316,7 @@ class Phlexing::Converter::RailsHelpersTest < Minitest::Spec
expected = <<~PHLEX.strip
translate("hello")
text "Text"
plain "Text"
PHLEX

assert_phlex_template expected, html do
Expand All @@ -330,7 +330,7 @@ class Phlexing::Converter::RailsHelpersTest < Minitest::Spec
expected = <<~PHLEX.strip
radio_button("hello")
text "Text"
plain "Text"
PHLEX

assert_phlex_template expected, html do
Expand All @@ -344,7 +344,7 @@ class Phlexing::Converter::RailsHelpersTest < Minitest::Spec
expected = <<~PHLEX.strip
stylesheet_path "hello"
text "Text"
plain "Text"
PHLEX

assert_phlex_template expected, html do
Expand All @@ -358,7 +358,7 @@ class Phlexing::Converter::RailsHelpersTest < Minitest::Spec
expected = <<~PHLEX.strip
javascript_path "hello"
text "Text"
plain "Text"
PHLEX

assert_phlex_template expected, html do
Expand All @@ -372,7 +372,7 @@ class Phlexing::Converter::RailsHelpersTest < Minitest::Spec
expected = <<~PHLEX.strip
dom_id "hello"
text "Text"
plain "Text"
PHLEX

assert_phlex_template expected, html do
Expand Down
8 changes: 4 additions & 4 deletions gem/test/phlexing/converter/tags_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Phlexing::Converter::TagsTest < Minitest::Spec

expected = <<~PHLEX.strip
div do
text %(Text with 'single quotes' and "double quotes")
plain %(Text with 'single quotes' and "double quotes")
span { %(Text with "double quotes" and 'single quotes') }
end
PHLEX
Expand Down Expand Up @@ -93,7 +93,7 @@ class Phlexing::Converter::TagsTest < Minitest::Spec
div(class: "app", id: "body") do
h1 { "Title 1" }
h2 do
text "Title 2"
plain "Title 2"
span { "Small Addition" }
end
end
Expand All @@ -107,9 +107,9 @@ class Phlexing::Converter::TagsTest < Minitest::Spec

expected = <<~PHLEX.strip
div do
text "Text"
plain "Text"
br
text "Line 2"
plain "Line 2"
end
PHLEX

Expand Down
10 changes: 5 additions & 5 deletions gem/test/phlexing/converter/whitespace_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Phlexing::Converter::WhitespaceTest < Minitest::Spec
expected = <<~PHLEX.strip
a do
i(class: "fa fa-pencil")
text " Edit"
plain " Edit"
end
PHLEX

Expand Down Expand Up @@ -56,9 +56,9 @@ class Phlexing::Converter::WhitespaceTest < Minitest::Spec

expected = <<~PHLEX.strip
h1 do
text @user.firstname
plain @user.firstname
whitespace
text @user.lastname
plain @user.lastname
end
PHLEX

Expand All @@ -74,8 +74,8 @@ class Phlexing::Converter::WhitespaceTest < Minitest::Spec

expected = <<~PHLEX.strip
h1 do
text @user.firstname
text @user.lastname
plain @user.firstname
plain @user.lastname
end
PHLEX

Expand Down
Loading

0 comments on commit b619ce4

Please sign in to comment.