joecorcoran / Pannier / Docs
Ordered processing
In order that I can continue to modify assets after concatenation As a developer I want all processing to happen in the declared order
Scenario: Assets are modified after concatenation
- Given the file "
input/bar.css" containscsshtml { font-size: 24px; } - And the file "
input/baz.css" containscssbody { background: green; } - And the file "
.assets.rb" containsrubyinput 'input' output 'output' package :styles do assets '*.css' modify do |content, basename| ["/* #{basename} */\n#{content}", basename] end concat 'styles.css' modify do |content, basename| ["/* Stylesheet Corp. LLC 2013 */\n#{content}", basename] end end - When the app is loaded
- And the app has been processed
- Then the file "
output/styles.css" should containcss/* Stylesheet Corp. LLC 2013 */ /* bar.css */ html { font-size: 24px; } /* baz.css */ body { background: green; }
Source: features/ordered_processing.feature at commit 97ce086f, Pannier (MIT license).