deas-nm 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -62,6 +62,14 @@ c.template_source "/path/to/templates" do |s|
62
62
  end
63
63
  ```
64
64
 
65
+ Nm doesn't cache templates by default. To enable caching, pass a `'cache'` option when registering:
66
+
67
+ ```ruby
68
+ c.template_source "/path/to/templates" do |s|
69
+ s.engine 'nm', Deas::Nm::TemplateEngine, 'cache' => true
70
+ end
71
+ ```
72
+
65
73
  ## Installation
66
74
 
67
75
  Add this line to your application's Gemfile:
data/deas-nm.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |gem|
20
20
 
21
21
  gem.add_development_dependency("assert", ["~> 2.12"])
22
22
 
23
- gem.add_dependency("deas", ["~> 0.29"])
24
- gem.add_dependency("nm", ["~> 0.4"])
23
+ gem.add_dependency("deas", ["~> 0.30"])
24
+ gem.add_dependency("nm", ["~> 0.5"])
25
25
 
26
26
  end
data/lib/deas-nm.rb CHANGED
@@ -12,7 +12,8 @@ module Deas::Nm
12
12
 
13
13
  def nm_source
14
14
  @nm_source ||= Nm::Source.new(self.source_path, {
15
- self.nm_logger_local => self.logger
15
+ :cache => self.opts['cache'],
16
+ :locals => { self.nm_logger_local => self.logger }
16
17
  })
17
18
  end
18
19
 
@@ -1,4 +1,4 @@
1
1
  module Deas; end
2
2
  module Deas::Nm
3
- VERSION = "0.3.0"
3
+ VERSION = "0.4.0"
4
4
  end
@@ -39,6 +39,11 @@ class Deas::Nm::TemplateEngine
39
39
  assert_equal handler_local, engine.nm_handler_local
40
40
  end
41
41
 
42
+ should "pass any given cache option to the Nm source" do
43
+ engine = Deas::Nm::TemplateEngine.new('cache' => true)
44
+ assert_kind_of Hash, engine.nm_source.cache
45
+ end
46
+
42
47
  should "use 'logger' as the logger local name by default" do
43
48
  assert_equal 'logger', subject.nm_logger_local
44
49
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deas-nm
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 3
8
+ - 4
9
9
  - 0
10
- version: 0.3.0
10
+ version: 0.4.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Kelly Redding
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2015-01-08 00:00:00 Z
19
+ date: 2015-02-04 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  requirement: &id001 !ruby/object:Gem::Requirement
@@ -39,11 +39,11 @@ dependencies:
39
39
  requirements:
40
40
  - - ~>
41
41
  - !ruby/object:Gem::Version
42
- hash: 49
42
+ hash: 55
43
43
  segments:
44
44
  - 0
45
- - 29
46
- version: "0.29"
45
+ - 30
46
+ version: "0.30"
47
47
  type: :runtime
48
48
  name: deas
49
49
  version_requirements: *id002
@@ -54,11 +54,11 @@ dependencies:
54
54
  requirements:
55
55
  - - ~>
56
56
  - !ruby/object:Gem::Version
57
- hash: 3
57
+ hash: 1
58
58
  segments:
59
59
  - 0
60
- - 4
61
- version: "0.4"
60
+ - 5
61
+ version: "0.5"
62
62
  type: :runtime
63
63
  name: nm
64
64
  version_requirements: *id003