silkfire / Pastel

Snazz up your console output!
MIT License
405 stars 24 forks source link

Add EnvironmentDetector #30

Closed JKamsker closed 1 year ago

JKamsker commented 1 year ago

Detecting environments where colors are probably not supported.

silkfire commented 1 year ago

Looks really good! Great initiative 👌🏻

Would you mind adding unit tests for each individual environment variable?

JKamsker commented 1 year ago

Sure, @silkfire! I'm glad you like it! I've added the unit tests for each environment variable as you suggested. Thanks for the feedback!

silkfire commented 1 year ago

Is there any reason why you need to use the lock object when running the tests? I tried without it and got not errors. The tests are not run in parallell so shouldn't cause any issues.

JKamsker commented 1 year ago

@silkfire I did not know if they run in parallel or not. I think there may be an option to do that. I added the lock just in case. Environment variables are global. I didnt want them to influence other tests.

silkfire commented 1 year ago

I used to run the unit tests in parallell but got unexpected results due to race conditions so I disabled the parallellization.

I'm currently working to improve the performance of Pastel; when that is done I'll push a new release to NuGet.

silkfire commented 1 year ago

I decided to go ahead and release this. Thanks for your contributions, @JKamsker!

https://github.com/silkfire/Pastel/releases/tag/v4.2.0

silkfire commented 10 months ago

@JKamsker Better late than never, the new version of Pastel is out with considerably improved performance: v5.0.0