closync 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -24,16 +24,16 @@ destination to perform a one-way synchronization.
24
24
  **.closync.yml**
25
25
 
26
26
  credentials:
27
- google_storage_access_key_id: ENV['GOOGLE_STORAGE_ACCESS_KEY_ID']
28
- google_storage_secret_access_key: ENV['GOOGLE_STORAGE_SECRET_ACCESS_KEY']
27
+ google_storage_access_key_id: <%= ENV['GOOGLE_STORAGE_ACCESS_KEY_ID'] %>
28
+ google_storage_secret_access_key: <%= ENV['GOOGLE_STORAGE_SECRET_ACCESS_KEY'] %>
29
29
  storage:
30
30
  local:
31
31
  provider: 'Local'
32
- directory: 'folder/name'
32
+ directory: 'relative/path'
33
33
  remote:
34
34
  provider: 'Google'
35
35
  directory: 'bucket_name'
36
- cache-control:
36
+ cache_control:
37
37
  300:
38
38
  - .htm
39
39
  - .html
@@ -88,7 +88,7 @@ module Closync
88
88
  self.credentials = {}
89
89
  @yml['credentials'].each do |key, val|
90
90
  self.credentials[key.to_sym] = val
91
- end
91
+ end if @yml['credentials']
92
92
  end
93
93
 
94
94
  def set_storage!
@@ -97,23 +97,23 @@ module Closync
97
97
  self.storage[remote.to_sym] = {}
98
98
  config.each do |key, val|
99
99
  self.storage[remote.to_sym][key.to_sym] = val
100
- end
101
- end
100
+ end if config
101
+ end if @yml['storage']
102
102
  end
103
103
 
104
104
  def set_cache_control!
105
105
  @yml['cache_control'].each do |max_age, extensions|
106
106
  extensions.each do |extension|
107
107
  set_max_age!(extension, max_age)
108
- end
109
- end
108
+ end if extensions
109
+ end if @yml['cache_control']
110
110
  end
111
111
 
112
112
  def set_branch!
113
113
  self.branch = []
114
114
  @yml['branch'].each do |branch|
115
115
  self.branch << branch
116
- end
116
+ end if @yml['branch']
117
117
  end
118
118
 
119
119
  end
data/lib/closync/sync.rb CHANGED
@@ -31,16 +31,16 @@ module Closync
31
31
  end
32
32
 
33
33
  def upload?(file)
34
- upload = false
35
- if ( remote_file = @remote.directory.files.head(file.key) )
36
- if remote_file.last_modified < file.last_modified
37
- # TODO(wenzowski): check etag to see if file has changed
38
- upload = true # clobber remote file
39
- end
40
- else
41
- upload = true
42
- end
43
- upload
34
+ # TODO(wenzowski): check if file already exists
35
+ #
36
+ # upload = false
37
+ # if ( remote_file = @remote.directory.files.head(file.key) )
38
+ # # TODO(wenzowski): check etag to see if file has changed
39
+ # else
40
+ # upload = true
41
+ # end
42
+ # upload
43
+ true
44
44
  end
45
45
 
46
46
  # If file already exists on remote it will be overwritten.
@@ -1,3 +1,3 @@
1
1
  module Closync
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -2,5 +2,5 @@ require 'spec_helper'
2
2
  require 'closync/version'
3
3
 
4
4
  describe Closync do
5
- it { Closync::VERSION.should eq('0.0.1'), "Please don't bump the version." }
5
+ it { Closync::VERSION.should eq('0.0.2'), "Please don't bump the version." }
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: closync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -71,7 +71,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
71
71
  version: '0'
72
72
  segments:
73
73
  - 0
74
- hash: 2016661747058335688
74
+ hash: -569674058433925932
75
75
  required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  none: false
77
77
  requirements:
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  version: '0'
81
81
  segments:
82
82
  - 0
83
- hash: 2016661747058335688
83
+ hash: -569674058433925932
84
84
  requirements: []
85
85
  rubyforge_project:
86
86
  rubygems_version: 1.8.24