rubocop-rails_config 0.0.1 → 0.1.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 +4 -4
- data/lib/generators/rubocop_rails_config/update_generator.rb +31 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c47b7e5d6390a81fa212b6baad0d3f59ba4106277ccaa34a984a64be53a833b
|
4
|
+
data.tar.gz: a51629a1d8be14625b3612aa32d28c640b201fc7706eeebda7f5d716140f59ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4d02cb8fbc8dcac9c7ef0eabd2ee6d35507e33d421ae4a081083dd525a2c7d1e29ee269482887fc68a09a0723c4ca02986862038fb0deb971e97f8cb93f4995
|
7
|
+
data.tar.gz: e21d18073cb51e2d1eb718a8aefa6116bb6d82933a692f03f1bf0d5b8a51af04a350481800fa7b51cb853219320a063b35c1135fa3e0f96f2981dbf8c0974bd3
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rails/generators/base"
|
4
|
+
require "active_support/core_ext/string"
|
5
|
+
|
6
|
+
module RubocopRailsConfig
|
7
|
+
module Generators
|
8
|
+
class UpdateGenerator < Rails::Generators::Base
|
9
|
+
desc "Update a .rubocop.yml config file that is reanmed."
|
10
|
+
|
11
|
+
def update_config_file
|
12
|
+
if old_gem_name_used?
|
13
|
+
gsub_file config_file_path, "rubocop-rails:", "rubocop-rails_config:"
|
14
|
+
else
|
15
|
+
puts "Your conifg is up-to-date. Nothing to update."
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
# rubocop-rails is renamed to rubocop-rails_config
|
22
|
+
def old_gem_name_used?
|
23
|
+
File.foreach(config_file_path).grep(/\s+rubocop-rails:/).any?
|
24
|
+
end
|
25
|
+
|
26
|
+
def config_file_path
|
27
|
+
".rubocop.yml"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-rails_config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toshimaru
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-06-
|
11
|
+
date: 2018-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -93,6 +93,7 @@ files:
|
|
93
93
|
- lib/custom_cops.rb
|
94
94
|
- lib/custom_cops/refute_not.rb
|
95
95
|
- lib/generators/rubocop_rails_config/install_generator.rb
|
96
|
+
- lib/generators/rubocop_rails_config/update_generator.rb
|
96
97
|
homepage: https://github.com/toshimaru/rubocop-rails_config
|
97
98
|
licenses:
|
98
99
|
- MIT
|