standard-rspec 0.1.7 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8c146e87b1a3fd58a9374a1f36508177f3a4353debf1af3abb6db111b09fdf04
4
- data.tar.gz: d8051730ed43a0dd995087f967c10f590798c2397275ee2b46ca2b6b39c7877f
3
+ metadata.gz: ec0d895ae8406f45ab179d5e65bdc1b48991fbf5bb4289482e7e522eabb6076a
4
+ data.tar.gz: 13acd1dec3ed2caa7bc09bf9326ec17ca39f851ee613be2c97e1226354cc3b1d
5
5
  SHA512:
6
- metadata.gz: 9e90d48fe4c384f124ed85a6e5cbf1f779dd6cc1b040b33866d4ccdc14ba7632ecf9d1395c1d85fb8c354cfb1c972efcf5dfb2202747ebf88db9309a734a9048
7
- data.tar.gz: cca609b163c279cc608e223a318c9fe62655c88f869bb30c62867158664cf3e5ad4ad7e65e84ecaba150bdd37b0d027244a76be335079a0f385665b996cbc2c8
6
+ metadata.gz: 4387f0c1fb54c3cb8967944c56f1d4f8bb9e75dc5e7a456cf423ed6c7892cfdc673aa385b2e93b84a3125ad8056665a8fbb87b0a29459a7a1192126b6188edcd
7
+ data.tar.gz: 15d71effe85f755dbfecd875acef1ce65454538a7ffbd91b5b2a078a74d7a84c16d2f105fba9f697e90f41ce0877a77cedc3ef6b095156dcb13923ff2c44ed67
@@ -3,6 +3,10 @@ require "yaml"
3
3
  module Standard
4
4
  module Rspec
5
5
  class Plugin < LintRoller::Plugin
6
+ def initialize(config)
7
+ @config = config
8
+ end
9
+
6
10
  def about
7
11
  LintRoller::About.new(
8
12
  name: "standard-rspec",
@@ -22,12 +26,20 @@ module Standard
22
26
  LintRoller::Rules.new(
23
27
  type: :object,
24
28
  config_format: :rubocop,
25
- value: YAML.load_file(Pathname.new(__dir__).join("../../../config/base.yml"), aliases: true)
29
+ value: rules_with_config_applied
26
30
  )
27
31
  end
28
32
 
29
33
  private
30
34
 
35
+ def rules_with_config_applied
36
+ YAML.load_file(Pathname.new(__dir__).join("../../../config/base.yml"), aliases: true).tap do |rules|
37
+ if @config["action_policy_enabled"]
38
+ rules["inherit_gem"] = { "action_policy" => "config/rubocop-rspec.yml" }
39
+ end
40
+ end
41
+ end
42
+
31
43
  # This is not fantastic.
32
44
  #
33
45
  # When you `require "rubocop-rspec"`, it will not only load the cops,
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Standard
4
4
  module Rspec
5
- VERSION = "0.1.7"
5
+ VERSION = "0.2.0"
6
6
  end
7
7
  end
@@ -1,4 +1,5 @@
1
1
  require "lint_roller"
2
+ require "action_policy"
2
3
 
3
4
  require_relative "rspec/version"
4
5
  require_relative "rspec/plugin"
@@ -34,4 +34,5 @@ Gem::Specification.new do |spec|
34
34
  spec.add_dependency "lint_roller", "~> 1.0"
35
35
  spec.add_dependency "rubocop-rspec", "~> 2.22.0"
36
36
  spec.add_dependency "rubocop-factory_bot", "~> 2.22"
37
+ spec.add_dependency "action_policy", "~> 0.6.5"
37
38
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: standard-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - shilin-anton
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '2.22'
55
+ - !ruby/object:Gem::Dependency
56
+ name: action_policy
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.6.5
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.6.5
55
69
  description:
56
70
  email:
57
71
  - anton.d.shilin@gmail.com