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

Use standard lib methods #500

Merged
merged 9 commits into from
Sep 30, 2023
Merged

Conversation

ls1955
Copy link
Contributor

@ls1955 ls1955 commented Sep 29, 2023

This commit:

  • Refactor GeneratorHelp#to_capitalized
  • Remove GeneratorHelp#to_snake
  • Replace GeneratorHelp#to_snake with String#underscore across test_template.ecr

Associated Issue:
Closes #405

@ls1955
Copy link
Contributor Author

ls1955 commented Sep 29, 2023

Hmm... Can't figure out the error within space-age exercise.

@ls1955
Copy link
Contributor Author

ls1955 commented Sep 30, 2023

After taking a look around, It might be because we are dealing with int and float in space-age exercise?

num_one = 1000000000.to_s
num_two = 31.69.to_s

to_snake(num_one) # => "_1_0_0_0_0_0_0_0_0_0"
num_one.underscore # => "1000000000"
to_snake(num_two) # => "_3_1_._6_9"
num_two.underscore # => "31.69"

Because:
space-age exercise still need it to pass the spec
Because:
The spec failed after switched to String#underscore
bin/generator_help.cr Show resolved Hide resolved
@ryanplusplus ryanplusplus merged commit 0355eec into exercism:main Sep 30, 2023
@ls1955 ls1955 deleted the use-standard-lib-methods branch October 1, 2023 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Templates]: Use standard-libary methods
2 participants