Class: Standard::Rails::Plugin

Inherits:
LintRoller::Plugin
  • Object
show all
Defined in:
lib/standard/rails/plugin.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Plugin

Returns a new instance of Plugin.



6
7
8
9
# File 'lib/standard/rails/plugin.rb', line 6

def initialize(config)
  @config = config
  @merges_upstream_metadata = LintRoller::Support::MergesUpstreamMetadata.new
end

Instance Method Details

#aboutObject



11
12
13
14
15
16
17
18
# File 'lib/standard/rails/plugin.rb', line 11

def about
  LintRoller::About.new(
    name: "standard-rails",
    version: VERSION,
    homepage: "https://github.com/testdouble/standard-rails",
    description: "Configuration for rubocop-rails rules"
  )
end

#rules(context) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/standard/rails/plugin.rb', line 24

def rules(context)
  trick_rubocop_into_thinking_we_required_rubocop_rails!

  LintRoller::Rules.new(
    type: :object,
    config_format: :rubocop,
    value: without_extended_rule_configs(
      rules_with_config_applied
    )
  )
end

#supported?(context) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/standard/rails/plugin.rb', line 20

def supported?(context)
  true
end