Class: Standard::Rspec::Plugin

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

Instance Method Summary collapse

Instance Method Details

#aboutObject



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

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

#rules(context) ⇒ Object



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

def rules(context)
  rules_value = begin
    YAML.load_file(Pathname.new(__dir__).join("../../../config/base.yml"), aliases: true)
  rescue ArgumentError
    YAML.load_file(Pathname.new(__dir__).join("../../../config/base.yml"))
  end

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

#supported?(context) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/standard/rspec/plugin.rb', line 19

def supported?(context)
  true
end