barber-emblem 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,18 @@
1
+ require 'test_helper'
2
+
3
+ class EmblemEmberPrecompilerTest < MiniTest::Unit::TestCase
4
+ def test_calls_the_ember_handlebars_precompiler
5
+ result = compile "p Hello"
6
+ assert result
7
+ assert_match result, /Ember\.Handlebars/
8
+ end
9
+
10
+ def test_is_a_precompiler
11
+ assert Barber::Emblem::EmberPrecompiler < Barber::Ember::Precompiler,
12
+ "Emblem's Ember precompile should inherit from Barber::Embler::Precompiler"
13
+ end
14
+
15
+ def compile(template)
16
+ Barber::Emblem::EmberPrecompiler.compile template
17
+ end
18
+ end
@@ -0,0 +1,14 @@
1
+ require 'test_helper'
2
+
3
+ class EmblemEmberPrecompilersTest < MiniTest::Unit::TestCase
4
+ def template ; "hello" ; end
5
+ def compiled_template ; "function()" ; end
6
+
7
+ def test_precompiles_template_files
8
+ Barber::Emblem::EmberPrecompiler.expects(:compile).with(template).returns(compiled_template)
9
+
10
+ result = Barber::Emblem::EmberFilePrecompiler.call(template)
11
+ assert_equal "Ember.Handlebars.template(#{compiled_template});", result
12
+ end
13
+ end
14
+
@@ -0,0 +1,19 @@
1
+ require 'test_helper'
2
+
3
+ class EmblemPrecompilerTest < MiniTest::Unit::TestCase
4
+ def test_calls_the_ember_handlebars_precompiler
5
+ result = compile "p Hello"
6
+ assert result
7
+ assert_match result, /Handlebars/
8
+ refute_match result, /Ember/
9
+ end
10
+
11
+ def test_is_a_precompiler
12
+ assert Barber::Emblem::Precompiler < Barber::Precompiler,
13
+ "Emblem precompile should inherit from Barber::Precompiler"
14
+ end
15
+
16
+ def compile(template)
17
+ Barber::Emblem::Precompiler.compile template
18
+ end
19
+ end
@@ -0,0 +1,13 @@
1
+ require 'test_helper'
2
+
3
+ class EmblemPrecompilersTest < MiniTest::Unit::TestCase
4
+ def template ; "hello" ; end
5
+ def compiled_template ; "function()" ; end
6
+
7
+ def test_precompiles_template_files
8
+ Barber::Emblem::Precompiler.expects(:compile).with(template).returns(compiled_template)
9
+
10
+ result = Barber::Emblem::FilePrecompiler.call(template)
11
+ assert_equal "Handlebars.template(#{compiled_template});", result
12
+ end
13
+ end
@@ -0,0 +1,9 @@
1
+ require 'simplecov'
2
+ SimpleCov.start
3
+
4
+ require 'barber-emblem'
5
+
6
+ require 'minitest/unit'
7
+ require 'minitest/autorun'
8
+
9
+ require 'mocha'
metadata ADDED
@@ -0,0 +1,137 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: barber-emblem
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Alex Matchneer
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-02-08 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: barber
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: simplecov
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: mocha
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ description: Emblem.js precompilation
79
+ email:
80
+ - machty@gmail.com
81
+ executables: []
82
+ extensions: []
83
+ extra_rdoc_files: []
84
+ files:
85
+ - .gitignore
86
+ - .travis.yml
87
+ - Gemfile
88
+ - LICENSE
89
+ - README.md
90
+ - Rakefile
91
+ - barber-emblem.gemspec
92
+ - lib/barber-emblem.rb
93
+ - lib/barber/emblem/ember_precompiler.rb
94
+ - lib/barber/emblem/ember_precompilers.rb
95
+ - lib/barber/emblem/precompiler.rb
96
+ - lib/barber/emblem/precompilers.rb
97
+ - lib/barber/emblem/version.rb
98
+ - lib/barber/javascripts/ember-template-compiler.js
99
+ - lib/barber/javascripts/emblem.js
100
+ - lib/barber/javascripts/emblem_precompiler.js
101
+ - lib/barber/javascripts/handlebars.js
102
+ - test/emblem/ember_precompiler_test.rb
103
+ - test/emblem/ember_precompilers_test.rb
104
+ - test/emblem/precompiler_test.rb
105
+ - test/emblem/precompilers_test.rb
106
+ - test/test_helper.rb
107
+ homepage: https://github.com/machty/barber-emblem
108
+ licenses: []
109
+ post_install_message:
110
+ rdoc_options: []
111
+ require_paths:
112
+ - lib
113
+ required_ruby_version: !ruby/object:Gem::Requirement
114
+ none: false
115
+ requirements:
116
+ - - ! '>='
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ required_rubygems_version: !ruby/object:Gem::Requirement
120
+ none: false
121
+ requirements:
122
+ - - ! '>='
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ requirements: []
126
+ rubyforge_project:
127
+ rubygems_version: 1.8.24
128
+ signing_key:
129
+ specification_version: 3
130
+ summary: Emblem.js precompilation toolkit
131
+ test_files:
132
+ - test/emblem/ember_precompiler_test.rb
133
+ - test/emblem/ember_precompilers_test.rb
134
+ - test/emblem/precompiler_test.rb
135
+ - test/emblem/precompilers_test.rb
136
+ - test/test_helper.rb
137
+ has_rdoc: