overcommit_config 0.1.1 → 0.1.2
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 +2 -0
- data/bin/overcommit_config +3 -0
- data/lib/overcommit_config.rb +11 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dec52b9f7b7c8d663aa336df61198b10f42a9ae5
|
4
|
+
data.tar.gz: ada1c2955ef88d02c535f63acb7020f0ae633eb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2301b32079e6128d19bc020aaca554281457363a6a345531c990b58f02eb301cccbfcdcb0588cade4566bb33e0e862fa5ad37bfa7a4d9aab122f3743b37f5e62
|
7
|
+
data.tar.gz: 91189ce1580bc25417d9d02424952e856d91ae46bb6527ed777d8f6fcb800c10647fe85c050e8076e8aac07f87b29f91a5222658387ed2596cbdecd2988549f2
|
data/README.md
CHANGED
@@ -8,6 +8,8 @@
|
|
8
8
|
|
9
9
|
Run `overcommit_config`
|
10
10
|
|
11
|
+
You do not need to run `overcommit --install` . This gem install hooks into current repository automatically.
|
12
|
+
|
11
13
|
After that, when your commit has any offense, a report with html format will be created in the root of application with name current_date-rubocop.html. A hook failing in this case does not prevent the commit since it has already noted.
|
12
14
|
|
13
15
|
**Note**
|
data/bin/overcommit_config
CHANGED
data/lib/overcommit_config.rb
CHANGED
@@ -19,6 +19,17 @@ class OvercommitConfig
|
|
19
19
|
config = ERB.new(File.read(script_file)).result
|
20
20
|
File.open(file_name, "w") { |f| f << config }
|
21
21
|
FileUtils.chmod("a+x", file_name)
|
22
|
+
update_overcommit_config
|
23
|
+
install_overcommit
|
24
|
+
end
|
25
|
+
|
26
|
+
# Update overcommit config
|
27
|
+
def update_overcommit_config
|
22
28
|
exec 'overcommit --sign' rescue nil
|
23
29
|
end
|
30
|
+
|
31
|
+
# Install Overcommit hooks in current app
|
32
|
+
def install_overcommit
|
33
|
+
exec 'overcommit --install' rescue nil
|
34
|
+
end
|
24
35
|
end
|