angular-rails4-templates 0.4.0 → 0.4.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 795dd88e93ce64ed54e5002c26bf2ff3d89fc9ee
|
4
|
+
data.tar.gz: bb999515c0fe1fdd215e78f58d7587d54726c4a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f008ba8c1c623dda6e1ab3ffbd178c9ec5ad0b7df6733caa7db8fd01076a0bcb5b2d2ce09dc6fd04b037b10b332a00b18bd492800f641206f7ebed8641e2b4f1
|
7
|
+
data.tar.gz: 7fdf0ad95577afb92d07f009d2d5cf1a9226ba51342749e1b870aec165956df338a6b25730eb4ca163ea2edddd0dbe0109edaac1fa9bd74147c23a611b0dff92
|
@@ -34,8 +34,12 @@ module AngularRails4Templates
|
|
34
34
|
env.register_mime_type 'text/ng-html', extensions: ['.nghtml']
|
35
35
|
env.register_mime_type 'text/ng-haml', extensions: ['.nghaml']
|
36
36
|
env.register_mime_type 'text/ng-slim', extensions: ['.ngslim']
|
37
|
-
|
38
|
-
|
37
|
+
if defined? Slim
|
38
|
+
env.register_transformer 'text/ng-slim', 'application/javascript', AngularRails4Templates::SlimProcessor
|
39
|
+
end
|
40
|
+
if defined? Haml
|
41
|
+
env.register_transformer 'text/ng-haml', 'application/javascript', AngularRails4Templates::HamlProcessor
|
42
|
+
end
|
39
43
|
env.register_transformer 'text/ng-html', 'application/javascript', AngularRails4Templates::Processor
|
40
44
|
end
|
41
45
|
|
@@ -1,19 +1,19 @@
|
|
1
|
-
|
2
|
-
require '
|
1
|
+
if defined? Haml
|
2
|
+
require 'angular-rails4-templates/compact_javascript_escape'
|
3
|
+
require 'haml'
|
3
4
|
|
4
|
-
module AngularRails4Templates
|
5
|
-
|
5
|
+
module AngularRails4Templates
|
6
|
+
class HamlProcessor < Processor
|
7
|
+
include CompactJavaScriptEscape
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
raise Haml::SyntaxError.new("#{input[:filename]} #{ex.message}", ex.line)
|
9
|
+
def render_html(input)
|
10
|
+
template = input[:data]
|
11
|
+
haml_engine = Haml::Engine.new(template)
|
12
|
+
output = haml_engine.render
|
13
|
+
escape_javascript output
|
14
|
+
rescue Haml::SyntaxError => ex
|
15
|
+
raise Haml::SyntaxError.new("#{input[:filename]} #{ex.message}", ex.line)
|
16
|
+
end
|
16
17
|
end
|
17
|
-
|
18
18
|
end
|
19
19
|
end
|
@@ -1,15 +1,17 @@
|
|
1
|
-
|
2
|
-
require '
|
1
|
+
if defined? Slim
|
2
|
+
require 'angular-rails4-templates/compact_javascript_escape'
|
3
|
+
require 'slim'
|
3
4
|
|
4
|
-
module AngularRails4Templates
|
5
|
-
|
5
|
+
module AngularRails4Templates
|
6
|
+
class SlimProcessor < Processor
|
6
7
|
|
7
|
-
|
8
|
+
include CompactJavaScriptEscape
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
def render_html(input)
|
11
|
+
template = input[:data]
|
12
|
+
output = Slim::Template.new { template }.render
|
13
|
+
escape_javascript output
|
14
|
+
end
|
13
15
|
end
|
14
16
|
end
|
15
17
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: angular-rails4-templates
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Damien Mathieu
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2016-01-08 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: railties
|