hubot-archive / hubot-pager-me

PagerDuty integration for Hubot
https://www.npmjs.com/package/hubot-pager-me
MIT License
73 stars 93 forks source link

Add ability to transform a certain char to a space #84

Closed awiddersheim closed 8 years ago

awiddersheim commented 8 years ago

Added HUBOT_PAGERDUTY_CHAR_TO_SPACE option which allows for converting a specific char into a space. For example, by setting this option to _ this will transform Foo_Bar to Foo Bar. This is useful for anyone who has usernames or schedules that contain spaces and do not wish to change them. Here is a more verbose example:

hubot> pager trigger Foo_Bar testing

This will trigger the Foo Bar schedule.

awiddersheim commented 8 years ago

@stephenyeargin Anything I can do to get this merged?

stephenyeargin commented 8 years ago

Because it would introduce new functionality, I'm a little more cautious on it. Concern would be if it breaks anyone that set up their service with underscores. Maybe a quoted string is a better approach?

@hubot-scripts/hubot-pager-me: Any thoughts?

awiddersheim commented 8 years ago

I could try and get a quoted string working the way I'd want without requiring everyone to use them.

The beauty of this is you don't have to specify anything for HUBOT_PAGERDUTY_CHAR_TO_SPACE and nothing will change and you can use any character(s) to transform into a space. Doesn't have to be an underscore.

awiddersheim commented 8 years ago

I may have a regex solution that I'll play with for a bit and get back to you.

awiddersheim commented 8 years ago

Closing in favor of #89.