ng_template 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/ng_template/template_helper.rb +6 -6
- data/lib/ng_template/engine.rb +0 -6
- data/lib/ng_template/version.rb +1 -1
- 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: 541c41b1ef57f7c8aa8d46dc5462972ec46df7b7
|
4
|
+
data.tar.gz: e17db95b14f59a0af4d4aadf6476bebb71b45e9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9905ff7313e380e55e8199fa08197236b63e70ac3762a3fc482d7ac6c5faab1ac853629d05dabf3a9ab8fcace7c5aad662d403117ef4baed57736f38e20a2542
|
7
|
+
data.tar.gz: 583f27db3d68c2e546522e6e653f331f80d24cffd5f1e74c7993dbea9e0cf02beed1430c4f587a24d7bffdd543508a9f566c9520f79a69efbf0c15d3d4ffaf6f
|
@@ -13,8 +13,7 @@ module TemplateHelper
|
|
13
13
|
@view_ctx = view_ctx
|
14
14
|
@paths = Array(paths)
|
15
15
|
@opt = {
|
16
|
-
|
17
|
-
prefix: Rails.configuration.ng_template.prefix,
|
16
|
+
prefix: '_ng_',
|
18
17
|
}.merge!(opt)
|
19
18
|
end
|
20
19
|
|
@@ -46,8 +45,9 @@ module TemplateHelper
|
|
46
45
|
Dir["#{view_path}/#{path}/#{@opt[:prefix]}*.html*"].map do |file_path|
|
47
46
|
name = File.basename(file_path)
|
48
47
|
partial_name = path + "/" + name[1, name.index('.') - 1]
|
48
|
+
template_name = path + "/" + name[@opt[:prefix].length..(name.index('.') - 1)]
|
49
49
|
{
|
50
|
-
name:
|
50
|
+
name: template_name,
|
51
51
|
content: render_template(partial_name),
|
52
52
|
}
|
53
53
|
end
|
@@ -63,10 +63,10 @@ module TemplateHelper
|
|
63
63
|
end
|
64
64
|
|
65
65
|
#
|
66
|
-
# Render all templates in given path
|
66
|
+
# Render all templates in given path as HTML
|
67
67
|
#
|
68
|
-
def ng_template_include(paths)
|
69
|
-
TemplateRenderer.new(self, paths).render
|
68
|
+
def ng_template_include(paths, opt = {})
|
69
|
+
TemplateRenderer.new(self, paths, opt).render
|
70
70
|
end
|
71
71
|
end
|
72
72
|
end
|
data/lib/ng_template/engine.rb
CHANGED
@@ -1,11 +1,5 @@
|
|
1
1
|
module NgTemplate
|
2
2
|
class Engine < ::Rails::Engine
|
3
3
|
isolate_namespace NgTemplate
|
4
|
-
|
5
|
-
initializer 'ng_template init' do
|
6
|
-
config.ng_template = ActiveSupport::OrderedOptions.new
|
7
|
-
config.ng_template.mode = :html
|
8
|
-
config.ng_template.prefix = '_'
|
9
|
-
end
|
10
4
|
end
|
11
5
|
end
|
data/lib/ng_template/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ng_template
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kari Ikonen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|