rdoc_rubocop 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b63973fa39336e9076bf266fbc9b1befa5b72bf3f05216ced86702327fd7794
4
- data.tar.gz: b5945fcaf720a68e50c0d588f974c5f40c3a68006625a063a89c58e774295895
3
+ metadata.gz: bc7dd7e8471a9d59a7668685147fb01cca5e276e5d11bf2ac53db9be878ac69e
4
+ data.tar.gz: 8ba0104b9af90e5ef95795e41c7ca47bc668e7eaf933db7eaea50ff6ba2ced16
5
5
  SHA512:
6
- metadata.gz: c577e35ba541ad0f951fdc1ec9e0a619418cc16006a7d52124174c85aba0ead6c1cf385689d63fb54473338ee8d10d0a1f91435d78bfcff8c3183faab5f609dc
7
- data.tar.gz: 9972b60eb46eeca29766a215bb27a80ccefe0c50860565cf73a35a4ec2c91d6d01f00ec9b0c5aa259370412069b3e31022377f50d9a61c3432da8b2c90d7f246
6
+ metadata.gz: 581b246e948d31063d973ff5c3ef8bf767fc1be7859815b4a7c90317d55239177cabf20df7ab8d3c916a966d61e32c1144babcb52d6b4731d7b6bff7f12c404c
7
+ data.tar.gz: d7e5fb782c2282cd52063d5fa685bfea0ff5c801e584f096320d330be125676f4f76ca7cf8caa606ce176feb0a2cfba2e851b4e63044083f825fec3d8fe5e43e
data/README.md CHANGED
@@ -56,6 +56,12 @@ Or install it yourself as:
56
56
  # Generate .rdoc_rubocop.yml and .rdoc_rubocop_todo.yml
57
57
  $ rdoc-rubocop --auto-gen-config
58
58
 
59
+ # If .rubocop.yml already exists, and apply same cops to RDoc, edit .rdoc_rubocop.yml:
60
+ #
61
+ # inherit_from: .rubocop.yml
62
+ # Style/FrozenStringLiteralComment:
63
+ # Enabled: false
64
+
59
65
  # Correct the code
60
66
  $ rdoc-rubocop -a
61
67
 
@@ -57,13 +57,33 @@ module RDocRuboCop
57
57
  end
58
58
  end
59
59
  end
60
+
61
+ module ConfigLoaderModifier
62
+ DOTFILE = ".rdoc_rubocop.yml".freeze
63
+ AUTO_GENERATED_FILE = ".rdoc_rubocop_todo.yml".freeze
64
+
65
+ def change_dotfilenames_temporary
66
+ dotfile_backup = RuboCop::ConfigLoader::DOTFILE
67
+ auto_generated_file_backup = RuboCop::ConfigLoader::AUTO_GENERATED_FILE
68
+
69
+ redefine_const(:DOTFILE, DOTFILE)
70
+ redefine_const(:AUTO_GENERATED_FILE, AUTO_GENERATED_FILE)
71
+
72
+ yield
73
+ ensure
74
+ redefine_const(:DOTFILE, dotfile_backup)
75
+ redefine_const(:AUTO_GENERATED_FILE, auto_generated_file_backup)
76
+ end
77
+
78
+ private
79
+
80
+ def redefine_const(const_name, value)
81
+ RuboCop::ConfigLoader.send(:remove_const, const_name)
82
+ RuboCop::ConfigLoader.const_set(const_name, value)
83
+ end
84
+ end
60
85
  end
61
86
  end
62
87
 
63
88
  RuboCop::Runner.prepend RDocRuboCop::RuboCopModifier::RunnerModifier
64
89
  RuboCop::Cop::Team.prepend RDocRuboCop::RuboCopModifier::TeamModifier
65
-
66
- RuboCop::ConfigLoader.send(:remove_const, :DOTFILE)
67
- RuboCop::ConfigLoader.const_set(:DOTFILE, ".rdoc_rubocop.yml".freeze)
68
- RuboCop::ConfigLoader.send(:remove_const, :AUTO_GENERATED_FILE)
69
- RuboCop::ConfigLoader.const_set(:AUTO_GENERATED_FILE, ".rdoc_rubocop_todo.yml".freeze)
@@ -44,8 +44,13 @@ module RDocRuboCop
44
44
  end
45
45
  end
46
46
 
47
+ require "rdoc_rubocop/rubocop_modifier"
48
+ include RDocRuboCop::RuboCopModifier::ConfigLoaderModifier
49
+
47
50
  def run_cli(source_code_file_paths)
48
- @cli.run(@options + source_code_file_paths)
51
+ change_dotfilenames_temporary do
52
+ @cli.run(@options + source_code_file_paths)
53
+ end
49
54
  end
50
55
 
51
56
  def source_files
@@ -1,3 +1,3 @@
1
1
  module RDocRuboCop
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdoc_rubocop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Loose Coupling
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-12-24 00:00:00.000000000 Z
11
+ date: 2018-12-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop