liquidscript 0.6.4 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/lscript +1 -1
- data/lib/liquidscript.rb +4 -1
- data/lib/liquidscript/template.rb +17 -10
- data/lib/liquidscript/version.rb +1 -1
- data/spec/support/matchers/run.rb +1 -1
- metadata +2 -3
- data/lib/sprockets/liquidscript_template.rb +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51ca166ca554e616ff1286df7160d3562d17bec9
|
4
|
+
data.tar.gz: 014dddad0abfc08a64e106287e9c22913baa407c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62a05f026218fb4b63e17bb462da4a52b03a51404daac97aeb3a717995d57c030c819ba77d9af731d58cd4067f32d82ece97cccefc489a4ea321686e5e4ba59e
|
7
|
+
data.tar.gz: dbc2e0f247123670a9472e0e507e6c3ea15f42b33f41678423ccdf138806c6793dd64d0617550bc8d1890996d248133fef51787a8e196fb3ea0a574a0c39742d
|
data/bin/lscript
CHANGED
@@ -13,7 +13,7 @@ outfile = ARGV.shift || infile.gsub(/\.liq\Z/, ".js")
|
|
13
13
|
File.open(infile, "r") do |f|
|
14
14
|
|
15
15
|
begin
|
16
|
-
out = Liquidscript
|
16
|
+
out = Liquidscript.compile(f.read)
|
17
17
|
File.open(outfile, "w") { |o| o.write out }
|
18
18
|
rescue StandardError => e
|
19
19
|
$stderr.puts "ERROR: #{e.class}: #{e.message}"
|
data/lib/liquidscript.rb
CHANGED
@@ -5,7 +5,10 @@ require "liquidscript/version"
|
|
5
5
|
require "liquidscript/scanner"
|
6
6
|
require "liquidscript/compiler"
|
7
7
|
require "liquidscript/generator"
|
8
|
-
|
8
|
+
|
9
|
+
if defined? ::Sprockets
|
10
|
+
require "liquidscript/template"
|
11
|
+
end
|
9
12
|
|
10
13
|
module Liquidscript
|
11
14
|
def self.compile(data)
|
@@ -1,18 +1,25 @@
|
|
1
|
-
require
|
1
|
+
require "liquidscript"
|
2
|
+
require "sprockets"
|
3
|
+
require "tilt"
|
2
4
|
|
3
5
|
module Liquidscript
|
4
|
-
class Template
|
6
|
+
class Template < ::Tilt::Template
|
7
|
+
self.default_mime_type = 'application/javascript'
|
5
8
|
|
6
|
-
def
|
7
|
-
|
9
|
+
def self.engine_initialized?
|
10
|
+
defined? ::Liquidscript
|
8
11
|
end
|
9
12
|
|
10
|
-
def
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
def initialize_engine
|
14
|
+
require_template_library "liquidscript"
|
15
|
+
end
|
16
|
+
|
17
|
+
def prepare; end
|
18
|
+
|
19
|
+
def evaluate(scope, locals, &block)
|
20
|
+
@output ||= Liquidscript.compile(data)
|
16
21
|
end
|
17
22
|
end
|
23
|
+
|
24
|
+
Sprockets.register_engine '.liq', Liquidscript::Template
|
18
25
|
end
|
data/lib/liquidscript/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: liquidscript
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Rodi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -155,7 +155,6 @@ files:
|
|
155
155
|
- lib/liquidscript/scanner/token.rb
|
156
156
|
- lib/liquidscript/template.rb
|
157
157
|
- lib/liquidscript/version.rb
|
158
|
-
- lib/sprockets/liquidscript_template.rb
|
159
158
|
- liquidscript.gemspec
|
160
159
|
- spec/fixtures/class.compile.yml
|
161
160
|
- spec/fixtures/class.generate.yml
|
@@ -1,16 +0,0 @@
|
|
1
|
-
require "liquidscript"
|
2
|
-
require "sprockets"
|
3
|
-
|
4
|
-
module Sprockets
|
5
|
-
class LiquidscriptTemplate < Template
|
6
|
-
def self.default_mime_type
|
7
|
-
'application/javascript'
|
8
|
-
end
|
9
|
-
|
10
|
-
def render(context)
|
11
|
-
@output ||= Liquidscript.compile(data)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
register_engine '.liq', LiquidscriptTemplate
|
16
|
-
end
|