mustache_render 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,17 +3,14 @@ module MustacheRender::CoreExt
3
3
  module BaseControllerExt
4
4
  def self.included(base)
5
5
  base.class_eval do
6
- helper_method :mustache_db_render
6
+ helper HelperMethods
7
7
 
8
8
  extend ClassMethods
9
9
  include InstanceMethods
10
10
  end
11
11
  end
12
12
 
13
- module ClassMethods
14
- end
15
-
16
- module InstanceMethods
13
+ module SharedMethods
17
14
  def mustache_render template='', mustache={}
18
15
  result = ::MustacheRender::Mustache.render(template, mustache)
19
16
  impl_mustache_result_render result
@@ -32,15 +29,28 @@ module MustacheRender::CoreExt
32
29
  result = ::MustacheRender::Mustache.db_render(template_path, mustache)
33
30
  impl_mustache_result_render result
34
31
  end
32
+ end
33
+
34
+ module ClassMethods
35
+ end
36
+
37
+ module HelperMethods
38
+ include SharedMethods
39
+
40
+ private
41
+
42
+ def impl_mustache_result_render(result)
43
+ raw result
44
+ end
45
+ end
46
+
47
+ module InstanceMethods
48
+ include SharedMethods
35
49
 
36
50
  private
37
51
 
38
52
  def impl_mustache_result_render(result)
39
- if self.is_a?(ActionController::Base)
40
- render :text => result
41
- else
42
- result
43
- end
53
+ render :text => result
44
54
  end
45
55
  end
46
56
  end
@@ -3,7 +3,7 @@ module MustacheRender
3
3
  VERSION_NUMBERS = [
4
4
  VERSION_MAJOR = 0,
5
5
  VERSION_MINOR = 0,
6
- VERSION_BUILD = 6,
6
+ VERSION_BUILD = 7,
7
7
  ]
8
8
 
9
9
  VERSION = VERSION_NUMBERS.join(".")
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mustache_render
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 6
10
- version: 0.0.6
9
+ - 7
10
+ version: 0.0.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - happy