class Translatomatic::Extractor::Base
Base
class for string extraction functionality
Public Class Methods
new(path)
click to toggle source
# File lib/translatomatic/extractor/base.rb, line 5 def initialize(path) @path = path.is_a?(Pathname) ? path : Pathname.new(path) @contents = @path.read end
Public Instance Methods
extract()
click to toggle source
@return [Array<String>] All strings found
# File lib/translatomatic/extractor/base.rb, line 11 def extract @contents.scan(/\"(.*?[^\\])"|'(.*?[^\\])'/).flatten.compact end