waz-sync 0.0.3.5 → 0.0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/waz_sync/tasks.rb +5 -10
- data/waz-sync.gemspec +1 -1
- metadata +2 -2
data/lib/waz_sync/tasks.rb
CHANGED
@@ -24,7 +24,7 @@ namespace :waz do
|
|
24
24
|
folders_tmp = ENV['folders']
|
25
25
|
|
26
26
|
if folders_tmp.blank?
|
27
|
-
folders =
|
27
|
+
folders = %w(images javascripts stylesheets)
|
28
28
|
else
|
29
29
|
folders = folders_tmp.split(/,/)
|
30
30
|
end
|
@@ -33,23 +33,18 @@ namespace :waz do
|
|
33
33
|
|
34
34
|
folders.each{|folder|
|
35
35
|
|
36
|
-
puts("
|
37
|
-
pbar = ProgressBar.new("
|
36
|
+
puts("\t=> Syncing #{folder}")
|
37
|
+
pbar = ProgressBar.new("\t Progress", 100)
|
38
38
|
container = azure.find_or_create_container(folder)
|
39
39
|
|
40
|
-
i =
|
41
|
-
Dir.glob("#{Rails.root.to_s}/public/#{folder}/**/*").each do |file|
|
42
|
-
i+=1
|
43
|
-
end
|
40
|
+
i = Dir.glob("#{Rails.root.to_s}/public/#{folder}/**/*").size
|
44
41
|
|
45
|
-
|
46
|
-
Dir.glob("#{Rails.root.to_s}/public/#{folder}/**/*").each do |file|
|
42
|
+
Dir.glob("#{Rails.root.to_s}/public/#{folder}/**/*").each_with_index do |file, j|
|
47
43
|
if File.file?(file)
|
48
44
|
filename = file.gsub("/public/#{folder}/", "").gsub("#{Rails.root.to_s}", "")
|
49
45
|
azure.send_or_update(container, file, filename)
|
50
46
|
pbar.set((((j.to_f/i.to_f)*10000).to_i / 100.0).ceil)
|
51
47
|
end
|
52
|
-
j+=1
|
53
48
|
end
|
54
49
|
pbar.finish
|
55
50
|
print "\n"
|
data/waz-sync.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
Gem::Specification.new do |gem|
|
3
3
|
gem.name = 'waz-sync'
|
4
|
-
gem.version = '0.0.3.
|
4
|
+
gem.version = '0.0.3.6'
|
5
5
|
gem.date = '2012-04-20'
|
6
6
|
gem.description = %q{A simple client library aim to sync assets to Windows Azure CDN, using a modified version of the great waz-storage gem}
|
7
7
|
gem.summary = %q{Client library for Syncing assets to Windows Azure CDN}
|