Skip to content

Commit

Permalink
fix: #parameterize != #underscore
Browse files Browse the repository at this point in the history
  • Loading branch information
palkan committed Aug 16, 2023
1 parent c3e2218 commit d1cdeea
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/ruby_bytes/thor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def template(url)
# TODO: Add more extensions
class ::String
def parameterize
gsub("::", "/").gsub(/([a-z])([A-Z])/, '\1-\2').downcase
downcase.gsub(/[^a-z0-9\-_]+/, '-').gsub(/-{2,}/, '-').gsub(/^-|-$/, '')
end

def underscore
Expand Down
2 changes: 1 addition & 1 deletion templates/rbytes/core_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# TODO: Add more extensions
class ::String
def parameterize
gsub("::", "/").gsub(/([a-z])([A-Z])/, '\1-\2').downcase
downcase.gsub(/[^a-z0-9\-_]+/, '-').gsub(/-{2,}/, '-').gsub(/^-|-$/, '')
end

def underscore
Expand Down
2 changes: 1 addition & 1 deletion test/integration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def test_dummy_rails
run_generator do |output|
assert_line_printed(
output,
"APP=robo-bytes"
"APP=robobytes"
)
end
end
Expand Down

0 comments on commit d1cdeea

Please sign in to comment.