Class: TRMNLP::Lint::Source
- Inherits:
-
Object
- Object
- TRMNLP::Lint::Source
- Defined in:
- lib/trmnlp/lint/source.rb
Overview
The plugin data every lint check examines: markup per view, shared markup, the combined markup string, and the raw settings.yml. Built once and shared across all checks. Settings come straight from Config::Plugin (a single parse); checks read the raw ‘}` templates, which Config::Plugin’s semantic readers render away.
Constant Summary collapse
- VIEWS =
%w[full half_horizontal half_vertical quadrant].freeze
Instance Method Summary collapse
- #all_markup ⇒ Object
- #custom_field_definitions ⇒ Object
- #custom_field_values ⇒ Object
-
#initialize(config:, paths:) ⇒ Source
constructor
A new instance of Source.
- #plugin_name ⇒ Object
- #settings ⇒ Object
- #shared_markup ⇒ Object
- #view_markup ⇒ Object
Constructor Details
#initialize(config:, paths:) ⇒ Source
Returns a new instance of Source.
13 14 15 16 |
# File 'lib/trmnlp/lint/source.rb', line 13 def initialize(config:, paths:) @config = config @paths = paths end |
Instance Method Details
#all_markup ⇒ Object
31 32 33 |
# File 'lib/trmnlp/lint/source.rb', line 31 def all_markup @all_markup ||= view_markup.values.join + shared_markup end |
#custom_field_definitions ⇒ Object
21 |
# File 'lib/trmnlp/lint/source.rb', line 21 def custom_field_definitions = config.plugin.custom_field_definitions |
#custom_field_values ⇒ Object
20 |
# File 'lib/trmnlp/lint/source.rb', line 20 def custom_field_values = config.project.custom_fields |
#plugin_name ⇒ Object
18 |
# File 'lib/trmnlp/lint/source.rb', line 18 def plugin_name = settings['name'].to_s |
#settings ⇒ Object
19 |
# File 'lib/trmnlp/lint/source.rb', line 19 def settings = config.plugin.settings |
#shared_markup ⇒ Object
27 28 29 |
# File 'lib/trmnlp/lint/source.rb', line 27 def shared_markup @shared_markup ||= read(paths.shared_template) end |
#view_markup ⇒ Object
23 24 25 |
# File 'lib/trmnlp/lint/source.rb', line 23 def view_markup @view_markup ||= VIEWS.to_h { |view| [view, read(paths.template(view))] } end |