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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b3cdc1cb6410225deacda4ae1b8f7d5951dba12
4
- data.tar.gz: b154788fca0e5dac124f98a5baa5ff0e06baf2db
3
+ metadata.gz: 244655d1ebfa17865cc585942f8ac9e800b5b214
4
+ data.tar.gz: e5fa62da8b50078964471d159f1e64023b48e6b0
5
5
  SHA512:
6
- metadata.gz: c5b7026e6465b26e2f285faef2fafe8d7570c0b99fb6d7d9aa7970f6f52f708121cb5e44d0b67554fadad4f34c8b0bc836c834e6ba6a4fef21d3e7d72c596492
7
- data.tar.gz: 61234a0dc0126346e8f2650f05f1187fb528dbfe69afadeeab16e7adf41621f8aaa27a4b7b0c4bcc9ed046e0ff866d8f91de1e1254e3da8255ca40c6e3aa055d
6
+ metadata.gz: a390d6ed8e7fee2ed48f197fab93b044c26a8fbff0ec0018ed5c75fca3c4745c533b4954ef93bb4e7dd45477df2f98a0ecb455d53aeed980a953e7f27dd86fc9
7
+ data.tar.gz: e920174d24da8a5922559c8ae8458b8c8c771848f7f72619b7bcda2d5492f5e4b3f507d34266eb6904c971eeaeaff8a014350c06a5c8ae946ea261387b7b754f
@@ -26,7 +26,32 @@ end
26
26
  # its configuration settings.
27
27
  #
28
28
  module HamlCoffeeAssets
29
- def self.helpers
30
- GlobalContext.to_s
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
@@ -1,5 +1,5 @@
1
1
  # coding: UTF-8
2
2
 
3
3
  module HamlCoffeeAssets
4
- VERSION = '1.13.1' unless defined?(HamlCoffeeAssets::VERSION)
4
+ VERSION = '1.13.2' unless defined?(HamlCoffeeAssets::VERSION)
5
5
  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.1
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-09 00:00:00.000000000 Z
11
+ date: 2013-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coffee-script