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 CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ vendor/bundle
data/README.md CHANGED
@@ -20,7 +20,7 @@ Or install it yourself as:
20
20
 
21
21
  Sync the current working directory to the given path on the given remote:
22
22
 
23
- $ git fyncy <remote> <path>
23
+ $ git fyncy [--kill | --fork] [RSYNC_ARGS...]
24
24
 
25
25
  ## Contributing
26
26
 
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-fyncy-pid".freeze
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
- pid = File.read(PID_FNAME).to_i
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 #{pid}"
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
@@ -50,7 +50,6 @@ module GitFyncy
50
50
  def daemonize
51
51
  pid = fork
52
52
  if pid # parent
53
- File.write ".git-fyncy-pid", pid
54
53
  Process.detach pid
55
54
  exit 0
56
55
  end
@@ -1,3 +1,3 @@
1
1
  module GitFyncy
2
- VERSION = "0.7.1"
2
+ VERSION = "0.8.0"
3
3
  end
data/local ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), "lib")
3
+
4
+ require 'git-fyncy'
5
+
6
+ GitFyncy.main(ARGV)
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-03-24 00:00:00.000000000 Z
12
+ date: 2015-10-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: listen
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
- version_requirements: *11491800
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.11
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