barber 0.9.2 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Appraisals +2 -2
- data/gemfiles/ember_1.13.gemfile +8 -0
- data/gemfiles/ember_2.2.gemfile +8 -0
- data/lib/barber/precompiler.rb +9 -9
- data/lib/barber/version.rb +1 -1
- data/test/precompiler_test.rb +5 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5625eaae786d1fd075682f55735d7e0e99cb467
|
4
|
+
data.tar.gz: 51617b6c990fabbf84b3d8bfac22e7b6e18ffa7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fdf703d03d9312094022dd9c82bc506ca8cf4eba7d169d69c9392b595c254cc8d860cd49ec29d331ce74db5c5d9c29b1bdfc38a77dd7d4082fb5afa2907f705
|
7
|
+
data.tar.gz: 05ff8babde0380869157bbc9c15ee955e7feea79a1ad48d37c9eeb3dcba2269a6ae351703be72bc49de9e468a456cc3ddf28ed7e0b8a0466952ea798c2ff9e5c
|
data/Appraisals
CHANGED
@@ -23,9 +23,9 @@ appraise "ember-1.13" do
|
|
23
23
|
gem "ember-source", "~> 1.13.0"
|
24
24
|
end
|
25
25
|
|
26
|
-
appraise "ember-2.
|
26
|
+
appraise "ember-2.2" do
|
27
27
|
# Uses the latest of 2.x
|
28
|
-
gem "ember-source", "~> 2.
|
28
|
+
gem "ember-source", "~> 2.2.0"
|
29
29
|
end
|
30
30
|
|
31
31
|
appraise "handlebars-3.0" do
|
data/lib/barber/precompiler.rb
CHANGED
@@ -12,6 +12,14 @@ module Barber
|
|
12
12
|
instance.compiler_version
|
13
13
|
end
|
14
14
|
|
15
|
+
def handlebars_available?
|
16
|
+
require 'handlebars/source' # handlebars precompilation is optional feature.
|
17
|
+
rescue LoadError => e
|
18
|
+
raise e unless ['cannot load such file -- handlebars/source', 'no such file to load -- handlebars/source'].include?(e.message)
|
19
|
+
ensure
|
20
|
+
return !!defined?(Handlebars::Source)
|
21
|
+
end
|
22
|
+
|
15
23
|
private
|
16
24
|
|
17
25
|
def instance
|
@@ -31,7 +39,7 @@ module Barber
|
|
31
39
|
|
32
40
|
def sources
|
33
41
|
sources = [precompiler]
|
34
|
-
sources << handlebars if handlebars_available?
|
42
|
+
sources << handlebars if self.class.handlebars_available?
|
35
43
|
sources
|
36
44
|
end
|
37
45
|
|
@@ -103,14 +111,6 @@ if (typeof self === 'undefined') {
|
|
103
111
|
SOURCE
|
104
112
|
end
|
105
113
|
|
106
|
-
def handlebars_available?
|
107
|
-
require "handlebars/source" # handlebars precompilation is optional feature.
|
108
|
-
rescue LoadError => e
|
109
|
-
raise e unless ['cannot load such file -- handlebars/source', 'no such file to load -- handlebars/source'].include?(e.message)
|
110
|
-
ensure
|
111
|
-
return !!defined?(Handlebars::Source)
|
112
|
-
end
|
113
|
-
|
114
114
|
def handlebars_version
|
115
115
|
@handlebars_version ||= context.eval('Handlebars.VERSION')
|
116
116
|
end
|
data/lib/barber/version.rb
CHANGED
data/test/precompiler_test.rb
CHANGED
@@ -66,6 +66,10 @@ class PrecompilerTest < MiniTest::Unit::TestCase
|
|
66
66
|
assert result
|
67
67
|
end
|
68
68
|
|
69
|
+
def test_handlebars_available_works
|
70
|
+
assert Barber::Precompiler.handlebars_available?
|
71
|
+
end
|
72
|
+
|
69
73
|
def test_raises_an_error_on_bad_templates
|
70
74
|
assert_raises Barber::PrecompilerError do
|
71
75
|
compile "Hello {{"
|
@@ -89,7 +93,7 @@ class PrecompilerTest < MiniTest::Unit::TestCase
|
|
89
93
|
def test_has_an_easy_to_customize_public_interface
|
90
94
|
custom_compiler = Class.new Barber::Precompiler do
|
91
95
|
# Stub for non-handlebars environment
|
92
|
-
def handlebars_available?
|
96
|
+
def self.handlebars_available?
|
93
97
|
false
|
94
98
|
end
|
95
99
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: barber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tchak
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-12-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: execjs
|
@@ -153,8 +153,10 @@ files:
|
|
153
153
|
- barber.gemspec
|
154
154
|
- gemfiles/ember_1.0.gemfile
|
155
155
|
- gemfiles/ember_1.10.gemfile
|
156
|
+
- gemfiles/ember_1.13.gemfile
|
156
157
|
- gemfiles/ember_1.8.gemfile
|
157
158
|
- gemfiles/ember_1.9.gemfile
|
159
|
+
- gemfiles/ember_2.2.gemfile
|
158
160
|
- gemfiles/handlebars_3.0.gemfile
|
159
161
|
- lib/barber.rb
|
160
162
|
- lib/barber/ember/precompiler.rb
|
@@ -189,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
189
191
|
version: '0'
|
190
192
|
requirements: []
|
191
193
|
rubyforge_project:
|
192
|
-
rubygems_version: 2.4.
|
194
|
+
rubygems_version: 2.4.5.1
|
193
195
|
signing_key:
|
194
196
|
specification_version: 4
|
195
197
|
summary: Handlebars precompilation toolkit
|