six-rsync 0.7.2 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
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.7.2'
15
+ s.version = '0.8.0'
16
16
  s.has_rdoc = true
17
17
  s.extra_rdoc_files = ['README', 'LICENSE']
18
18
  s.summary = 'Your summary here'
@@ -0,0 +1,30 @@
1
+ require 'fileutils'
2
+ module Six
3
+ module Renamer
4
+ module_function
5
+ def rename(entry, new = nil)
6
+ tmp = "#{entry}tmp"
7
+ new = File.join(File.dirname(entry), File.basename(entry).downcase) if new.nil?
8
+ FileUtils.mv(entry, tmp)
9
+ FileUtils.mv(tmp, new)
10
+ end
11
+
12
+ def handle_downcase(entry)
13
+ # First handle all entries in directory
14
+ if File.directory?(entry)
15
+ Dir[File.join(entry, "*")].each do |e|
16
+ handle_downcase(e)
17
+ end
18
+ end
19
+
20
+ # Rename the current item last
21
+ rename(entry)
22
+ end
23
+
24
+ def handle_downcase_f(entry)
25
+ Dir[File.join(entry, "*")].each do |e|
26
+ handle_downcase(e)
27
+ end
28
+ end
29
+ end
30
+ end
@@ -32,6 +32,12 @@ module Six
32
32
  @repo = Six::Repositories::Rsync.open(folder, :log => logger)
33
33
  end
34
34
 
35
+ def self.info(folder)
36
+ app = self.new(folder)
37
+ app.repo.info
38
+ app
39
+ end
40
+
35
41
  def self.open(folder)
36
42
  app = self.new(folder)
37
43
  app
@@ -6,6 +6,7 @@ require 'digest/md5'
6
6
  require 'yaml'
7
7
  require 'open3'
8
8
 
9
+ require 'six/renamer'
9
10
  require 'six/rsync/path'
10
11
  require 'six/rsync/repository'
11
12
  require 'six/rsync/working_directory'
@@ -28,7 +29,7 @@ module Six
28
29
 
29
30
  module Rsync
30
31
  COMPONENT = 'six-rsync'
31
- VERSION = '0.7.2'
32
+ VERSION = '0.8.0'
32
33
  BASE_PATH = Dir.pwd
33
34
 
34
35
  case RUBY_PLATFORM
@@ -161,6 +161,10 @@ module Six
161
161
  lib.status
162
162
  end
163
163
 
164
+ def info
165
+ lib.info
166
+ end
167
+
164
168
  # this is a convenience method for accessing the class that wraps all the
165
169
  # actual 'git' forked system calls. At some point I hope to replace the Git::Lib
166
170
  # class with one that uses native methods or libgit C bindings
@@ -59,6 +59,19 @@ module Six
59
59
  @rsync_work_dir.gsub!("\\", "/") if @rsync_work_dir
60
60
  end
61
61
 
62
+ def info
63
+ handle_config
64
+
65
+ load_repos(:local)
66
+ load_repos(:remote)
67
+
68
+ @logger.info "Repository #{@rsync_dir}"
69
+ @logger.info "Local Version #{@repos_local[:version]}"
70
+ @logger.info "Remote Version #{@repos_remote[:version]}"
71
+ @logger.info "Local WD File Count #{@repos_local[:wd].size}"
72
+ @logger.info "Remote WD File Count #{@repos_remote[:wd].size}"
73
+ end
74
+
62
75
  def status
63
76
  @logger.info "Showing changes on #{@rsync_work_dir}"
64
77
  handle_config
@@ -104,9 +117,15 @@ module Six
104
117
 
105
118
  def convert
106
119
  init({:force => true})
120
+ handle_case
107
121
  bla(".")
108
122
  end
109
123
 
124
+ def handle_case
125
+ return if CONFIG[:override_downcase]
126
+ Six::Renamer.handle_downcase_f(@rsync_work_dir)
127
+ end
128
+
110
129
  def init(opts = {})
111
130
  @logger.info "Processing: #{rsync_path}"
112
131
  if File.exists? rsync_path
@@ -211,6 +230,8 @@ module Six
211
230
  =end
212
231
 
213
232
  @logger.info "Calculating Checksums..."
233
+ handle_case
234
+
214
235
  @repos_local[:wd] = calc_sums(:wd)
215
236
  # Added or Changed files
216
237
  ar = Dir[File.join(@rsync_work_dir, '/**/*')]
@@ -45,6 +45,10 @@ module Six
45
45
  @@host = s
46
46
  end
47
47
 
48
+ opts.on("-o", "--info", "Shows information from repository") do |bool|
49
+ todo << :info
50
+ end
51
+
48
52
  opts.on("-l", "--log", "Write logfile") do |bool|
49
53
  options[:logging] = bool if bool
50
54
  end
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 7
8
- - 2
9
- version: 0.7.2
7
+ - 8
8
+ - 0
9
+ version: 0.8.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Sickboy
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-07-27 00:00:00 +02:00
17
+ date: 2010-08-03 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -48,6 +48,7 @@ files:
48
48
  - Rakefile
49
49
  - bin/six-rsync
50
50
  - bin/six-rsync-mirror
51
+ - lib/six/renamer.rb
51
52
  - lib/six/rsync/base.rb
52
53
  - lib/six/rsync/lib.rb
53
54
  - lib/six/rsync/options.rb