sphere 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -18,7 +18,11 @@ module Sphere
18
18
  end
19
19
 
20
20
  def asset_path
21
- @asset_path || public_path.join(definitions['asset_path'] || 'assets')
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
@@ -14,7 +14,7 @@ module Sphere
14
14
  end
15
15
 
16
16
  def file
17
- @file ||= Sphere.config.asset_path.join("#{name}.#{self.class.extension}")
17
+ @file ||= Sphere.config.asset_root.join("#{name}.#{self.class.extension}")
18
18
  end
19
19
 
20
20
  def public_file_name
@@ -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.asset_path.join('**', '*')].sort.each do |source|
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.asset_path)}\//, '')
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' }
@@ -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 match(/\<script src=.+assets\/application.js.*/)
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 match(/\<link href=.+assets\/screen.css.*/)
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
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sphere}
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
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"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 2
9
+ version: 0.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Dimitrij Denissenko