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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 26c9252964f2b6225eec68eca259ce2ee6b92344
4
- data.tar.gz: a46bbd58b7aa943931cbf16d9477c33ccd058ed0
3
+ metadata.gz: dec52b9f7b7c8d663aa336df61198b10f42a9ae5
4
+ data.tar.gz: ada1c2955ef88d02c535f63acb7020f0ae633eb4
5
5
  SHA512:
6
- metadata.gz: 77e8a1a958b6689b99c15c5d0a875b70113ff9edeb64e13041e9b9dc67c9b3da823eaa90238066349d4e8a330145b7ba90b3ada59a74d7a38509f2363992b33b
7
- data.tar.gz: a62ab26fac7807c7368990c6fb151d43c7ec67d747b6e07854f9b0b2f9d9ea26f644b29d279821848234d30b1945e6e0d21d9f508657ad97695219c7138916a1
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**
@@ -1,2 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
1
4
  require 'overcommit_config'
2
5
  OvercommitConfig.new.generate_config
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: overcommit_config
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
  - Thai Huynh