opal-haml 0.3.0 → 0.4.0
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 +4 -4
- data/CHANGELOG.md +9 -1
- data/Rakefile +1 -0
- data/lib/opal/haml/processor.rb +7 -13
- data/lib/opal/haml/version.rb +1 -1
- data/lib/opal/haml.rb +6 -1
- metadata +3 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e33b7eaf522a6cecf841934bcef00144f3cd5594
|
|
4
|
+
data.tar.gz: acc6c1d3be312df2dd0224685ac09d9084762017
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: de66f0e58bdddfadc3423c8259abc289a08630e8084a5af14c27d38e27a9b7b9060e34fe15888e52bc03ab2b9a10545eb996c3394fd72f083866a411906ae941
|
|
7
|
+
data.tar.gz: 91d0745a2c2202cc4b113bf9059fc70bdf355b551463b272fb5efe0ef5d13b6e98ebef205f04b02e7a1c83c1828f8bd4476a2392c467ba9c74a37368fe652aaf
|
data/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
|
+
## 0.3.0 2015-08-07
|
|
2
|
+
|
|
3
|
+
* Add support for Opal 0.8.
|
|
4
|
+
|
|
5
|
+
* Update the processor to reuse the good stuff from the Opal::Processor.
|
|
6
|
+
|
|
7
|
+
* Now each compiled template automatically requires `opal-haml` with the new module system.
|
|
8
|
+
|
|
1
9
|
## 0.3.0 2015-02-03
|
|
2
10
|
|
|
3
11
|
* Add support for new opal Builder processors.
|
|
4
12
|
|
|
5
13
|
* Implicitly require `opal-haml` when any haml template is required
|
|
6
14
|
|
|
7
|
-
* Cleanup generated code to be use Opal ERB runtime directly
|
|
15
|
+
* Cleanup generated code to be use Opal ERB runtime directly.
|
|
8
16
|
|
|
9
17
|
## 0.2.0 2013-12-17
|
|
10
18
|
|
data/Rakefile
CHANGED
data/lib/opal/haml/processor.rb
CHANGED
|
@@ -3,23 +3,17 @@ require 'sprockets'
|
|
|
3
3
|
|
|
4
4
|
module Opal
|
|
5
5
|
module Haml
|
|
6
|
-
class Processor <
|
|
6
|
+
class Processor < ::Opal::Processor
|
|
7
7
|
self.default_mime_type = 'application/javascript'
|
|
8
8
|
|
|
9
|
-
def
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def initialize_engine
|
|
14
|
-
require_template_library 'opal'
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def prepare
|
|
9
|
+
def evaluate(context, locals, &block)
|
|
10
|
+
@data = Opal::Haml.compile_haml @data, context.logical_path.sub(/^templates\//, '')
|
|
11
|
+
super
|
|
18
12
|
end
|
|
19
13
|
|
|
20
|
-
def
|
|
21
|
-
|
|
22
|
-
Opal::
|
|
14
|
+
def self.compiler_options
|
|
15
|
+
# otherwise would check current class `attr_accessor`s
|
|
16
|
+
::Opal::Processor.compiler_options
|
|
23
17
|
end
|
|
24
18
|
end
|
|
25
19
|
end
|
data/lib/opal/haml/version.rb
CHANGED
data/lib/opal/haml.rb
CHANGED
|
@@ -6,13 +6,18 @@ require 'opal/haml/version'
|
|
|
6
6
|
module Opal
|
|
7
7
|
module Haml
|
|
8
8
|
def self.compile(source, file = '(haml)')
|
|
9
|
+
Opal.compile(compile_haml(source, file))
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def self.compile_haml(source, file)
|
|
9
13
|
haml = ::Haml::Engine.new(source, :ugly => true).precompiled
|
|
10
14
|
haml = haml.gsub('_hamlout.buffer', '_hamlout')
|
|
11
|
-
|
|
15
|
+
wrap(haml, file)
|
|
12
16
|
end
|
|
13
17
|
|
|
14
18
|
def self.wrap(haml, file)
|
|
15
19
|
<<-EOS
|
|
20
|
+
require 'opal-haml'
|
|
16
21
|
Template.new('#{file}') do |_hamlout|
|
|
17
22
|
#{haml}
|
|
18
23
|
_hamlout.join
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: opal-haml
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Adam Beynon
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-08-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: opal
|
|
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
118
118
|
version: '0'
|
|
119
119
|
requirements: []
|
|
120
120
|
rubyforge_project:
|
|
121
|
-
rubygems_version: 2.4.
|
|
121
|
+
rubygems_version: 2.4.6
|
|
122
122
|
signing_key:
|
|
123
123
|
specification_version: 4
|
|
124
124
|
summary: Run Haml templates client-side with Opal
|
|
@@ -129,4 +129,3 @@ test_files:
|
|
|
129
129
|
- spec/output_buffer_spec.rb
|
|
130
130
|
- spec/simple.haml
|
|
131
131
|
- spec/spec_helper.rb
|
|
132
|
-
has_rdoc:
|