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 lowercase filter #82

Closed
wants to merge 1 commit into from
Closed

Add lowercase filter #82

wants to merge 1 commit into from

Conversation

mfontani
Copy link

In the webapps I'm mostly developing on (written in Perl), the "alternate" templates for controllers (like Web_App::Foo::Bar) are all lowercase (i.e. templates/webapp/foo/bar.tt), and there is no way to make that happen with projectionist currently.

This simple patch allows me to use projectionist on that project, with this config:

{
  "lib/Web_App/*.pm": {
    "alternate": "templates/webapp/{lowercase}.tt"
  },
  "templates/webapp/*.tt": {
    "alternate": "lib/Web_App/{capitalize}.pm"
  }
}

It's a fairly trivial one, granted.

@tpope
Copy link
Owner

tpope commented Oct 18, 2017

My first impulse is to steer you to snakecase or camelcase. What happens for Web_App::FooBar or Web_App::Foo_Bar?

@mfontani
Copy link
Author

Don't really have either – they're all single words ucfirsted, or all caps. snakecase seems to do the trick, indeed.

@mfontani mfontani closed this Oct 18, 2017
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.

None yet

2 participants