Ruby HTML Gherkin CSS JavaScript Dockerfile
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app Set primary publishing organisation Jun 1, 2018
bin Update generated files May 25, 2017
config Switch to using govuk_sidekiq Apr 10, 2018
db Add seeds for mock GDS-SSO user Nov 27, 2017
docs Update README to include link-checker-api dependency Jan 16, 2018
features Use govuk_sidekiq/testing Apr 10, 2018
lib Merge pull request #1267 from alphagov/move-manual-from-closed-organi… Jan 19, 2018
log Add gitkeep to log so Docker can compile production assets Jan 5, 2018
public Base Rails app. Feb 7, 2014
script Upgrade to newer cucumber to make it work on ruby 2.2 Feb 21, 2017
spec Set primary publishing organisation Jun 1, 2018
.gitignore Add gitkeep to log so Docker can compile production assets Jan 5, 2018
.rspec Revert "Merge pull request #745 from alphagov/bump-ruby-version" Sep 28, 2016
.rubocop.yml Upgrade to ruby 2.2 Feb 21, 2017
.ruby-version Bump to ruby-2.5.1 May 29, 2018
Dockerfile Bump to ruby-2.5.1 May 29, 2018
Gemfile Bump gds-api-adapters from 52.7.0 to 52.8.0 Aug 13, 2018
Gemfile.lock Merge pull request #1371 from alphagov/dependabot/bundler/gds-api-ada… Aug 17, 2018
Jenkinsfile Enable Brakeman Aug 2, 2018
LICENCE.txt Correct copyright notice Feb 16, 2015
Procfile Include the unicorn config when starting app from Procfile Feb 23, 2018
README.md Update README to include link-checker-api dependency Jan 16, 2018
Rakefile Replace rubocop with govuk-lint and configure it Feb 21, 2017
config.ru Base Rails app. Feb 7, 2014
startup.sh Revert startup.sh to run rails server Feb 23, 2018

README.md

Manuals publisher

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.

Purpose

Publishing app for manuals.

Nomenclature

  • Manual: Grouped Documents published as a number of sections inside a parent document

Live examples of manuals

Dependencies

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: "my.email@somedomain.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:

$ ./startup.sh

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

Note: The 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/models Combination of Mongoid documents and Ruby objects for handling Documents and various behaviours
    • app/models/validators Not validators. Decorators for providing validation logic.
  • app/presenters Decorators mainly used for previewing documents
  • app/services Reusable classes for completing actions on documents
  • app/view_adapters Provide classes which allow us to have Rails like form objects in views
  • app/workers Classes 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

Documentation