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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4ed27752f2abc7ec234f28ddb9026c4794b66fd9e517df5b1968e83d241d5694
4
- data.tar.gz: f45e2deb1ac951b57b7efcce57117d9116a6e82eedcbc62d621ab89aca78fe77
3
+ metadata.gz: c67d9287216ca4104e27121d3ac5505840b520814ed54b89e335b5aa5838d19d
4
+ data.tar.gz: c7a047ff228b7f71b90e4f092eebefb75b03516fd869042300757be169dd7498
5
5
  SHA512:
6
- metadata.gz: 1fa6a0f4b154ee349be6b4d12493431cae298383582578de3afe43df1356b92ab577bc2d87a44a4d6238fb59088d41700e4ef1ebba9424ae9e0dde6b83b354aa
7
- data.tar.gz: 1a6177e170ed1917f2e0080731ef35b13060e14e01d6210d5d616f3a9f29d566dd8404000c27ced23cd1eeeba2a56e59fcfbc6817f6ba2020ed9fcdd46bc08c5
6
+ metadata.gz: c95278a1961fdec9db0544a126b8d55784ab8e30b0c36f04d592e9765ec6583fb722bd624a1412489594bbf5cc7299dcf0846a39ea408ba11bde5edd37b51670
7
+ data.tar.gz: 1f59a2d7e284708fc3e2786b1060d9110e7200d16ef35dc76dd9df4718a8eca1d291936358794858ce5f1f91e67df43e9424b68ec02cc70265d56e82161c49ca
data/justfile ADDED
@@ -0,0 +1,11 @@
1
+ # this list
2
+ default:
3
+ @just --list --unsorted
4
+
5
+ # build and install gem
6
+ install:
7
+ bundle exec rake install
8
+
9
+ # push the gem to rubygems.org
10
+ release:
11
+ bundle exec rake release
@@ -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 ::Githookify::VERSION
10
+ puts Githookify::VERSION
10
11
  end
11
12
 
12
13
  desc "setup", "Setup the .githooks directory"
@@ -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')
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Githookify
4
- VERSION = "0.1.0"
4
+ VERSION = "0.3.0"
5
5
  end
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.1.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