Logo: Relish

  1. Sign in

Project: Pannier v0.6.0

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

Scenarios
Assets are modified after concatenation
Given
the file "input/bar.css" contains
html {
  font-size: 24px;
}
And
the file "input/baz.css" contains
body {
  background: green;
}
And
the file ".assets.rb" contains
input  '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 contain
/* Stylesheet Corp. LLC 2013 */
/* bar.css */
html {
  font-size: 24px;
}
/* baz.css */
body {
  background: green;
}

Last published over 3 years ago by joecorcoran.