Class: GovukPublishingComponents::AuditComponents
- Inherits:
-
Object
- Object
- GovukPublishingComponents::AuditComponents
- Defined in:
- app/models/govuk_publishing_components/audit_components.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(path, options = {}) ⇒ AuditComponents
constructor
A new instance of AuditComponents.
Constructor Details
#initialize(path, options = {}) ⇒ AuditComponents
Returns a new instance of AuditComponents.
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 |
# File 'app/models/govuk_publishing_components/audit_components.rb', line 5 def initialize(path, = {}) # paths to key file locations @templates_path = [:templates_path] || "app/views/govuk_publishing_components/components" @stylesheets_path = [:stylesheets_path] || "app/assets/stylesheets/govuk_publishing_components/components" @print_stylesheets_path = [:print_stylesheets_path] || "app/assets/stylesheets/govuk_publishing_components/components/print" @javascripts_path = [:javascripts_path] || "app/assets/javascripts/govuk_publishing_components/components" @tests_path = [:tests_path] || "spec/components" @javascript_tests_path = [:javascript_tests_path] || "spec/javascripts/components" @helpers_path = [:helpers_path] || "lib/govuk_publishing_components/presenters" @application_name = [:application_name] || "govuk_publishing_components" @application_dir = [:application_dir] || "govuk_publishing_components" @all_templates = Dir["#{path}/#{@templates_path}/*.erb"].sort @templates_full_path = "#{path}/#{@templates_path}/" @component_numbers = { template: 0, stylesheet: 0, print_stylesheet: 0, javascript: 0, uses_govuk_frontend_js: 0, uses_govuk_frontend_css: 0, test: 0, javascript_test: 0, helper: 0, } @data = { gem_found: false, } @auditing_an_application = true unless @application_name == "govuk_publishing_components" @data = compile_data(path) if Dir.exist?(path) end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
3 4 5 |
# File 'app/models/govuk_publishing_components/audit_components.rb', line 3 def data @data end |