linner 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +3 -0
- data/lib/linner/asset.rb +6 -2
- data/lib/linner/version.rb +1 -1
- data/lib/linner/wrapper.rb +13 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 621f08f92c5f1e07d56b8bdef6826837958e39a1
|
4
|
+
data.tar.gz: 3fa21218b588ab55d3bc9cd1f144b87663b20a2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89898c38996e5c0fe23eec69eba7bb722232d1beef0200c95a93d89c9e2efa9ee59f180fcb7bd9403bd03b60dc139728468f40b32e25f3e26949432d54620c3c
|
7
|
+
data.tar.gz: 52183c4e3d0d9d16011490a59cc64863e1576532a1a71a7ecc9b07c7deec2909339257edebd9af0e79d8c42881d008eea0756e74d06f482c2dbeedc12660d8ec
|
data/CHANGELOG
CHANGED
data/lib/linner/asset.rb
CHANGED
@@ -51,8 +51,12 @@ module Linner
|
|
51
51
|
def wrap(source)
|
52
52
|
if javascript?
|
53
53
|
Wrapper::Module.wrap(logical_path.chomp(File.extname logical_path), source)
|
54
|
-
|
55
|
-
|
54
|
+
elsif template?
|
55
|
+
if File.basename(path).start_with?("_")
|
56
|
+
Wrapper::Template.partial_wrap(logical_path.chomp(File.extname logical_path), source)
|
57
|
+
else
|
58
|
+
Wrapper::Template.wrap(logical_path.chomp(File.extname logical_path), source)
|
59
|
+
end
|
56
60
|
end
|
57
61
|
end
|
58
62
|
|
data/lib/linner/version.rb
CHANGED
data/lib/linner/wrapper.rb
CHANGED
@@ -2,9 +2,9 @@ module Linner
|
|
2
2
|
module Wrapper
|
3
3
|
class Module
|
4
4
|
def self.wrap(name, content)
|
5
|
-
|
5
|
+
<<-WRAPPER
|
6
6
|
this.require.define({"#{name}":function(exports, require, module){#{content};}});
|
7
|
-
|
7
|
+
WRAPPER
|
8
8
|
end
|
9
9
|
|
10
10
|
def self.definition
|
@@ -14,18 +14,25 @@ this.require.define({"#{name}":function(exports, require, module){#{content};}})
|
|
14
14
|
|
15
15
|
class Template
|
16
16
|
def self.wrap(name, content)
|
17
|
-
|
17
|
+
<<-WRAPPER
|
18
18
|
templates["#{name}"] = template(#{content});
|
19
|
-
|
19
|
+
WRAPPER
|
20
20
|
end
|
21
21
|
|
22
|
+
def self.partial_wrap(name, content)
|
23
|
+
<<-PARTIAL
|
24
|
+
Handlebars.registerPartial("#{name}", Handlebars.template(#{content}));
|
25
|
+
PARTIAL
|
26
|
+
end
|
27
|
+
|
28
|
+
|
22
29
|
def self.definition(content)
|
23
|
-
|
30
|
+
<<-DEFINITION
|
24
31
|
(function() {
|
25
32
|
var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
|
26
33
|
#{content}
|
27
34
|
})();
|
28
|
-
|
35
|
+
DEFINITION
|
29
36
|
end
|
30
37
|
end
|
31
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: linner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Saito
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: reel
|