livingsocial / rake-pipeline

An extension to Rake for dealing with a directory of inputs, a number of filters, and a directory of outputs
MIT License
276 stars 38 forks source link

GsubFilter for stripping and replacing #101

Closed ahawkins closed 12 years ago

ahawkins commented 12 years ago

See docs and tests.

Here are the additions to the DSL:

match "**/*js" do
  # basic gsubbing
  gsub /\/\/\w+$/, "no comments allowed!"

  # block syntax works
  gsub /.+/ do |match|
    # process things
  end

  # gsub filter with no replacement
  strip /Ember.assert\(.+\);/
end