sphere 0.1.4 → 0.1.5
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/VERSION +1 -1
- data/lib/sphere/tasks/upload.rake +12 -4
- data/sphere.gemspec +2 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.5
|
@@ -6,9 +6,17 @@ namespace :sphere do
|
|
6
6
|
|
7
7
|
config = YAML.load_file(Sphere.config.root.join('config', 's3.yml'))[Sphere.config.env].symbolize_keys
|
8
8
|
bucket = config.delete(:bucket)
|
9
|
-
|
10
9
|
AWS::S3::Base.establish_connection!(config)
|
11
|
-
|
10
|
+
|
11
|
+
globs = if Sphere.config.send(:definitions)['s3'].is_a?(Array)
|
12
|
+
Sphere.config.send(:definitions)['s3'].map do |glob|
|
13
|
+
Sphere.config.public_path.join(glob)
|
14
|
+
end
|
15
|
+
else
|
16
|
+
[Sphere.config.asset_root.join('**', '*')]
|
17
|
+
end
|
18
|
+
|
19
|
+
globs.map {|g| Dir[g] }.flatten.sort.each do |source|
|
12
20
|
source = Pathname.new(source)
|
13
21
|
target = source.to_s.sub(/^#{Regexp.escape(Sphere.config.public_path)}\//, '')
|
14
22
|
|
@@ -17,14 +25,14 @@ namespace :sphere do
|
|
17
25
|
next
|
18
26
|
end
|
19
27
|
|
20
|
-
etag = Digest::MD5.hexdigest(source.read)
|
28
|
+
etag = Digest::MD5.hexdigest(source.read).inspect
|
21
29
|
meta = AWS::S3::S3Object.about(target, bucket) rescue { "last-modified" => '01/01/1970' }
|
22
30
|
|
23
31
|
if meta['etag'] != etag || Time.parse(meta["last-modified"]) < source.mtime
|
24
32
|
puts "\e[32m S3/store #{target}\e[0m"
|
25
33
|
AWS::S3::S3Object.store(target, source.open, bucket, :access => :public_read)
|
26
34
|
else
|
27
|
-
puts " S3/skip #{
|
35
|
+
puts " S3/skip #{target}"
|
28
36
|
end
|
29
37
|
end
|
30
38
|
end
|
data/sphere.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{sphere}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Dimitrij Denissenko"]
|
12
|
-
s.date = %q{2010-07-
|
12
|
+
s.date = %q{2010-07-24}
|
13
13
|
s.description = %q{Rails asset packer and compressor. Supports Compass, built (primarily) to be used with Heroku & AWS/S3}
|
14
14
|
s.email = %q{dimitrij@blacksquaremedia.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 5
|
9
|
+
version: 0.1.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Dimitrij Denissenko
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-07-
|
17
|
+
date: 2010-07-24 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|