zfben_rails_assets 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -21,6 +21,7 @@ module AssetsHelper
21
21
  js = Dir.glob(([:js] + AssetFormat::Js::EXTEND_FORMATS).map{ |f| path + '.' + f.to_s })
22
22
  html << assets(name + '.css') if css.length > 0
23
23
  html << assets(name + '.js') if js.length > 0
24
+ html << assets_file(name) if css.length == 0 && js.length == 0
24
25
  end
25
26
  end
26
27
  html
@@ -36,6 +37,10 @@ module AssetsHelper
36
37
  "<link rel=\"stylesheet\" href=\"#{asset_host}/#{url}\" />"
37
38
  end
38
39
 
40
+ def assets_file url
41
+ "#{asset_host}/#{url}"
42
+ end
43
+
39
44
  def asset_host
40
45
  unless Rails.configuration.action_controller[:asset_host].nil?
41
46
  host = Rails.configuration.action_controller[:asset_host].clone
@@ -138,6 +138,10 @@ class AssetsHelperTest < ActionView::TestCase
138
138
  test 'assets blank' do
139
139
  assert_equal assets('blank'), assets('blank.css') << assets('blank.js')
140
140
  end
141
+
142
+ test 'assets file' do
143
+ assert_equal assets('a.jpg'), '/assets/a.jpg'
144
+ end
141
145
 
142
146
  test 'assets in production' do
143
147
  Rails.env = 'production'
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "zfben_rails_assets"
6
- s.version = '0.0.12'
6
+ s.version = '0.0.13'
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Ben"]
9
9
  s.email = ["ben@zfben.com"]
@@ -31,4 +31,5 @@ Gem::Specification.new do |s|
31
31
  s.add_dependency 'compass'
32
32
  s.add_dependency 'coffee-script'
33
33
  s.add_dependency 'uglifier'
34
+ s.add_dependency 'haml'
34
35
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zfben_rails_assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
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-02-24 00:00:00.000000000 Z
12
+ date: 2012-03-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &12789660 !ruby/object:Gem::Requirement
16
+ requirement: &10468460 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.1.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *12789660
24
+ version_requirements: *10468460
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: sass
27
- requirement: &12789280 !ruby/object:Gem::Requirement
27
+ requirement: &10467840 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *12789280
35
+ version_requirements: *10467840
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: compass
38
- requirement: &12788820 !ruby/object:Gem::Requirement
38
+ requirement: &10467360 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *12788820
46
+ version_requirements: *10467360
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: coffee-script
49
- requirement: &12788400 !ruby/object:Gem::Requirement
49
+ requirement: &10466940 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *12788400
57
+ version_requirements: *10466940
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: uglifier
60
- requirement: &12787980 !ruby/object:Gem::Requirement
60
+ requirement: &10466520 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,7 +65,18 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *12787980
68
+ version_requirements: *10466520
69
+ - !ruby/object:Gem::Dependency
70
+ name: haml
71
+ requirement: &10466080 !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :runtime
78
+ prerelease: false
79
+ version_requirements: *10466080
69
80
  description: ''
70
81
  email:
71
82
  - ben@zfben.com