git-fyncy 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/git-fyncy/version.rb +1 -1
- data/lib/git-fyncy.rb +17 -11
- metadata +2 -8
data/lib/git-fyncy/version.rb
CHANGED
data/lib/git-fyncy.rb
CHANGED
@@ -15,7 +15,7 @@ module GitFyncy
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def command(cmd)
|
18
|
-
puts cmd
|
18
|
+
puts cmd.length < 80 ? cmd : cmd[0...77] + '...'
|
19
19
|
system cmd
|
20
20
|
end
|
21
21
|
|
@@ -36,7 +36,7 @@ module GitFyncy
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def self.git_aware_files
|
39
|
-
`git ls-files
|
39
|
+
`git ls-files`.split("\n")
|
40
40
|
end
|
41
41
|
|
42
42
|
def self.git_aware_of_path?(path)
|
@@ -48,22 +48,28 @@ module GitFyncy
|
|
48
48
|
exit 1
|
49
49
|
end
|
50
50
|
|
51
|
-
def self.main(remote, path)
|
51
|
+
def self.main(remote, path, working_dir=nil)
|
52
|
+
working_dir ||= Dir.pwd
|
53
|
+
Dir.chdir working_dir
|
52
54
|
pexit 'A remote and path must be specified' unless remote && path
|
53
55
|
remote = Remote.new remote, path
|
54
56
|
remote.scp git_aware_files
|
55
57
|
relpath = method :relative_path
|
56
58
|
|
57
59
|
files_to_remove = Set.new
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
60
|
+
begin
|
61
|
+
Listen.to!('.') do |modified, added, removed|
|
62
|
+
begin
|
63
|
+
remote.scp git_aware_files
|
64
|
+
rel_removed = removed.map(&relpath)
|
65
|
+
files_to_remove.merge rel_removed
|
66
|
+
files_to_remove.clear if remote.ssh_rm files_to_remove
|
67
|
+
rescue => e
|
68
|
+
puts e.inspect
|
69
|
+
end
|
66
70
|
end
|
71
|
+
rescue SignalException
|
72
|
+
exit 42
|
67
73
|
end
|
68
74
|
end
|
69
75
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-fyncy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-08-
|
12
|
+
date: 2013-08-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: listen
|
@@ -58,18 +58,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
58
58
|
- - ! '>='
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '0'
|
61
|
-
segments:
|
62
|
-
- 0
|
63
|
-
hash: -4174756479981268395
|
64
61
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
62
|
none: false
|
66
63
|
requirements:
|
67
64
|
- - ! '>='
|
68
65
|
- !ruby/object:Gem::Version
|
69
66
|
version: '0'
|
70
|
-
segments:
|
71
|
-
- 0
|
72
|
-
hash: -4174756479981268395
|
73
67
|
requirements: []
|
74
68
|
rubyforge_project:
|
75
69
|
rubygems_version: 1.8.23
|