waz-sync 0.0.3.5 → 0.0.3.6

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/waz_sync/tasks.rb +5 -10
  2. data/waz-sync.gemspec +1 -1
  3. metadata +2 -2
@@ -24,7 +24,7 @@ namespace :waz do
24
24
  folders_tmp = ENV['folders']
25
25
 
26
26
  if folders_tmp.blank?
27
- folders = ["images", "javascripts", "stylesheets"]
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(" => Syncing #{folder}")
37
- pbar = ProgressBar.new(" Progress", 100)
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 = 0
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
- j = 0
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.5'
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}
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 0
8
8
  - 3
9
- - 5
10
- version: 0.0.3.5
9
+ - 6
10
+ version: 0.0.3.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Guillaume MONTARD