Skip to content

Commit

Permalink
Add frozen_string_literal statement to all generated .rb files (#1278)
Browse files Browse the repository at this point in the history
* Add frozen_string_literal statement to all generated .rb files

* Add a changelog entry

Co-authored-by: Hans Lemuet <[email protected]>
  • Loading branch information
bobmaerten and Spone authored Feb 14, 2022
1 parent 95c800d commit ccede32
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ title: Changelog

*Simon Fish*

* Ensure all generated `.rb` files include `# frozen_string_literal: true` statement.

*Bob Maerten*

* Add Shogun to users list.

*Bernie Chiu*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class <%= class_name %>ComponentPreview < ViewComponent::Preview
def default
render(<%= class_name %>Component.new)
Expand Down
2 changes: 2 additions & 0 deletions lib/rails/generators/rspec/templates/component_spec.rb.tt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "rails_helper"

RSpec.describe <%= class_name %>Component, type: :component do
Expand Down
2 changes: 2 additions & 0 deletions lib/rails/generators/test_unit/templates/component_test.rb.tt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "test_helper"

class <%= class_name %>ComponentTest < ViewComponent::TestCase
Expand Down

0 comments on commit ccede32

Please sign in to comment.