angular-rails-templates 0.2.0 → 0.3.0

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: a018691c75509ff84ca02b0939e0db6c823344b4
4
- data.tar.gz: 47ef3eb43c11466504e92b9432de1a5c2ee28b62
3
+ metadata.gz: 44d240dc6f8c691a6243c5595d3a460781ae0606
4
+ data.tar.gz: 369f4eef0998ac3d46e466331132c31acc16767e
5
5
  SHA512:
6
- metadata.gz: 5e6b454369e855905ed02a39c734e43ff24243d8e9c995f889f78f0304d9e8195c398ad79400e18ada1793cf1a8c174435e708c4019af1ab1681de042bd9297d
7
- data.tar.gz: f5e21a3e7b5d8cb9c8a154f18a4547a05e81dc101999a74f7ee631e54b59ecd26c9d4b6448e2a8ed1f7312387e08fbb7bb1648a9cf2ee2842f33ee7e5f535786
6
+ metadata.gz: b471e6cc6362f41b3b1811287d4856dc177a36e24dcf0a564fcf1affd8e43388a9ff041d9f57760e9994aacfb3fd642b0c1437466b66dfd512f9e03c2fa25e74
7
+ data.tar.gz: bd8f42bce871649cb42def0fa3aa64342a675adac268f7f34e078e4122c47f30791551d5ce3deec0d9833e0939b0b74c57c7b853346745a13d0c12e6893f15fb
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Adds your HTML templates into Angular's `$templateCache` using Rails asset pipeline.
4
4
 
5
+ **IMPORTANT**: for Rails 4.2+ use version 1.0+ of this gem. For Rails 3 - 4.1 use version 0.x
6
+
5
7
  It removes the need for AJAX calls to retrieve the templates (or for you to manually set them into the DOM).
6
8
 
7
9
  ## Usage
@@ -215,7 +217,7 @@ config.angular_templates.htmlcompressor = {
215
217
 
216
218
  ## License
217
219
 
218
- MIT License. Copyright 2014 Pitr
220
+ MIT License. Copyright 2017 pitr
219
221
 
220
222
  ## Authors & contributors
221
223
 
@@ -14,18 +14,22 @@ module AngularRailsTemplates
14
14
  # we only want to process html assets inside those specified in configuration.inside_paths
15
15
  @asset_should_be_processed = configuration.inside_paths.any? { |folder| file.match(folder.to_s) }
16
16
 
17
+ unless @asset_should_be_processed
18
+ @data = nil
19
+ return
20
+ end
21
+
17
22
  if configuration.htmlcompressor and @asset_should_be_processed
18
23
  @data = compress data
19
24
  end
20
25
  end
21
26
 
22
27
  def evaluate(scope, locals, &block)
23
- locals[:html] = escape_javascript data.chomp
24
- locals[:angular_template_name] = logical_template_path(scope)
25
- locals[:source_file] = "#{scope.pathname}".sub(/^#{Rails.root}\//,'')
26
- locals[:angular_module] = configuration.module_name
27
-
28
28
  if @asset_should_be_processed
29
+ locals[:html] = escape_javascript data.chomp
30
+ locals[:angular_template_name] = logical_template_path(scope)
31
+ locals[:source_file] = "#{scope.pathname}".sub(/^#{Rails.root}\//,'')
32
+ locals[:angular_module] = configuration.module_name
29
33
  AngularJsTemplateWrapper.render(scope, locals)
30
34
  else
31
35
  data
@@ -1,3 +1,3 @@
1
1
  module AngularRailsTemplates
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: angular-rails-templates
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damien Mathieu
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-04-30 00:00:00.000000000 Z
13
+ date: 2017-01-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: railties
@@ -32,14 +32,14 @@ dependencies:
32
32
  requirements:
33
33
  - - "~>"
34
34
  - !ruby/object:Gem::Version
35
- version: '2'
35
+ version: '2.0'
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: '2'
42
+ version: '2.0'
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: tilt
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -82,6 +82,20 @@ dependencies:
82
82
  - - ">="
83
83
  - !ruby/object:Gem::Version
84
84
  version: '0'
85
+ - !ruby/object:Gem::Dependency
86
+ name: mime-types
87
+ requirement: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - "<"
90
+ - !ruby/object:Gem::Version
91
+ version: '3'
92
+ type: :development
93
+ prerelease: false
94
+ version_requirements: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - "<"
97
+ - !ruby/object:Gem::Version
98
+ version: '3'
85
99
  - !ruby/object:Gem::Dependency
86
100
  name: uglifier
87
101
  requirement: !ruby/object:Gem::Requirement
@@ -132,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
146
  version: '0'
133
147
  requirements: []
134
148
  rubyforge_project:
135
- rubygems_version: 2.2.2
149
+ rubygems_version: 2.5.1
136
150
  signing_key:
137
151
  specification_version: 4
138
152
  summary: Use your angular templates with rails' asset pipeline