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: 7030f28e3d73640f9b2c8e192d5bd0cc4bb82f44
4
- data.tar.gz: 6b172e47e0de5f36fc941c1a982c64915530e4e3
3
+ metadata.gz: 795dd88e93ce64ed54e5002c26bf2ff3d89fc9ee
4
+ data.tar.gz: bb999515c0fe1fdd215e78f58d7587d54726c4a9
5
5
  SHA512:
6
- metadata.gz: 28d2c9112ce23c385f019fea283a9364c834f82aec9ebff7a2aa6a1550cb4c19c76fde4fa681de44524124f391da98e9d9e7386162c447e2ab86f7f0964302eb
7
- data.tar.gz: b37e21fb5cde280dc3e36f11b123757e5aee18a69b2d188dbeb04eb07b11ff0c47eebcf01f971ec807b4da230292447fcb42072767ab8d0579b175cec3ea7917
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
- env.register_transformer 'text/ng-slim', 'application/javascript', AngularRails4Templates::SlimProcessor
38
- env.register_transformer 'text/ng-haml', 'application/javascript', AngularRails4Templates::HamlProcessor
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
- require 'angular-rails4-templates/compact_javascript_escape'
2
- require 'haml'
1
+ if defined? Haml
2
+ require 'angular-rails4-templates/compact_javascript_escape'
3
+ require 'haml'
3
4
 
4
- module AngularRails4Templates
5
- class HamlProcessor < Processor
5
+ module AngularRails4Templates
6
+ class HamlProcessor < Processor
7
+ include CompactJavaScriptEscape
6
8
 
7
- include CompactJavaScriptEscape
8
-
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)
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
- require 'angular-rails4-templates/compact_javascript_escape'
2
- require 'slim'
1
+ if defined? Slim
2
+ require 'angular-rails4-templates/compact_javascript_escape'
3
+ require 'slim'
3
4
 
4
- module AngularRails4Templates
5
- class SlimProcessor < Processor
5
+ module AngularRails4Templates
6
+ class SlimProcessor < Processor
6
7
 
7
- include CompactJavaScriptEscape
8
+ include CompactJavaScriptEscape
8
9
 
9
- def render_html(input)
10
- template = input[:data]
11
- output = Slim::Template.new { template }.render
12
- escape_javascript output
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
@@ -1,3 +1,3 @@
1
1
  module AngularRails4Templates
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  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.0
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: 2015-12-29 00:00:00.000000000 Z
14
+ date: 2016-01-08 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: railties