nanoc / features

Collection of feature requests
2 stars 1 forks source link

Adding `env_name` to ConfigView #52

Closed moll closed 5 years ago

moll commented 5 years ago

Hey,

This is an issue for me/us to not forget to add env_name to ConfigView to match the method in Configuration. It'd be for getting the environment in the Rules file.

While on the topic, why did you go with env_name as opposed to env, which would better match NANOC_ENV, Rails.env and the likes?

Cheers

denisdefreyne commented 5 years ago

While on the topic, why did you go with env_name as opposed to env, which would better match NANOC_ENV, Rails.env and the likes?

When I think of “the environment”, I think of the the environment and its contents, rather than its name. Configuration#env_name clearly returns the name of the environment, but what would Configuration#env return? Some might argue that it should return the name, while others might argue that it returns the contents (a Ruby Hash) instance. For this reason, I prefer to be explicit.

moll commented 5 years ago

ACK and thanks for the record here, too!