Manuals Publisher is a Ruby on Rails content management application for the 'manuals' format. The manuals format is currently in a rendered phase of migration, so content is stored in a local datastore but also drafted and published through the publishing-pipeline via the Publishing API.
This is the renamed repository of the original Specialist Publisher. Specialist Publisher has been divided into two publishing applications to accommodate Specialist Documents and Manuals separately. Specialist Document or Finders publishing now lives at https://github.com/alphagov/specialist-publisher. See history for more details.
Publishing app for manuals.
- Manual: Grouped Documents published as a number of sections inside a parent document
Live examples of manuals
- alphagov/asset-manager: provides uploading for static files
- alphagov/publishing-api: allows documents to be published to the Publishing queue
- link-checker-api: checks all the links in an edition on request from the edition show page.
Running the application
To run the application in development you will need at least one user in the application database. In a rails console do:
User.create!(name: "My Name", email: "email@example.com", permissions: ["gds_editor"], organisation_slug: "government-digital-service", organisation_content_id: "af07d5a5-df63-4ddc-9383-6a666845ebe9")
Note: This insert (and the app in general) doesn't work with recent versions of MongoDB. v3.0.12 works OK; v3.4.1 does NOT work due to a problem with the
:w => 1 option no longer being supported at the top level, i.e. outside the Write Concern options. It looks as if v2.4.9 is currently being used in production.
Then start the application:
If you are using the GDS development virtual machine then the application will be available on the host at http://manuals-publisher.dev.gov.uk/
Running the test suite
$ bundle exec rake
cucumber rake task which is run as part of the
default rake task does not work with
bundler versions of 1.13.0 onwards. The following exception occurs:
cannot load such file -- active_model/translation (LoadError). The full stack trace is recorded here. Based on the fact that the Ruby version is set to v2.1.2, it looks as if the version of
bundler currently being used in production is v1.6.5.
Application directory structure
Non standard Rails directories and what they're used for:
app/modelsCombination of Mongoid documents and Ruby objects for handling Documents and various behaviours
app/models/validatorsNot validators. Decorators for providing validation logic.
- app/presenters Decorators mainly used for previewing documents
app/servicesReusable classes for completing actions on documents
app/view_adaptersProvide classes which allow us to have Rails like form objects in views
app/workersClasses for sidekiq workers. Currently the only worker in the App is for publishing Manuals as Manual publishing was timing out due to the large number of document objects inside a Manual