fit-commit 2.0.2 → 2.1.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/CHANGELOG.md +3 -0
- data/README.md +0 -1
- data/lib/fit-commit/cli.rb +5 -1
- data/lib/fit-commit/installer.rb +17 -1
- data/lib/fit-commit/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc18e42169af5f36c44a8a041cdbe3ce03f38052
|
4
|
+
data.tar.gz: 14de6fd71a86bc487f8a7e4433266317f787abc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4566013959f7022f744e99392616d2b20111fc1d69a283eb1eb0d75dadb78ba7135aadb039c623054b15e1dd33138d38f90dad4c153e7278e2dd2dc25d485c35
|
7
|
+
data.tar.gz: 1d764c8ace04ba170258b0dbdc3c2d74aebcd2d07089a9286deaa1efba8b6723473aa70e9f6167069431af58986b28b1c56155513a45fb43ed993c2449035f20
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
data/lib/fit-commit/cli.rb
CHANGED
@@ -10,11 +10,15 @@ module FitCommit
|
|
10
10
|
|
11
11
|
def execute
|
12
12
|
action_name = args.shift
|
13
|
-
|
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
|
data/lib/fit-commit/installer.rb
CHANGED
@@ -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
|
data/lib/fit-commit/version.rb
CHANGED
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
|
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-
|
11
|
+
date: 2015-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: swearjar
|