-
Notifications
You must be signed in to change notification settings - Fork 270
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
Added Months option and added frequency_modifier def to handle both i… #305
Conversation
…ntegers and strings. Fixes #304
the rubocop failures for case, where it wants the when statements indented as deep as the case statement, is that how it should be? My RubyMine IDE automagically indents them one level deeper and readability I think that it's nice as you can tell they are a condition of the case statement. |
def validate_create_months | ||
return unless @new_resource.months | ||
unless [:monthly].include?(@new_resource.frequency) | ||
fail 'months attribute is only valid for tasks that run weekly or monthly' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change message to just monthly
For the sake of consistency, we'd want this to comply with the rubocop rules currently used. We don't want to merge a PR unless it is green. |
Oh and I should also say thank you very much for this! I think it is a good addition. |
Made the rubocop fixes and a couple of your recommendations from comments above. As far as array's go, that would probably be best but not sure if that should be in this scope or a refactor afterwards. I was trying to stay consistent with the rest of the file and formatted it like how validate_create_day is. I am also fairly new to ruby, chef, and programming in general and have been learning as I go I'm not totally sure what would all need to be done to refactor for kind_of array. |
Yeah the Array is not a big deal. I think it might make things easier but wouldn't hold off a merge. However, after you split the string on ',' you should
FEB will be ' FEB' |
is this last commit what your talking about? |
yeah |
cool |
👍 cc @chef-cookbooks/client-windows @chef/client-windows |
👍 |
Added Months option and added frequency_modifier def to handle both i…
Added Months option and added frequency_modifier def to handle both integers and strings. Fixes #304