Module: Rake::Pipeline::Web::Filters::PipelineHelpers

Defined in:
lib/rake-pipeline-web-filters/helpers.rb

Overview

Extends the Rake::Pipeline DSL to include shortcuts for adding filters to the pipeline.

Instead of:

match("*.scss") do
  filter Rake::Pipeline::Web::Filters::SassFilter, :syntax => :sass
end

You can do:

match("*.scss") do
  sass :syntax => :sass
end

Instance Method Summary collapse

Instance Method Details

#cache_buster(&block) ⇒ Object

Add a new CacheBusterFilter to the pipeline.


62
63
64
# File 'lib/rake-pipeline-web-filters/helpers.rb', line 62

def cache_buster(&block)
  filter(Rake::Pipeline::Web::Filters::CacheBusterFilter, &block)
end

#coffee_script(*args, &block) ⇒ Object

Add a new CoffeeScriptFilter to the pipeline.


68
69
70
# File 'lib/rake-pipeline-web-filters/helpers.rb', line 68

def coffee_script(*args, &block)
  filter(Rake::Pipeline::Web::Filters::CoffeeScriptFilter, *args, &block)
end

#es6_module(*args, &block) ⇒ Object

Add a new ES6ModuleFilter to the pipeline.


74
75
76
# File 'lib/rake-pipeline-web-filters/helpers.rb', line 74

def es6_module(*args, &block)
  filter(Rake::Pipeline::Web::Filters::ES6ModuleFilter, *args, &block)
end

#gzip(&block) ⇒ Object

Add a new GzipFilter to the pipeline.


92
93
94
# File 'lib/rake-pipeline-web-filters/helpers.rb', line 92

def gzip(&block)
  filter(Rake::Pipeline::Web::Filters::GzipFilter, &block)
end

#handlebars(*args, &block) ⇒ Object

Add a new HandlebarsFilter to the pipeline.


110
111
112
# File 'lib/rake-pipeline-web-filters/helpers.rb', line 110

def handlebars(*args, &block)
  filter(Rake::Pipeline::Web::Filters::HandlebarsFilter, *args, &block)
end

#iife(*args, &block) ⇒ Object

Add a new IifeFilter to the pipeline.


116
117
118
# File 'lib/rake-pipeline-web-filters/helpers.rb', line 116

def iife(*args, &block)
  filter(Rake::Pipeline::Web::Filters::IifeFilter, *args, &block)
end

#jade(*args, &block) ⇒ Object


38
39
40
# File 'lib/rake-pipeline-web-filters/helpers.rb', line 38

def jade(*args, &block)
  filter(Rake::Pipeline::Web::Filters::JadeFilter, *args, &block)
end

#less(*args, &block) ⇒ Object

Add a new LessFilter to the pipeline.


104
105
106
# File 'lib/rake-pipeline-web-filters/helpers.rb', line 104

def less(*args, &block)
  filter(Rake::Pipeline::Web::Filters::LessFilter, *args, &block)
end

#markdown(*args, &block) ⇒ Object

Add a new MarkdownFilter to the pipeline.


56
57
58
# File 'lib/rake-pipeline-web-filters/helpers.rb', line 56

def markdown(*args, &block)
  filter(Rake::Pipeline::Web::Filters::MarkdownFilter, *args, &block)
end

#minispade(*args, &block) ⇒ Object

Add a new MinispadeFilter to the pipeline.


19
20
21
# File 'lib/rake-pipeline-web-filters/helpers.rb', line 19

def minispade(*args, &block)
  filter(Rake::Pipeline::Web::Filters::MinispadeFilter, *args, &block)
end

#neuter(*args, &block) ⇒ Object

Add a new NeuterFilter to the pipeline.


25
26
27
# File 'lib/rake-pipeline-web-filters/helpers.rb', line 25

def neuter(*args, &block)
  filter(Rake::Pipeline::Web::Filters::NeuterFilter, *args, &block)
end

#sass(*args, &block) ⇒ Object Also known as: scss

Add a new SassFilter to the pipeline.


31
32
33
# File 'lib/rake-pipeline-web-filters/helpers.rb', line 31

def sass(*args, &block)
  filter(Rake::Pipeline::Web::Filters::SassFilter, *args, &block)
end

#stylus(*args, &block) ⇒ Object

Add a new StylusFilter to the pipeline.


44
45
46
# File 'lib/rake-pipeline-web-filters/helpers.rb', line 44

def stylus(*args, &block)
  filter(Rake::Pipeline::Web::Filters::StylusFilter, *args, &block)
end

#tilt(*args, &block) ⇒ Object

Add a new TiltFilter to the pipeline.


50
51
52
# File 'lib/rake-pipeline-web-filters/helpers.rb', line 50

def tilt(*args, &block)
  filter(Rake::Pipeline::Web::Filters::TiltFilter, *args, &block)
end

#uglify(*args, &block) ⇒ Object

Add a new UglifyFilter to the pipeline.


98
99
100
# File 'lib/rake-pipeline-web-filters/helpers.rb', line 98

def uglify(*args, &block)
  filter(Rake::Pipeline::Web::Filters::UglifyFilter, *args, &block)
end

#yui_css(*args, &block) ⇒ Object

Add a new YUICssFilter to the pipeline.


86
87
88
# File 'lib/rake-pipeline-web-filters/helpers.rb', line 86

def yui_css(*args, &block)
  filter(Rake::Pipeline::Web::Filters::YUICssFilter, *args, &block)
end

#yui_javascript(*args, &block) ⇒ Object

Add a new YUIJavaScriptFilter to the pipeline.


80
81
82
# File 'lib/rake-pipeline-web-filters/helpers.rb', line 80

def yui_javascript(*args, &block)
  filter(Rake::Pipeline::Web::Filters::YUIJavaScriptFilter, *args, &block)
end