Sha256: fa76e7985b772d93314c2c046442563f86feaffa8b027bd58380df3d85fe8d69
Contents?: true
Size: 626 Bytes
Versions: 5
Compression:
Stored size: 626 Bytes
Contents
class SlimKeyfy::Transformer::ControllerTransformer < SlimKeyfy::Transformer::BaseTransformer TAGS = /(text|notice|message|alert|raise|subject|flash\[:[a-z]+\])/ CONNECTING_SYMBOLS = /\s*(:|=>?)?\s*/ REGEX = /(?<tag>#{TAGS}#{CONNECTING_SYMBOLS})(?<translation>#{STRING})/ def transform m = @word.line.match(REGEX) if m != nil then translation = match_string(m[:translation]) translation_key = update_hashes(translation) localized = @word.line.gsub(m[:translation], translation_key) return [localized, @word.translations] end nil_elem end def controller? true end end
Version data entries
5 entries across 5 versions & 1 rubygems