haml_coffee_template 0.1.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
  SHA256:
3
- metadata.gz: 668cea02355744741f5b02a27f905a9e95755341aa9a6f5e4167ef7aeae66c0d
4
- data.tar.gz: 79f3ea79a9c9caed1725c622c992ef57f07944e1cd8c6f84183f92073abafeae
3
+ metadata.gz: 25253658003a616ec94436a111f18ad24bd6d79285e9a2e15c2934053fcb47cd
4
+ data.tar.gz: 7dfbbe053afeec88e0beeec03a683807f481613b43dc3e0b93b3c225bd2ee1fd
5
5
  SHA512:
6
- metadata.gz: 8760a5e9d988d7caf1aaecff963c8ac6eb765150e994b952646530be23756a18ebd271856f0dc8f55ecc17ed6cb2415f62a4b8c2e33159961032c3314efa7247
7
- data.tar.gz: 52c68eff01a36c83e701ef60b60e3cd975af73807e17ae5fd8f64bc12692238f73c324080cc85cecfe311d656c08a219794bbd54bbb2e420b57dfd0db22f722c
6
+ metadata.gz: 569d4b227b85da8084c0bc6b93ecc17d666c716c53d14ad1ba1e95069b5242ade11a79e4493144b654702939e739ae65e3ac0b832bca46a04b4a07ea4e4ff943
7
+ data.tar.gz: 9a3d3411a34dd43b405c3f780f6b38dd760621de58da5fc09abb8624579b7976b95a19af75dfafd6a3ab6ad4c7ebf544dd85e28074b99ce45adda980ca73caa8
@@ -9,12 +9,14 @@ module HamlCoffeeTemplate
9
9
  end
10
10
 
11
11
  def template(name, source)
12
+ haml_coffee_compiler_options = HamlCoffeeTemplate.configuration.haml_coffee_compiler_options.dup
13
+ haml_coffee_compiler_options[:name] = name
14
+ haml_coffee_compiler_options[:namespace] = HamlCoffeeTemplate.configuration.namespace
12
15
  runtime.call(
13
16
  "HamlCoffeeTemplate.template",
14
17
  source,
15
- name,
16
- HamlCoffeeTemplate.configuration.namespace,
17
- HamlCoffeeTemplate.configuration.compiler_options
18
+ haml_coffee_compiler_options,
19
+ HamlCoffeeTemplate.configuration.coffee_script_compiler_options,
18
20
  )
19
21
  end
20
22
 
@@ -22,20 +24,21 @@ module HamlCoffeeTemplate
22
24
  runtime.call(
23
25
  "HamlCoffeeTemplate.compile",
24
26
  source,
25
- HamlCoffeeTemplate.configuration.compiler_options
27
+ HamlCoffeeTemplate.configuration.haml_coffee_compiler_options,
28
+ HamlCoffeeTemplate.configuration.coffee_script_compiler_options
26
29
  )
27
30
  end
28
31
 
29
32
  def runtime_source
30
- [coffeescript_source, hamlcoffee_source, wrapper_source].join(";")
33
+ [coffeescript_source, haml_coffee_source, wrapper_source].join(";")
31
34
  end
32
35
 
33
36
  def coffeescript_source
34
37
  File.read(CoffeeScript::Source.path)
35
38
  end
36
39
 
37
- def hamlcoffee_source
38
- File.read(HamlCoffeeTemplate.configuration.hamlcoffee_path)
40
+ def haml_coffee_source
41
+ File.read(HamlCoffeeTemplate.configuration.haml_coffee_path)
39
42
  end
40
43
 
41
44
  def wrapper_source
@@ -1,11 +1,12 @@
1
1
  module HamlCoffeeTemplate
2
2
  class Configuration
3
- attr_accessor :namespace, :compiler_options, :hamlcoffee_path
3
+ attr_accessor :namespace, :haml_coffee_compiler_options, :coffee_script_compiler_options, :haml_coffee_path
4
4
 
5
5
  def initialize
6
6
  self.namespace = "window.JST"
7
- self.compiler_options = {}
8
- self.hamlcoffee_path = File.expand_path("hamlcoffee.js", __dir__)
7
+ self.haml_coffee_compiler_options = {}
8
+ self.coffee_script_compiler_options = {}
9
+ self.haml_coffee_path = File.expand_path("haml-coffee.js", __dir__)
9
10
  end
10
11
  end
11
12
  end
@@ -1,3 +1,10 @@
1
+ /**
2
+ * Haml Coffee v1.14.1
3
+ * https://github.com/netzpirat/haml-coffee
4
+ *
5
+ * Copyright (c) 2011 9elements, 2011-2013 Michael Kessler
6
+ * Released under the MIT License
7
+ */
1
8
  var require = function (file, cwd) {
2
9
  var resolved = require.resolve(file, cwd || '/');
3
10
  var mod = require.modules[resolved];
@@ -1,3 +1,3 @@
1
1
  module HamlCoffeeTemplate
2
- VERSION = "0.1.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -2,15 +2,15 @@ var HamlCoffeeTemplate = (function() {
2
2
  var Compiler = require('./haml-coffee');
3
3
 
4
4
  return {
5
- template: function (src, name, namespace, compilerOptions){
6
- var compiler = new Compiler(compilerOptions);
5
+ template: function (src, hamlCoffeeCompilerOptions, coffeeScriptCompilerOptions){
6
+ var compiler = new Compiler(hamlCoffeeCompilerOptions);
7
7
  compiler.parse(src);
8
- return CoffeeScript.compile(compiler.render(name, namespace));
8
+ return CoffeeScript.compile(compiler.render(), coffeeScriptCompilerOptions);
9
9
  },
10
- compile: function (src, compilerOptions){
11
- var compiler = new Compiler(compilerOptions);
10
+ compile: function (src, hamlCoffeeCompilerOptions, coffeeScriptCompilerOptions){
11
+ var compiler = new Compiler(hamlCoffeeCompilerOptions);
12
12
  compiler.parse(src);
13
- return CoffeeScript.compile(compiler.precompile(), {bare: true});
13
+ return CoffeeScript.compile(compiler.precompile(), coffeeScriptCompilerOptions);
14
14
  }
15
15
  }
16
16
  })();
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haml_coffee_template
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Krists Ozols
@@ -48,7 +48,7 @@ files:
48
48
  - lib/haml_coffee_template.rb
49
49
  - lib/haml_coffee_template/compiler.rb
50
50
  - lib/haml_coffee_template/configuration.rb
51
- - lib/haml_coffee_template/hamlcoffee.js
51
+ - lib/haml_coffee_template/haml-coffee.js
52
52
  - lib/haml_coffee_template/processor.rb
53
53
  - lib/haml_coffee_template/railtie.rb
54
54
  - lib/haml_coffee_template/version.rb