fog_site 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/fog_site.gemspec +3 -3
- data/lib/fog_site.rb +14 -3
- metadata +32 -12
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.4.0
|
data/fog_site.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "fog_site"
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.4.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Brian P O'Rourke"]
|
12
|
-
s.date = "2012-
|
12
|
+
s.date = "2012-05-29"
|
13
13
|
s.description = "Simple utility gem for deploying static sites to S3 and CloudFront using fog."
|
14
14
|
s.email = "bpo@somnambulance.net"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
|
|
31
31
|
s.homepage = "http://github.com/bpo/fog_site"
|
32
32
|
s.licenses = ["MIT"]
|
33
33
|
s.require_paths = ["lib"]
|
34
|
-
s.rubygems_version = "1.8.
|
34
|
+
s.rubygems_version = "1.8.23"
|
35
35
|
s.summary = "Deploys static sites to S3 using fog"
|
36
36
|
|
37
37
|
if s.respond_to? :specification_version then
|
data/lib/fog_site.rb
CHANGED
@@ -110,7 +110,7 @@ class FogSite
|
|
110
110
|
if local_file_md5.nil? and @site.destroy_old_files
|
111
111
|
puts "#{path}: deleted".red
|
112
112
|
remote_file.destroy
|
113
|
-
|
113
|
+
mark_updated( "/#{path}" )
|
114
114
|
elsif local_file_md5 == remote_file.etag
|
115
115
|
puts "#{path}: unchanged".white
|
116
116
|
@index.delete( path )
|
@@ -118,7 +118,7 @@ class FogSite
|
|
118
118
|
puts "#{path}: updated".green
|
119
119
|
write_file( path )
|
120
120
|
@index.delete( path )
|
121
|
-
|
121
|
+
mark_updated( "/#{path}" )
|
122
122
|
end
|
123
123
|
end
|
124
124
|
|
@@ -128,6 +128,13 @@ class FogSite
|
|
128
128
|
end
|
129
129
|
end
|
130
130
|
|
131
|
+
def mark_updated( path )
|
132
|
+
@updated_paths << path
|
133
|
+
if path =~ /\/index\.html$/
|
134
|
+
@updated_paths << path.sub( /index\.html$/, '' )
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
131
138
|
# Push a single file out to S3.
|
132
139
|
def write_file( path )
|
133
140
|
@directory.files.create :key => path,
|
@@ -144,7 +151,7 @@ class FogSite
|
|
144
151
|
end
|
145
152
|
|
146
153
|
def cdn
|
147
|
-
@cdn ||= Fog::CDN.new(
|
154
|
+
@cdn ||= Fog::CDN.new( cdn_credentials )
|
148
155
|
end
|
149
156
|
|
150
157
|
def connection
|
@@ -159,6 +166,10 @@ class FogSite
|
|
159
166
|
}.merge @site.fog_options
|
160
167
|
end
|
161
168
|
|
169
|
+
def cdn_credentials
|
170
|
+
credentials.delete_if { |k, v| k == :region }
|
171
|
+
end
|
172
|
+
|
162
173
|
def assert_not_nil( value, error )
|
163
174
|
raise UsageError.new( error ) unless value
|
164
175
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog_site
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-05-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fog
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: 0.10.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.10.0
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: colorize
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ! '>='
|
@@ -32,10 +37,15 @@ dependencies:
|
|
32
37
|
version: '0'
|
33
38
|
type: :runtime
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
36
46
|
- !ruby/object:Gem::Dependency
|
37
47
|
name: bundler
|
38
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
39
49
|
none: false
|
40
50
|
requirements:
|
41
51
|
- - ~>
|
@@ -43,10 +53,15 @@ dependencies:
|
|
43
53
|
version: 1.0.0
|
44
54
|
type: :development
|
45
55
|
prerelease: false
|
46
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.0.0
|
47
62
|
- !ruby/object:Gem::Dependency
|
48
63
|
name: jeweler
|
49
|
-
requirement:
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
50
65
|
none: false
|
51
66
|
requirements:
|
52
67
|
- - ~>
|
@@ -54,7 +69,12 @@ dependencies:
|
|
54
69
|
version: 1.6.4
|
55
70
|
type: :development
|
56
71
|
prerelease: false
|
57
|
-
version_requirements:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 1.6.4
|
58
78
|
description: Simple utility gem for deploying static sites to S3 and CloudFront using
|
59
79
|
fog.
|
60
80
|
email: bpo@somnambulance.net
|
@@ -89,7 +109,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
89
109
|
version: '0'
|
90
110
|
segments:
|
91
111
|
- 0
|
92
|
-
hash:
|
112
|
+
hash: -3118719801439548906
|
93
113
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
114
|
none: false
|
95
115
|
requirements:
|
@@ -98,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
118
|
version: '0'
|
99
119
|
requirements: []
|
100
120
|
rubyforge_project:
|
101
|
-
rubygems_version: 1.8.
|
121
|
+
rubygems_version: 1.8.23
|
102
122
|
signing_key:
|
103
123
|
specification_version: 3
|
104
124
|
summary: Deploys static sites to S3 using fog
|