Class: Shrinker::Parser::Text
- Defined in:
- lib/shrinker/parser/text.rb
Instance Attribute Summary
Attributes inherited from Abstract
#attributes, #config, #content
Instance Method Summary collapse
Methods inherited from Abstract
Constructor Details
This class inherits a constructor from Shrinker::Parser::Abstract
Instance Method Details
#replace ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/shrinker/parser/text.rb', line 4 def replace content.gsub(url_regex) do |url| matched_url = $1 next if matched_url =~ excluded_path_regex url.gsub!(matched_url, shrink_url(matched_url)) end end |