markbates / inflect

DEPRECATED: use github.com/gobuffalo/flect instead
https://github.com/gobuffalo/flect
MIT License
24 stars 18 forks source link

Remove github.com/gobuffalo/envy #12

Open bep opened 6 years ago

bep commented 6 years ago

See https://github.com/markbates/inflect/blob/master/name.go#L8

I did a dep ensure -update in Hugo and got some unknown and new packages. I tracked it to the above. That does not look like core inflect functionality. I would appreciate if you could remove/find another way to handle the above.

I will now pin Hugo against an older version of Inflect, but it would be a pity if we miss out on future bug fixes etc.

markbates commented 6 years ago

A PR to remove that dep would be fantastic and welcome.

bep commented 6 years ago

I assume you want to keep the Package method? What is its value?

markbates commented 6 years ago

We would. It’s used in a lot of places to take a path name and turn it into a package name. So /Users/markbates/go/src/foo/bar would become foo/bar or C:\WindowsPath\go\src\etc…

inflect.Name is used very heavily as part of all the Buffalo stuff.

markbates commented 6 years ago

We would. It’s used in a lot of places to take a path name and turn it into a package name. So /Users/markbates/go/src/foo/bar would become foo/bar or C:\WindowsPath\go\src\etc…

inflect.Name is used very heavily as part of all the Buffalo stuff.


Mark Bates

On Feb 17, 2018, 9:24 AM +0000, Bjørn Erik Pedersen notifications@github.com, wrote:

I assume you want to keep the Package method? What is its value? — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

bep commented 6 years ago

Why not move it to the Buffalo project where it’s used?

markbates commented 6 years ago

It was but it’s been moved here because it’s being used in a lot of projects not just buffalo so it was moved here so there wasn’t a dependency on buffalo everywhere else. The Name type fits here as it provides a way to make uniformed inflections against a name it definitely belongs here, but I agree if the envy dep can be dropped it should.

bep commented 6 years ago

You're stretching the inflect term into a very specific domain here, but this is your project.

One last suggestion from me:

Create package(s), so one can do:

import "github.com/markbates/inflect/name"

name := name.Inflect("some string")

Etc. With the added benefit of a common interface.

stanislas-m commented 6 years ago

The only envy usage I can see there is envy.GoPaths(). It shouldn't be difficult to remove this dep.

robbyoconnor commented 6 years ago

Made a PR: https://github.com/markbates/inflect/pull/15