rbgithook 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rbgithook/pre-commit +2 -0
- data/.rubocop.yml +6 -0
- data/Gemfile.lock +2 -1
- data/README.md +4 -3
- data/exe/rbgithook +2 -3
- data/lib/rbgithook/version.rb +1 -1
- data/lib/rbgithook.rb +15 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f972f2dc37dc0d5ab6ee45fc28370053c0b987bb9e95f641e2a1f66ecdbc2e2
|
4
|
+
data.tar.gz: 4b3ac378a6315e18e945e1ada3021955227415e3b2ec2b690f0cad4fb219bb29
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f4b12920b3fa7c693baf53fe8f2a8669d72d35625b31fbdf9292bb7bc4d991c5c8e1208abfc8d84883afe5dd930f514e4fb0237a8ada1fe00e1be67dc07f9be
|
7
|
+
data.tar.gz: b29b5234694d0f17c44493eaf0d61a9a82eb87c9376dc409314f1cfd5570e9c184285551fed027ee452fdf834fc9c576676c258ff8159c11f5b91e3b3e3bc829
|
data/.rbgithook/pre-commit
CHANGED
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Rbgithook
|
2
2
|
|
3
|
-
|
3
|
+
Simple Git hook made by Ruby
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -22,8 +22,9 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
```
|
24
24
|
rbgithook install
|
25
|
-
rbgithook <file> <cmd> ex. rbgithook pre-commit "rspec spec/"
|
26
|
-
rbgithook
|
25
|
+
rbgithook set <file> <cmd> ex. rbgithook add pre-commit "rspec spec/"
|
26
|
+
rbgithook add <file> <cmd> ex. rbgithook add pre-commit "rubocop -a"
|
27
|
+
rbgithook uninstall
|
27
28
|
```
|
28
29
|
|
29
30
|
## Contributing
|
data/exe/rbgithook
CHANGED
data/lib/rbgithook/version.rb
CHANGED
data/lib/rbgithook.rb
CHANGED
@@ -10,15 +10,29 @@ module Rbgithook
|
|
10
10
|
system("git", "config", "core.hooksPath", dir)
|
11
11
|
end
|
12
12
|
|
13
|
-
def self.
|
13
|
+
def self.set(args)
|
14
14
|
file_name = args[0]
|
15
15
|
hook_command = args[1]
|
16
16
|
Dir.chdir(".rbgithook")
|
17
17
|
file = File.open(file_name.to_s, "w")
|
18
|
+
file.write("#!/usr/bin/env sh\n")
|
18
19
|
file.write(hook_command)
|
19
20
|
FileUtils.chmod(0o755, file_name)
|
20
21
|
end
|
21
22
|
|
23
|
+
def self.add(args)
|
24
|
+
file_name = args[0]
|
25
|
+
hook_command = args[1]
|
26
|
+
Dir.chdir(".rbgithook")
|
27
|
+
if File.exist?(file_name)
|
28
|
+
file = File.open(file_name.to_s, "a")
|
29
|
+
file.write("\n#{hook_command}")
|
30
|
+
FileUtils.chmod(0o755, file_name)
|
31
|
+
else
|
32
|
+
warn "File not found, please run `rbgithook set #{file_name} #{hook_command}`"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
22
36
|
def self.uninstall
|
23
37
|
system("git", "config", "--unset", "core.hooksPath")
|
24
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbgithook
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hyuraku
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Simple Git hook made by Ruby
|
14
14
|
email:
|