handlebars_assets 0.19 → 0.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 86ae472df1dc68b349cd283c6f5890542bd015ef
4
- data.tar.gz: 06a45ba988b9a64479132f25bb622b2d9cfbf1d4
3
+ metadata.gz: 5c1155389dd205ef3621842a8035be4a3b382852
4
+ data.tar.gz: 1e31aed6066e1d2c432699f124fe48b2d496b449
5
5
  SHA512:
6
- metadata.gz: 37b55ebad1113279ead05407bc51bc54b35fa48cb3cf8c2b1c661835e42223facc5956237d7bd4b51d20af84ce800381b48992d6de5c2e2d5bf2b9fb6f974410
7
- data.tar.gz: 69bc8d7bc7d3fbde5802f9d02d1b78d8bc6079a70507dd734d244761318461ee02045e7ec9ddc7d63783f1df5657baad154213f9b3c63502118797a9b456b178
6
+ metadata.gz: 7d4f0673c0190056842528c0ca3b7987aafe5e6e9691818ffbe5d332ec9d1f1ab22bc8ed9a6a0baa562b3b2eaef53d780c2684fc0cfbf5ccaeb8cb1a17baa327
7
+ data.tar.gz: 041be79883b641c42659d28be50c9f51c11d6ad467486de8ebe4aa9ebcdd8f0699e719966cac85b9aabc25f755f8ed055a77787dc5e6fd0e777bcb65d182d3f7
@@ -144,15 +144,21 @@ module HandlebarsAssets
144
144
  @full_path = path
145
145
  end
146
146
 
147
+ def check_extension(ext)
148
+ result = false
149
+ if ext.start_with? '.'
150
+ ext = "\\#{ext}"
151
+ result ||= !(@full_path =~ /#{ext}(\..*)*$/).nil?
152
+ else
153
+ result ||= !(@full_path =~ /\.#{ext}(\..*)*$/).nil?
154
+ end
155
+ result
156
+ end
157
+
147
158
  def is_haml?
148
159
  result = false
149
160
  ::HandlebarsAssets::Config.hamlbars_extensions.each do |ext|
150
- if ext.start_with? '.'
151
- ext = '\\#{ext}'
152
- result ||= !(@full_path =~ /#{ext}(\..*)*$/).nil?
153
- else
154
- result ||= !(@full_path =~ /\.#{ext}(\..*)*$/).nil?
155
- end
161
+ result ||= check_extension(ext)
156
162
  end
157
163
  result
158
164
  end
@@ -160,33 +166,23 @@ module HandlebarsAssets
160
166
  def is_slim?
161
167
  result = false
162
168
  ::HandlebarsAssets::Config.slimbars_extensions.each do |ext|
163
- if ext.start_with? '.'
164
- ext = '\\#{ext}'
165
- result ||= !(@full_path =~ /#{ext}(\..*)*$/).nil?
166
- else
167
- result ||= !(@full_path =~ /\.#{ext}(\..*)*$/).nil?
168
- end
169
+ result ||= check_extension(ext)
169
170
  end
170
171
  result
171
172
  end
172
173
 
173
- def is_partial?
174
- @full_path.gsub(%r{.*/}, '').start_with?('_')
175
- end
176
-
177
174
  def is_ember?
178
175
  result = false
179
176
  ::HandlebarsAssets::Config.ember_extensions.each do |ext|
180
- if ext.start_with? '.'
181
- ext = '\\#{ext}'
182
- result ||= !(@full_path =~ /#{ext}(\..*)*$/).nil?
183
- else
184
- result ||= !(@full_path =~ /\.#{ext}(\..*)*$/).nil?
185
- end
177
+ result ||= check_extension(ext)
186
178
  end
187
179
  result
188
180
  end
189
181
 
182
+ def is_partial?
183
+ @full_path.gsub(%r{.*/}, '').start_with?('_')
184
+ end
185
+
190
186
  def name
191
187
  template_name
192
188
  end
@@ -1,3 +1,3 @@
1
1
  module HandlebarsAssets
2
- VERSION = "0.19"
2
+ VERSION = "0.19.1"
3
3
  end
@@ -143,6 +143,7 @@ module HandlebarsAssets
143
143
  source = "This is {{handlebars}}"
144
144
 
145
145
  HandlebarsAssets::Config.ember = true
146
+ HandlebarsAssets::Config.multiple_frameworks = false
146
147
  template = HandlebarsAssets::HandlebarsTemplate.new(scope.pathname.to_s) { source }
147
148
 
148
149
  expected_compiled = %{window.Ember.TEMPLATES["test_render"] = Ember.Handlebars.compile("This is {{handlebars}}");};
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: handlebars_assets
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.19'
4
+ version: 0.19.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Les Hill
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-19 00:00:00.000000000 Z
11
+ date: 2015-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: execjs