sphere 0.1.1 → 0.1.2
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/config.rb +5 -1
- data/lib/sphere/package/base.rb +1 -1
- data/lib/sphere/tasks/upload.rake +2 -2
- data/spec/sphere/helper_spec.rb +2 -2
- data/sphere.gemspec +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/lib/sphere/config.rb
CHANGED
@@ -18,7 +18,11 @@ module Sphere
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def asset_path
|
21
|
-
@asset_path ||
|
21
|
+
@asset_path || definitions['asset_path'] || 'assets'
|
22
|
+
end
|
23
|
+
|
24
|
+
def asset_root
|
25
|
+
public_path.join(asset_path)
|
22
26
|
end
|
23
27
|
|
24
28
|
def backend
|
data/lib/sphere/package/base.rb
CHANGED
@@ -8,7 +8,7 @@ namespace :sphere do
|
|
8
8
|
bucket = config.delete(:bucket)
|
9
9
|
|
10
10
|
AWS::S3::Base.establish_connection!(config)
|
11
|
-
Dir[Sphere.config.
|
11
|
+
Dir[Sphere.config.asset_root.join('**', '*')].sort.each do |source|
|
12
12
|
source = Pathname.new(source)
|
13
13
|
local = source.to_s.sub(/^#{Regexp.escape(Sphere.config.public_path)}\//, '')
|
14
14
|
|
@@ -17,7 +17,7 @@ namespace :sphere do
|
|
17
17
|
next
|
18
18
|
end
|
19
19
|
|
20
|
-
target = source.to_s.sub(/^#{Regexp.escape(Sphere.config.
|
20
|
+
target = source.to_s.sub(/^#{Regexp.escape(Sphere.config.asset_root)}\//, '')
|
21
21
|
etag = Digest::MD5.hexdigest(source.read)
|
22
22
|
|
23
23
|
meta = AWS::S3::S3Object.about(target, bucket) rescue { "last-modified" => '01/01/1970' }
|
data/spec/sphere/helper_spec.rb
CHANGED
@@ -22,11 +22,11 @@ describe Sphere::Helper do
|
|
22
22
|
end
|
23
23
|
|
24
24
|
it 'should package JS' do
|
25
|
-
helper.include_javascripts(:application).should
|
25
|
+
helper.include_javascripts(:application).should == %Q(<script src="/assets/application.js" type="text/javascript"></script>)
|
26
26
|
end
|
27
27
|
|
28
28
|
it 'should package CSS' do
|
29
|
-
helper.include_stylesheets(:screen).should
|
29
|
+
helper.include_stylesheets(:screen).should == %Q(<link href="/assets/screen.css" media="screen" rel="stylesheet" type="text/css" />)
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
data/sphere.gemspec
CHANGED