Skip to content
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

Refs #28353: Drop Kafo::Helpers and move to extensions #430

Merged
merged 1 commit into from
Dec 14, 2019

Conversation

ehelms
Copy link
Member

@ehelms ehelms commented Dec 12, 2019

No description provided.

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good first pass. I think that almost all of the methods in HookContextExtension (except local_postgresql?) are good candidates to include in Kafo itself.

end

def log_and_say(level, message, do_say = true, do_log = true)
style = case level
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking about this and if we can actually add them to the color scheme that Kafo already uses.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like a good one to capture into a Redmine issue.


# \ and ' characters could cause trouble in ERB, make sure to escape them
escaped_message = message.gsub('\\', '\\\\\\').gsub("'", %q{\\\'})
say "<%= color('#{escaped_message}', :#{style}) %>" if do_say
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was looking at this but haven't tried yet if it works:

Suggested change
say "<%= color('#{escaped_message}', :#{style}) %>" if do_say
say HighLine.color(message, style.to_sym) if do_say

@ehelms
Copy link
Member Author

ehelms commented Dec 12, 2019

For moving into Kafo -- https://projects.theforeman.org/issues/28498

@ehelms ehelms merged commit b1ad9aa into theforeman:develop Dec 14, 2019
@ehelms ehelms deleted the fixes-28353 branch December 14, 2019 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants