lib/utils/text.rb in lita-puppet-0.6.0 vs lib/utils/text.rb in lita-puppet-0.6.1
- old
+ new
@@ -10,13 +10,19 @@
def sanitze_for_chat(text)
# Remove bash colorings
text.gsub(/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]/, '')
end
+ # camel case puppet classes
+ def class_camel(text)
+ text.split('::').map(&:capitalize).join('::')
+ end
+
# Format some text as code
# Note that this is HipChat specific for the moment
# TODO: Make this *not* HipChat specific
def as_code(text)
"/code " + sanitze_for_chat(text)
end
end
+
end