haml_coffee_assets 1.13.1 → 1.13.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/haml_coffee_assets.rb +27 -2
- data/lib/haml_coffee_assets/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 244655d1ebfa17865cc585942f8ac9e800b5b214
|
4
|
+
data.tar.gz: e5fa62da8b50078964471d159f1e64023b48e6b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a390d6ed8e7fee2ed48f197fab93b044c26a8fbff0ec0018ed5c75fca3c4745c533b4954ef93bb4e7dd45477df2f98a0ecb455d53aeed980a953e7f27dd86fc9
|
7
|
+
data.tar.gz: e920174d24da8a5922559c8ae8458b8c8c771848f7f72619b7bcda2d5492f5e4b3f507d34266eb6904c971eeaeaff8a014350c06a5c8ae946ea261387b7b754f
|
data/lib/haml_coffee_assets.rb
CHANGED
@@ -26,7 +26,32 @@ end
|
|
26
26
|
# its configuration settings.
|
27
27
|
#
|
28
28
|
module HamlCoffeeAssets
|
29
|
-
|
30
|
-
|
29
|
+
|
30
|
+
# Get the path to the `hamlcoffee.js.coffee.erb` helper file.
|
31
|
+
#
|
32
|
+
# @return [String] the absolute path to the helpers file
|
33
|
+
#
|
34
|
+
def self.helpers_path
|
35
|
+
File.expand_path(File.join(File.dirname(__FILE__), '..', 'vendor', 'assets', 'javascripts', 'hamlcoffee.js.coffee.erb'))
|
36
|
+
end
|
37
|
+
|
38
|
+
# Get the Haml Coffee Assets helper file
|
39
|
+
#
|
40
|
+
# @param [Boolean] compile whether to compile the CS helpers or not
|
41
|
+
# @return [String] the helpers content
|
42
|
+
#
|
43
|
+
def self.helpers(compile=true)
|
44
|
+
require 'erb'
|
45
|
+
|
46
|
+
content = File.read(HamlCoffeeAssets.helpers_path)
|
47
|
+
script = ERB.new(content).result(binding)
|
48
|
+
|
49
|
+
if compile
|
50
|
+
require 'coffee-script'
|
51
|
+
script = CoffeeScript.compile(script)
|
52
|
+
end
|
53
|
+
|
54
|
+
script << GlobalContext.to_s if defined?(Rails)
|
55
|
+
script
|
31
56
|
end
|
32
57
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: haml_coffee_assets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.13.
|
4
|
+
version: 1.13.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Kessler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coffee-script
|