rubocop_default_config 0.1.3 → 0.1.4
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/README.md +3 -1
- data/bin/rubocop_config +1 -1
- data/bin/rubocop_gen_common +5 -0
- data/lib/.rubocop_default_config.yml +7 -0
- data/lib/rubocop_config.rb +17 -4
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3692cbd73d421269b7f5d218436fde736f38007
|
4
|
+
data.tar.gz: f878a4a157e338faa9cff4f5693cbfd3d21c8962
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37434cf589bbc57a9e8aecfef0e82291445a1149922a91d4a262b07f448c132e8d3bfc5c9f762b4c2a02b352fbed3505d35edf7d0fbaee1971f7daafc5399809
|
7
|
+
data.tar.gz: d804d333bfd305b0b224f65fc7cf673e6c4f9cba819d461fa8e8e99f254161683d6f4c940678b5bb8ace47ca9741f8d76f26d9bcf30e7773006d14d76bd8af01
|
data/README.md
CHANGED
@@ -10,7 +10,9 @@ Run `rubocop-config`
|
|
10
10
|
|
11
11
|
**Note**
|
12
12
|
|
13
|
-
This gem will generates *.rubocop.yml* & *.rubocop_todo.yml* config automatically. So, you do not need to run `rubocop --auto-gen-config`
|
13
|
+
This gem will generates *.rubocop.yml* & *.rubocop_todo.yml* config automatically. So, you do not need to run `rubocop --auto-gen-config` .
|
14
|
+
|
15
|
+
Just run `rubocop_gen_common` if you want to generate Rubocop popular config. Then you can edit it to match your style.
|
14
16
|
|
15
17
|
## License
|
16
18
|
|
data/bin/rubocop_config
CHANGED
data/lib/rubocop_config.rb
CHANGED
@@ -3,13 +3,26 @@ require "yaml"
|
|
3
3
|
class RubocopConfig
|
4
4
|
# Generate popular config for RuboCop.
|
5
5
|
# Run *rubocop_config* to generate .rubocop.yml file.
|
6
|
-
|
7
|
-
|
6
|
+
|
7
|
+
def generate_to_do_list
|
8
|
+
generate_default_config
|
9
|
+
puts "Generating rubocop todo config ..."
|
10
|
+
exec 'rubocop --auto-gen-config --exclude-limit 9999' rescue nil
|
11
|
+
end
|
12
|
+
|
13
|
+
def generate_default_config
|
14
|
+
puts 'Generating rubocop default config ...'
|
15
|
+
file_name = ".rubocop.yml"
|
16
|
+
config_file = File.expand_path File.dirname(__FILE__) + '/.rubocop_default_config.yml'
|
17
|
+
config = YAML.safe_load(ERB.new(File.read(config_file)).result)
|
18
|
+
File.open(file_name, "w") { |f| f << config.to_yaml }
|
19
|
+
end
|
20
|
+
|
21
|
+
def generate_common_config
|
22
|
+
puts "Generating rubocop common config ..."
|
8
23
|
file_name = ".rubocop.yml"
|
9
24
|
config_file = File.expand_path File.dirname(__FILE__) + '/.rubocop_popular_config.yml'
|
10
25
|
config = YAML.safe_load(ERB.new(File.read(config_file)).result)
|
11
26
|
File.open(file_name, "w") { |f| f << config.to_yaml }
|
12
|
-
puts "Generating rubocop todo config ..."
|
13
|
-
exec 'rubocop --auto-gen-config' rescue nil
|
14
27
|
end
|
15
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop_default_config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thai Huynh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -56,11 +56,14 @@ description: A simple gem to generate default config for RuboCop
|
|
56
56
|
email: qthai.huynh@gmail.com
|
57
57
|
executables:
|
58
58
|
- rubocop_config
|
59
|
+
- rubocop_gen_common
|
59
60
|
extensions: []
|
60
61
|
extra_rdoc_files: []
|
61
62
|
files:
|
62
63
|
- README.md
|
63
64
|
- bin/rubocop_config
|
65
|
+
- bin/rubocop_gen_common
|
66
|
+
- lib/.rubocop_default_config.yml
|
64
67
|
- lib/.rubocop_popular_config.yml
|
65
68
|
- lib/rubocop_config.rb
|
66
69
|
homepage: http://rubygems.org/gems/rubocop_default_config
|