jeremyboles-smart-asset-helper 0.1.7 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/asset_manager.rb CHANGED
@@ -51,7 +51,7 @@ class AssetManager
51
51
  file_path = "#{ASSET_DIR[asset_type]}/#{asset_path}"
52
52
  files << path if File.exists?(file_path)
53
53
  end
54
- files += auto_find(asset_type, request_params) if auto
54
+ files += auto_find(asset_type, request_params, extra) if auto
55
55
  files
56
56
  end
57
57
 
@@ -64,8 +64,8 @@ protected
64
64
  path = prefix + path
65
65
  asset_path = "#{path}#{extra}.#{asset_type}"
66
66
  file_path = "#{ASSET_DIR[asset_type]}/#{asset_path}"
67
-
68
- files << path if File.exists?(file_path)
67
+
68
+ files << path + extra if File.exists?(file_path)
69
69
  prefix = path + '/'
70
70
  end
71
71
  files
@@ -1,4 +1,5 @@
1
1
  require 'asset_manager'
2
+ require 'smarter_asset_tag_helper'
2
3
 
3
4
  module SmartAssetHelper
4
5
 
@@ -19,7 +20,8 @@ module SmartAssetHelper
19
20
  # Print required javascript
20
21
  def include_javascript(*args)
21
22
  options = extract_options(args)
22
- javascript = javascript_include_tag(*include_assets(:js, args, options))
23
+ assets = include_assets(:js, args, options)
24
+ javascript = javascript_include_tag(*assets)
23
25
  javascript += ie_assets(:js, args, options[:auto], params) if options[:ie]
24
26
  javascript.gsub("\n", '')
25
27
  end
@@ -27,7 +29,8 @@ module SmartAssetHelper
27
29
  # Print required stylesheets
28
30
  def include_stylesheets(*args)
29
31
  options = extract_options(args)
30
- stylesheets = stylesheet_link_tag(*include_assets(:css, args, options))
32
+ assets = include_assets(:css, args, options)
33
+ stylesheets = stylesheet_link_tag(*assets)
31
34
  stylesheets += ie_assets(:css, args, options[:auto], params) if options[:ie]
32
35
  stylesheets.gsub("\n", '')
33
36
  end
@@ -17,7 +17,7 @@ module SmarterAssetTagHelper
17
17
  end
18
18
 
19
19
  def script_tag(*sources)
20
- sources.map do |s|
20
+ sources.delete_if {|s| s.blank? }.map do |s|
21
21
  content_tag(:script, '', :src => s, :type => 'text/javascript')
22
22
  end.join
23
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jeremyboles-smart-asset-helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Boles
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-19 00:00:00 -07:00
12
+ date: 2009-04-20 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency