coffee_asset_paths 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8d6d7132ad730eda7f29d5f6f295c67eac3d860d
4
- data.tar.gz: 570192fbbe4f54bd7f7b103a14aedb579c504d8d
3
+ metadata.gz: fe488b31d73f19c1b29ec54139e0afb269dc1274
4
+ data.tar.gz: 018ad01c840534eb38852ce9b91c3913c9936594
5
5
  SHA512:
6
- metadata.gz: c873b542047dd36404f23a57aaa45bed25d2f7191a8194f2c6fa921a7d018b3c9dcdb9b931af9f0fb658a9594d7f0002c372b4bdcba42e2189aee41a9c277fe3
7
- data.tar.gz: 7ca0faca5b7b798aa3dee820afd0022b5c5157a47e5ee44e8c338a9c92e690b2fc2b24ffecd94337dbe9cb1affda45118f1e6cd69577c5ba90ad6230636c2ecc
6
+ metadata.gz: f1afeafedd821255e1daee9ca644c10937d2b693dc5ed507b7fdb8f31473465d288c7a75caf56167204455490ef97494acdd91f1773d2d0dc195ab7890cadb9d
7
+ data.tar.gz: 4b1f7ba0b54574b94376ef0b60864825d9d334552bfa9470b96f1b1fcffa6e64a7566114335e6aa5808c3fcf3b3ae0e2eb187b97cd0eec5818260d2b77c2ba08
@@ -1,3 +1,3 @@
1
1
  module CoffeeAssetPaths
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -8,29 +8,4 @@ module CoffeeAssetPaths
8
8
  end
9
9
  end
10
10
 
11
- class << self
12
- include ActionView::Helpers::AssetUrlHelper
13
-
14
- def asset_types
15
- ASSET_PUBLIC_DIRECTORIES.keys.to_json
16
- end
17
-
18
- def assets
19
- @assets ||= begin
20
- assets = {}
21
-
22
- ASSET_PUBLIC_DIRECTORIES.each do |type, path|
23
- asset_dir = File.join(::Rails.root, 'app', 'assets', path)
24
- next unless File.directory?(asset_dir)
25
-
26
- Dir.chdir(asset_dir) do
27
- assets[type] = Dir["**"].inject({}) {|h,f| h.merge! f => asset_path(f)}
28
- end
29
- end
30
-
31
- assets.to_json
32
- end
33
- end
34
- end
35
-
36
11
  end
@@ -1,8 +1,18 @@
1
1
  window.CoffeeAssetPaths =
2
2
 
3
- assets: <%= CoffeeAssetPaths.assets %>
3
+ assets: <%=
4
+ assets = {}
5
+ ActionView::Helpers::AssetUrlHelper::ASSET_PUBLIC_DIRECTORIES.each do |type, path|
6
+ asset_dir = File.join(::Rails.root, 'app', 'assets', path)
7
+ next unless File.directory?(asset_dir)
4
8
 
5
- assetTypes: <%= CoffeeAssetPaths.asset_types %>
9
+ Dir.chdir(asset_dir) do
10
+ assets[type] = Dir["**"].inject({}) {|h,f| h.merge! f => asset_path(f, :type => type)}
11
+ end
12
+ end
13
+ assets.to_json %>
14
+
15
+ assetTypes: <%= ActionView::Helpers::AssetUrlHelper::ASSET_PUBLIC_DIRECTORIES.keys.to_json %>
6
16
 
7
17
  assetPath: (type, name)->
8
18
  if @assets[type]?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coffee_asset_paths
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Wentworth