fit-commit 2.0.2 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aabcc0d7d9ae18205dc7f0ffc39b7b6bff65e031
4
- data.tar.gz: d844c683caef5cbb416b386c8c59b0f59000dcb0
3
+ metadata.gz: bc18e42169af5f36c44a8a041cdbe3ce03f38052
4
+ data.tar.gz: 14de6fd71a86bc487f8a7e4433266317f787abc1
5
5
  SHA512:
6
- metadata.gz: 9151e4ed2c5e082b43cdd7acbfd19ac11bf6829aba734f505f3402a96686414800c9a0c820d03a5812aa5ddb39b04841d1f8c9be6e9c2b48d97d98ce5245026a
7
- data.tar.gz: 9fdc57be60a116531a48fd88aa5d1d7d0ff232d6b01b47a255390b25f99bcec7c92a8ded4b2c82aeb32656f0e629378723ff7494f4d185077e5080a6076fa7b3
6
+ metadata.gz: 4566013959f7022f744e99392616d2b20111fc1d69a283eb1eb0d75dadb78ba7135aadb039c623054b15e1dd33138d38f90dad4c153e7278e2dd2dc25d485c35
7
+ data.tar.gz: 1d764c8ace04ba170258b0dbdc3c2d74aebcd2d07089a9286deaa1efba8b6723473aa70e9f6167069431af58986b28b1c56155513a45fb43ed993c2449035f20
data/CHANGELOG.md CHANGED
@@ -3,6 +3,9 @@
3
3
  ### master
4
4
  - N/A
5
5
 
6
+ ### v2.1.0 (2015-08-29)
7
+ - Add `fit-commit uninstall` command
8
+
6
9
  ### v2.0.0 (2015-08-27)
7
10
  - Breaking changes made to Git hook. If upgrading from an older version you'll need to re-run `fit-commit install` in your repos.
8
11
 
data/README.md CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  # Fit Commit
3
2
 
4
3
  A Git hook to validate your commit messages, based largely on Tim Pope's [authoritative guide](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
@@ -10,11 +10,15 @@ module FitCommit
10
10
 
11
11
  def execute
12
12
  action_name = args.shift
13
- if action_name == "install"
13
+ case action_name
14
+ when "install"
14
15
  FitCommit::Installer.new.install
16
+ when "uninstall"
17
+ FitCommit::Installer.new.uninstall
15
18
  else
16
19
  warn "fit-commit v#{FitCommit::VERSION}"
17
20
  warn "Usage: fit-commit install"
21
+ warn "Usage: fit-commit uninstall"
18
22
  false
19
23
  end
20
24
  end
@@ -8,7 +8,16 @@ module FitCommit
8
8
  FileUtils.mkdir_p(File.dirname(hook_path))
9
9
  FileUtils.cp(HOOK_TEMPLATE_PATH, hook_path)
10
10
  FileUtils.chmod(0755, hook_path)
11
- puts "Installed hook to #{hook_path}"
11
+ $stdout.puts "Installed hook to #{hook_path}"
12
+ true
13
+ end
14
+
15
+ def uninstall
16
+ if delete_hook
17
+ $stdout.puts "Deleted hook at #{hook_path}"
18
+ else
19
+ $stdout.puts "Hook not found at #{hook_path}"
20
+ end
12
21
  true
13
22
  end
14
23
 
@@ -25,5 +34,12 @@ module FitCommit
25
34
  File.readlines(".git").first.match(/gitdir: (.*)$/)[1]
26
35
  end
27
36
  end
37
+
38
+ def delete_hook
39
+ deleted_count = File.delete(hook_path)
40
+ deleted_count > 0
41
+ rescue Errno::ENOENT
42
+ false
43
+ end
28
44
  end
29
45
  end
@@ -1,3 +1,3 @@
1
1
  module FitCommit
2
- VERSION = "2.0.2"
2
+ VERSION = "2.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fit-commit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Foley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-28 00:00:00.000000000 Z
11
+ date: 2015-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: swearjar