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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 736f868d09a7035672d92d0b0f8b756717152cc8
4
- data.tar.gz: ebd936d446402ce78fe99cb4f6a3b7fd2daa386c
3
+ metadata.gz: 541c41b1ef57f7c8aa8d46dc5462972ec46df7b7
4
+ data.tar.gz: e17db95b14f59a0af4d4aadf6476bebb71b45e9c
5
5
  SHA512:
6
- metadata.gz: 1575cf7da2d1672e9bc120b9b434b7cefd3b089023dbb64a8790fd79d434ac1bed975167abb004e87f43011dd481158a7cea26e7b3fdf37d5327789b71a98609
7
- data.tar.gz: 01730519be7fc50c32a2a1ea79afad8c43f297a9efde9f08e8c4510c0133bd1b854feff425f9f90f6fccd86e45f545b1dc392ad1d7b2c6ab509825947572ef0e
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
- mode: Rails.configuration.ng_template.mode,
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: partial_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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module NgTemplate
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
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.1
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-13 00:00:00.000000000 Z
11
+ date: 2015-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails