This gem:
- Provides shared components for applications
- Provides helpers to generate component payloads
- Provides an application to preview components
Components should be added to this gem if they are required in more than one application, otherwise they should be added to that application.
- Install and use this gem
- Use a component in your application
- Generate a new component
- Develop a component
- Run the component guide
- Move a component from an application to the gem
- Publish this gem
There are 2 types of helper classes in this app:
- AppHelpers. Are exposed to the applications using this gem. They should be documented using RDoc.
- Component Presenters. Anything in these classes is only for use within the components. They should be marked
@private
.
This gem is the way GOV.UK consumes GOV.UK Frontend, part of the GOV.UK Design System.
We use NPM to pull in the GOV.UK Frontend styles and Javascript, but we don't commit
the node_modules
directory. To install GOV.UK Frontend on your machine, run:
npm install
You'll need to have installed Node and NPM for this.
See the rubydoc.info documentation
Run the documentation locally with:
bundle exec yard server --reload
The default rake task runs all tests:
bin/rake
Javascript is tested using Jasmine and the Jasmine gem. Tests can be run either in the browser or on the command line via the dummy app’s tasks:
# browser
bin/rake app:jasmine
# command line
bin/rake app:jasmine:ci