Class: GovukPublishingComponents::AuditController

Inherits:
ApplicationController show all
Defined in:
app/controllers/govuk_publishing_components/audit_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'app/controllers/govuk_publishing_components/audit_controller.rb', line 3

def show
  application_dirs = %w[
    account-api
    collections
    collections-publisher
    contacts-admin
    content-data-admin
    content-publisher
    content-tagger
    datagovuk_find
    email-alert-frontend
    feedback
    finder-frontend
    frontend
    government-frontend
    govspeak
    govspeak-preview
    govuk-developer-docs
    local-links-manager
    manuals-publisher
    maslow
    places-manager
    publisher
    release
    search-admin
    search-v2-evaluator
    service-manual-publisher
    short-url-manager
    signon
    smart-answers
    specialist-publisher
    static
    support
    transition
    travel-advice-publisher
    whitehall
  ]

  application_dirs = [GovukPublishingComponents::ApplicationHelper.get_application_name_from_path(Rails.root)] unless ENV["MAIN_COMPONENT_GUIDE"]

  gem_path = Gem.loaded_specs["govuk_publishing_components"].full_gem_path
  gem_path = Dir.pwd if ENV["MAIN_COMPONENT_GUIDE"]
  host_dir = File.expand_path("..")

  @in_application = false
  @in_application = true unless ENV["MAIN_COMPONENT_GUIDE"]

  components = AuditComponents.new(gem_path)
  applications = analyse_applications(host_dir, application_dirs)
  compared_data = AuditComparer.new(components.data, applications)

  @applications = compared_data.applications_data || []
  @components = compared_data.gem_data || []
end