six-rsync 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/Rakefile +1 -1
  2. data/lib/six/rsync/lib.rb +15 -5
  3. data/lib/six/rsync.rb +1 -1
  4. metadata +1 -1
data/Rakefile CHANGED
@@ -12,7 +12,7 @@ require 'rake/testtask'
12
12
 
13
13
  spec = Gem::Specification.new do |s|
14
14
  s.name = 'six-rsync'
15
- s.version = '0.1.2'
15
+ s.version = '0.1.3'
16
16
  s.has_rdoc = true
17
17
  s.extra_rdoc_files = ['README', 'LICENSE']
18
18
  s.summary = 'Your summary here'
data/lib/six/rsync/lib.rb CHANGED
@@ -6,6 +6,9 @@
6
6
  module Six
7
7
  module Repositories
8
8
  module Rsync
9
+ # TODO: Configure somewhere!
10
+ KEY = "C:/users/sb/documents/keys/id_rsa.ppk"
11
+ RSH = "-r --rsh=\"'#{File.join(BASE_PATH, "tools", "cygnative.exe")}' plink.exe -i #{KEY}\""
9
12
  DIR_RSYNC = '.rsync'
10
13
  DIR_PACK = File.join(DIR_RSYNC, '.pack')
11
14
  REGEX_FOLDER = /(.*)[\\|\/](.*)/
@@ -132,6 +135,9 @@ module Six
132
135
  arr_opts = []
133
136
  arr_opts << PARAMS
134
137
  arr_opts += x_opts
138
+ if host[/\A(\w)*\@/]
139
+ arr_opts << RSH#"-e ssh"
140
+ end
135
141
 
136
142
  # TODO: UNCLUSTERFUCK
137
143
  arr_opts << esc(File.join(host, '.pack/.'))
@@ -318,8 +324,8 @@ module Six
318
324
  cmd = ''
319
325
  save_repos(:local)
320
326
 
321
- # TODO: Change to repositories.yml
322
327
  host = config[:hosts].sample
328
+
323
329
  verfile_srv = File.join(".pack", ".repository.yml")
324
330
  begin
325
331
  verbose = @verbose
@@ -359,7 +365,7 @@ module Six
359
365
 
360
366
  # Upload .pack changes
361
367
  if host[/\A(\w)*\@/]
362
- arr_opts << "-e ssh"
368
+ arr_opts << RSH
363
369
  end
364
370
  arr_opts << esc(pack_path('.'))
365
371
  arr_opts << esc(File.join(host, '.pack'))
@@ -397,6 +403,10 @@ module Six
397
403
  @logger.info "Many files mismatched (#{mismatch.count}), running full update on .pack folder"
398
404
  arr_opts = []
399
405
  arr_opts << PARAMS
406
+ if host[/\A(\w)*\@/]
407
+ arr_opts << RSH
408
+ end
409
+
400
410
  arr_opts << File.join(host, '.pack/.')
401
411
  arr_opts << esc(pack_path)
402
412
 
@@ -524,7 +534,7 @@ module Six
524
534
  arr_opts = []
525
535
  arr_opts << PARAMS
526
536
  if host[/\A(\w)*\@/]
527
- arr_opts << "-e ssh"
537
+ arr_opts << RSH
528
538
  end
529
539
  arr_opts << esc(File.join(host, path))
530
540
  arr_opts << esc(rsync_path(folder))
@@ -719,7 +729,7 @@ module Six
719
729
  opts << "--stats" if @stats
720
730
 
721
731
  opts = [opts].flatten.map {|s| s }.join(' ') # escape()
722
- rsync_cmd = "rsync #{cmd} #{opts} #{redirect} 2>&1"
732
+ rsync_cmd = "rsync #{cmd} #{opts} #{redirect}" # 2>&1
723
733
 
724
734
  while rsync_cmd[WINDRIVE] do
725
735
  drive = rsync_cmd[WINDRIVE]
@@ -779,7 +789,7 @@ module Six
779
789
  #end
780
790
  error = io_err.gets
781
791
  if error
782
- puts "Error: " + error.chomp
792
+ @logger.debug "Error: " + error.chomp
783
793
  # exit
784
794
  end
785
795
  # puts "Result: " + io_out.gets
data/lib/six/rsync.rb CHANGED
@@ -4,6 +4,7 @@ require 'fileutils'
4
4
  require 'digest/md5'
5
5
  require 'yaml'
6
6
 
7
+ BASE_PATH = Dir.pwd
7
8
  require 'six/rsync/path'
8
9
  require 'six/rsync/repository'
9
10
  require 'six/rsync/working_directory'
@@ -29,7 +30,6 @@ module Six
29
30
 
30
31
  module Rsync
31
32
  VERSION = '0.1.1'
32
- BASE_PATH = Dir.pwd
33
33
  TOOLS_PATH = File.join(BASE_PATH, 'tools')
34
34
  FOLDER = /(.*)\/(.*)/
35
35
  ENV['PATH'] = ENV['PATH'] + ";#{TOOLS_PATH};#{File.join(TOOLS_PATH, 'bin')}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: six-rsync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sickboy