To add a collaborator to this project you will need to use the Relish gem to add the collaborator via a terminal command. Soon you'll be able to also add collaborators here!
More about adding a collaboratorWriting assets
In order to use my assets in a site
As a developer
I want to write the HTML that will include my assets on the page
- Background
-
- Given
-
this code has executed
require 'pannier/mounted'
- Scenarios
-
- Writing JavaScript assets in production
- Writing CSS assets in production
- Writing assets from a mounted app in production
- Writing JavaScript assets in production
-
- Given
-
these files exist
input/scripts/one.js input/scripts/two.js - And
-
the file ".assets.rb" contains
input 'input' output 'output' package :scripts do input 'scripts' assets '*.js' end
- And
- the app is loaded in a production environment
- And
- the app has been processed
- When
-
I write the tags as follows
tags = Pannier::Tags.new(@app) tags.write(:scripts, :as => Pannier::Tags::JavaScript, :defer => 'defer')
- Then
-
the following HTML should be written to the page
<script defer="defer" src="/one.js" type="text/javascript"></script> <script defer="defer" src="/two.js" type="text/javascript"></script>
- Writing CSS assets in production
-
- Given
-
these files exist
input/styles/a.css input/styles/b.css - And
-
the file ".assets.rb" contains
input 'input' output 'output' package :styles do input 'styles' assets '*.css' end
- And
- the app is loaded in a production environment
- And
- the app has been processed
- When
-
I write the tags as follows
tags = Pannier::Tags.new(@app) tags.write(:styles, :as => Pannier::Tags::CSS, :media => 'screen')
- Then
-
the following HTML should be written to the page
<link href="/a.css" media="screen" rel="stylesheet" type="text/css" /> <link href="/b.css" media="screen" rel="stylesheet" type="text/css" />
- Writing assets from a mounted app in production
-
- Given
-
these files exist
input/styles/foo.css - And
-
the file ".assets.rb" contains
mount '/assets' input 'input' output 'output' package :styles do input 'styles' assets 'foo.css' end
- And
- the app is loaded in a production environment
- And
- the app has been processed
- When
-
I write the tags as follows
tags = Pannier::Tags.new(@app) tags.write(:styles, :as => Pannier::Tags::CSS)
- Then
-
the following HTML should be written to the page
<link href="/assets/foo.css" rel="stylesheet" type="text/css" />
Last published over 3 years ago by joecorcoran.