rbfs 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/rbfs/rsync.rb +24 -6
  2. data/lib/rbfs/version.rb +1 -1
  3. metadata +8 -8
data/lib/rbfs/rsync.rb CHANGED
@@ -5,20 +5,38 @@ module Rbfs
5
5
  @host = host
6
6
  end
7
7
 
8
- def sync
9
- args = ["-ae", "ssh", "--delete", @config[:root], "#{@host.ip}:#{@config[:root]}"]
8
+ def logger
9
+ @config[:logger]
10
+ end
11
+
12
+ def remote_url
13
+ "#{@host.ip}:#{@config[:root]}"
14
+ end
15
+
16
+ def mkdir
17
+ args = [remote_url, "mkdir", "-p", @config[:root]]
18
+ command("ssh", args)
19
+ end
20
+
21
+ def rsync
22
+ args = ["-ae", "ssh", "--delete", @config[:root], remote_url]
10
23
  args << "-v" if @config[:verbose]
11
24
  args << "-n" if @config[:dry]
12
25
  args << "--timeout=#{@config[:timeout]}" if @config[:timeout]
13
- output = command("rsync", args)
14
- exitcode = $?
15
- {:output => output, :exitcode => exitcode}
26
+ command("rsync", args)
27
+ end
28
+
29
+ def sync
30
+ mkdir
31
+ rsync
16
32
  end
17
33
 
18
34
  def command(cmd, options = [], &block)
19
35
  cmd_line = "#{cmd} "
20
36
  cmd_line += options.join(' ')
21
- run_command(cmd_line, &block)
37
+ output = run_command(cmd_line, &block)
38
+ exitcode = $?
39
+ {:output => output, :exitcode => exitcode}
22
40
  end
23
41
 
24
42
  def run_command(cmd, &block)
data/lib/rbfs/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rbfs
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbfs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-19 00:00:00.000000000Z
12
+ date: 2013-07-23 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
16
- requirement: &10443800 !ruby/object:Gem::Requirement
16
+ requirement: &19391000 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '1.3'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *10443800
24
+ version_requirements: *19391000
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &10443280 !ruby/object:Gem::Requirement
27
+ requirement: &19389640 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *10443280
35
+ version_requirements: *19389640
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &10442500 !ruby/object:Gem::Requirement
38
+ requirement: &19387580 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *10442500
46
+ version_requirements: *19387580
47
47
  description: Ruby File Sync
48
48
  email:
49
49
  - jbussdieker@gmail.com