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

Add more naming strategies/formats enum types #30

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tomroffe
Copy link

@tomroffe tomroffe commented May 2, 2024

HI 👋,

Please excuse the uninvited PR, but I thought to share just in case someone else found this useful. Please let me know your thoughts on including, and ill be happy to adapt. 😄

I needed the format of the generated names to be slightly different. To allow this, I adapted your code to include functionality from Inflector0.11.4 which manifests itself as new Name enum types in addition to Name::Plain and Name::Numbered. Specifically:

  • TitleCase - Adjective Noun
  • CamelCase - adjectiveNoun
  • ClassCase - AdjectiveNoun
  • KebabCase - adjective-noun
  • TrainCase - Adjective-Noun
  • TableCase - adjective-noun
  • SnakeCase - adjective_noun
  • PascalCase - AdjectiveNoun
  • SentenceCase - Adjective noun
  • ScreamingSnakeCase - Adjective_Noun

Change Log

  • Added new functionality to src/lib.rs, new Name types
  • Updated CHANGELOG.md with notes on new naming strategy functionality
  • Added tests/lib.rs for naming strategy testing
  • Added and Updated READMD.md and README.tpl with notes on new functionality with examples.
  • Updated bin/names.rs to reflect breaking changes to Generator::new together with additional CLI -s/--strategy switch logic.
  • Updated regex to 1.10.4
  • Added [profile.release] section to Cargo.toml
  • Some typos... probably

- Updated regex to `1.10.4`
- Updated `CHANGELOG.md`
- Added `tests/lib.rs` for naming strategy testing
- Added and Updated `READMD.md` and `README.tpl` with new functionaility with examples.
- Updated `bin/names.rs`
- Updated with new functionality `src/lib.rs`

Signed-off-by: Tom Roffe <[email protected]>
@tomroffe tomroffe changed the title Add more naming strategies/formats Add more naming strategies/formats enum types May 2, 2024
@tomroffe tomroffe changed the base branch from staging to main May 2, 2024 18:58
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.

1 participant