adamh-asset_library 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/asset_library/helpers.rb +4 -2
  2. metadata +1 -1
@@ -3,7 +3,8 @@ class AssetLibrary
3
3
  def asset_library_javascript_tags(module_key)
4
4
  m = AssetLibrary.asset_module(module_key)
5
5
  if AssetLibrary.cache
6
- script_tag(m.cache_asset.relative_url)
6
+ @@asset_library_javascript_tags_cache ||= {}
7
+ @@asset_library_javascript_tags_cache[module_key] ||= script_tag(m.cache_asset.relative_url)
7
8
  else
8
9
  m.assets.collect{|a| script_tag(a.relative_url)}.join("\n")
9
10
  end
@@ -12,7 +13,8 @@ class AssetLibrary
12
13
  def asset_library_stylesheet_tags(module_key, extra_suffix = nil)
13
14
  m = AssetLibrary.asset_module(module_key)
14
15
  if AssetLibrary.cache
15
- style_tag(m.cache_asset(extra_suffix).relative_url)
16
+ @@asset_library_stylesheet_tags_cache ||= {}
17
+ @@asset_library_stylesheet_tags_cache[[module_key, extra_suffix]] ||= style_tag(m.cache_asset(extra_suffix).relative_url)
16
18
  else
17
19
  import_styles_tag(m.assets(extra_suffix).collect{|a| a.relative_url})
18
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adamh-asset_library
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - adamh