git-fyncy 0.7.1 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/README.md +1 -1
- data/lib/git-fyncy.rb +19 -5
- data/lib/git-fyncy/synchronizer.rb +0 -1
- data/lib/git-fyncy/version.rb +1 -1
- data/local +6 -0
- metadata +17 -11
data/.gitignore
CHANGED
data/README.md
CHANGED
data/lib/git-fyncy.rb
CHANGED
@@ -4,19 +4,28 @@ require 'listen'
|
|
4
4
|
|
5
5
|
module GitFyncy
|
6
6
|
extend Utils
|
7
|
-
PID_FNAME = ".git
|
7
|
+
PID_FNAME = ".git/fyncy-pid".freeze
|
8
|
+
|
9
|
+
def self.old_pid
|
10
|
+
@_old_pid ||= File.read(PID_FNAME).to_i
|
11
|
+
end
|
8
12
|
|
9
13
|
def self.already_running?
|
10
|
-
File.exists? PID_FNAME
|
14
|
+
return false unless File.exists? PID_FNAME
|
15
|
+
begin
|
16
|
+
Process.kill 0, old_pid
|
17
|
+
true
|
18
|
+
rescue Errno::ESRCH
|
19
|
+
false
|
20
|
+
end
|
11
21
|
end
|
12
22
|
|
13
23
|
def self.kill
|
14
24
|
if already_running?
|
15
|
-
|
16
|
-
if Process.kill "TERM", pid
|
25
|
+
if Process.kill "TERM", old_pid
|
17
26
|
File.delete PID_FNAME
|
18
27
|
else
|
19
|
-
pexit "Failed to kill process with id #{
|
28
|
+
pexit "Failed to kill process with id #{old_pid}"
|
20
29
|
end
|
21
30
|
else
|
22
31
|
pexit "No process to kill. No #{PID_FNAME} file."
|
@@ -44,6 +53,11 @@ module GitFyncy
|
|
44
53
|
pexit "\nGIT FYNCY: First remote command failed, exiting"
|
45
54
|
end
|
46
55
|
|
56
|
+
File.write PID_FNAME, Process.pid
|
57
|
+
trap("INT") do
|
58
|
+
File.delete PID_FNAME
|
59
|
+
pexit "Exiting happily!"
|
60
|
+
end
|
47
61
|
synchronizer.listen
|
48
62
|
end
|
49
63
|
end
|
data/lib/git-fyncy/version.rb
CHANGED
data/local
ADDED
metadata
CHANGED
@@ -1,27 +1,32 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-fyncy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.1
|
5
4
|
prerelease:
|
5
|
+
version: 0.8.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Ryan McGowan
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-10-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
|
16
|
-
requirement: &11491800 !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
15
|
+
version_requirements: !ruby/object:Gem::Requirement
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '1.3'
|
20
|
+
none: false
|
21
|
+
name: listen
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
|
24
|
+
requirement: !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - ~>
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: '1.3'
|
29
|
+
none: false
|
25
30
|
description: The funky git aware syncer.
|
26
31
|
email:
|
27
32
|
- ryan@ryanmcg.com
|
@@ -45,6 +50,7 @@ files:
|
|
45
50
|
- lib/git-fyncy/synchronizer.rb
|
46
51
|
- lib/git-fyncy/utils.rb
|
47
52
|
- lib/git-fyncy/version.rb
|
53
|
+
- local
|
48
54
|
homepage: https://github.com/RyanMcG/git-fyncy
|
49
55
|
licenses:
|
50
56
|
- MIT
|
@@ -53,20 +59,20 @@ rdoc_options: []
|
|
53
59
|
require_paths:
|
54
60
|
- lib
|
55
61
|
required_ruby_version: !ruby/object:Gem::Requirement
|
56
|
-
none: false
|
57
62
|
requirements:
|
58
|
-
- -
|
63
|
+
- - '>='
|
59
64
|
- !ruby/object:Gem::Version
|
60
65
|
version: '0'
|
61
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
66
|
none: false
|
67
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
63
68
|
requirements:
|
64
|
-
- -
|
69
|
+
- - '>='
|
65
70
|
- !ruby/object:Gem::Version
|
66
71
|
version: '0'
|
72
|
+
none: false
|
67
73
|
requirements: []
|
68
74
|
rubyforge_project:
|
69
|
-
rubygems_version: 1.8.
|
75
|
+
rubygems_version: 1.8.23.2
|
70
76
|
signing_key:
|
71
77
|
specification_version: 3
|
72
78
|
summary: Want to sync the working directories of your git directory with a remote
|