sanford-nm 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +8 -0
- data/lib/sanford-nm/version.rb +1 -1
- data/lib/sanford-nm.rb +2 -1
- data/sanford-nm.gemspec +2 -2
- data/test/unit/template_engine_tests.rb +5 -0
- metadata +10 -10
data/README.md
CHANGED
@@ -31,6 +31,14 @@ Nm doesn't allow overriding the template scope but instead allows you to pass in
|
|
31
31
|
end
|
32
32
|
```
|
33
33
|
|
34
|
+
Nm doesn't cache templates by default. To enable caching, pass a `'cache'` option when registering:
|
35
|
+
|
36
|
+
```ruby
|
37
|
+
c.template_source "/path/to/templates" do |s|
|
38
|
+
s.engine 'nm', Sanford::Nm::TemplateEngine, 'cache' => true
|
39
|
+
end
|
40
|
+
```
|
41
|
+
|
34
42
|
## Installation
|
35
43
|
|
36
44
|
Add this line to your application's Gemfile:
|
data/lib/sanford-nm/version.rb
CHANGED
data/lib/sanford-nm.rb
CHANGED
data/sanford-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("sanford", ["~> 0.
|
24
|
-
gem.add_dependency("nm", ["~> 0.
|
23
|
+
gem.add_dependency("sanford", ["~> 0.13"])
|
24
|
+
gem.add_dependency("nm", ["~> 0.5"])
|
25
25
|
|
26
26
|
end
|
@@ -38,6 +38,11 @@ class Sanford::Nm::TemplateEngine
|
|
38
38
|
assert_equal handler_local, engine.nm_handler_local
|
39
39
|
end
|
40
40
|
|
41
|
+
should "pass any given cache option to the Nm source" do
|
42
|
+
engine = Sanford::Nm::TemplateEngine.new('cache' => true)
|
43
|
+
assert_kind_of Hash, engine.nm_source.cache
|
44
|
+
end
|
45
|
+
|
41
46
|
should "use 'logger' as the logger local name by default" do
|
42
47
|
assert_equal 'logger', subject.nm_logger_local
|
43
48
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sanford-nm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 3
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.3.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:
|
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:
|
42
|
+
hash: 17
|
43
43
|
segments:
|
44
44
|
- 0
|
45
|
-
-
|
46
|
-
version: "0.
|
45
|
+
- 13
|
46
|
+
version: "0.13"
|
47
47
|
type: :runtime
|
48
48
|
name: sanford
|
49
49
|
version_requirements: *id002
|
@@ -54,11 +54,11 @@ dependencies:
|
|
54
54
|
requirements:
|
55
55
|
- - ~>
|
56
56
|
- !ruby/object:Gem::Version
|
57
|
-
hash:
|
57
|
+
hash: 1
|
58
58
|
segments:
|
59
59
|
- 0
|
60
|
-
-
|
61
|
-
version: "0.
|
60
|
+
- 5
|
61
|
+
version: "0.5"
|
62
62
|
type: :runtime
|
63
63
|
name: nm
|
64
64
|
version_requirements: *id003
|