githookify 0.1.0 → 0.3.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/justfile +11 -0
- data/lib/githookify/cli.rb +2 -1
- data/lib/githookify/setup.rb +8 -0
- data/lib/githookify/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c67d9287216ca4104e27121d3ac5505840b520814ed54b89e335b5aa5838d19d
|
4
|
+
data.tar.gz: c7a047ff228b7f71b90e4f092eebefb75b03516fd869042300757be169dd7498
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c95278a1961fdec9db0544a126b8d55784ab8e30b0c36f04d592e9765ec6583fb722bd624a1412489594bbf5cc7299dcf0846a39ea408ba11bde5edd37b51670
|
7
|
+
data.tar.gz: 1f59a2d7e284708fc3e2786b1060d9110e7200d16ef35dc76dd9df4718a8eca1d291936358794858ce5f1f91e67df43e9424b68ec02cc70265d56e82161c49ca
|
data/justfile
ADDED
data/lib/githookify/cli.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
require 'rake'
|
2
2
|
require 'thor'
|
3
|
+
require 'githookify/version'
|
3
4
|
require 'githookify/setup'
|
4
5
|
|
5
6
|
module Githookify
|
6
7
|
class CLI < Thor
|
7
8
|
desc "version", "Print version"
|
8
9
|
def version
|
9
|
-
puts
|
10
|
+
puts Githookify::VERSION
|
10
11
|
end
|
11
12
|
|
12
13
|
desc "setup", "Setup the .githooks directory"
|
data/lib/githookify/setup.rb
CHANGED
@@ -3,10 +3,18 @@ module Githookify
|
|
3
3
|
HOOKS = %w[applypatch-msg commit-msg fsmonitor-watchman post-update pre-applypatch pre-commit pre-merge-commit pre-push pre-rebase pre-receive prepare-commit-msg update]
|
4
4
|
|
5
5
|
def self.install
|
6
|
+
create_rakefile
|
6
7
|
create_directories
|
7
8
|
remove_sample_hooks
|
8
9
|
end
|
9
10
|
|
11
|
+
def self.create_rakefile
|
12
|
+
unless File.exist?('Rakefile')
|
13
|
+
rakefile_content = "task :default\n"
|
14
|
+
File.write('Rakefile', rakefile_content)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
10
18
|
def self.create_directories
|
11
19
|
Dir.mkdir('.githooks') unless Dir.exist?('.githooks')
|
12
20
|
Dir.mkdir('.githooks/tasks') unless Dir.exist?('.githooks/tasks')
|
data/lib/githookify/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: githookify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Antonio Nardini
|
@@ -53,6 +53,7 @@ files:
|
|
53
53
|
- README.md
|
54
54
|
- Rakefile
|
55
55
|
- bin/githookify
|
56
|
+
- justfile
|
56
57
|
- lib/githookify.rb
|
57
58
|
- lib/githookify/cli.rb
|
58
59
|
- lib/githookify/setup.rb
|