sanford-nm 0.4.4 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/sanford-nm.rb +4 -0
- data/lib/sanford-nm/version.rb +1 -1
- data/sanford-nm.gemspec +2 -2
- data/test/support/factory.rb +11 -3
- data/test/support/partial_template.json.nm +4 -0
- data/test/support/{template.json.aaa → render_template.json.aaa} +0 -0
- data/test/support/render_template.json.nm +6 -0
- data/test/unit/template_engine_tests.rb +9 -3
- metadata +11 -9
- data/test/support/template.json.nm +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
SHA512:
|
3
|
-
metadata.gz: 4538cb3737eb14abb624f073411372dc75e97200eb1bd4966bf248923ea39676afbb85b054377521b38803cbee45d25bd72f50ef490f975719b624f98796fbd9
|
4
|
-
data.tar.gz: 56699ba02420925b6424f83efa940fff51eaf50113ec037cb305394481a2584d4f07cba272c95aae618d9d286692ade00df5c6432f780d6f9641cf95427c4f3d
|
5
2
|
SHA1:
|
6
|
-
|
7
|
-
|
3
|
+
data.tar.gz: bb0f54e117216f9dacfcb5cfdb5a63d7d9c59fdc
|
4
|
+
metadata.gz: d54d833d58d64941c97ca4bb697ed083e8f11dc6
|
5
|
+
SHA512:
|
6
|
+
data.tar.gz: 385d8bbf4bb6515d62a3b09e250b9ff55376727bbfd4d5352fc13d4e7b06cb48b465477f9f8041eaf8026dbdaa15acfa9ab5e00f165f9958d61c77566fc67488
|
7
|
+
metadata.gz: f5d55ffae7998fa11ccda8761268be95d4ee22e617d430c781e15d03c3fed9c1360511e35d17818e36a51344b5d2e191991c5e091166fdde0acb22856d1485ea
|
data/lib/sanford-nm.rb
CHANGED
data/lib/sanford-nm/version.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.16.3"])
|
22
22
|
|
23
|
-
gem.add_dependency("sanford", ["~> 0.19.
|
24
|
-
gem.add_dependency("nm", ["~> 0.5.
|
23
|
+
gem.add_dependency("sanford", ["~> 0.19.1"])
|
24
|
+
gem.add_dependency("nm", ["~> 0.5.4"])
|
25
25
|
|
26
26
|
end
|
data/test/support/factory.rb
CHANGED
@@ -3,10 +3,18 @@ require 'assert/factory'
|
|
3
3
|
module Factory
|
4
4
|
extend Assert::Factory
|
5
5
|
|
6
|
-
def self.
|
6
|
+
def self.render_template_json_rendered(engine, service_handler, locals)
|
7
|
+
{ 'thing' => {
|
8
|
+
'id' => service_handler.identifier,
|
9
|
+
'name' => service_handler.name,
|
10
|
+
'local1' => locals['local1'],
|
11
|
+
'logger' => engine.logger.to_s
|
12
|
+
}
|
13
|
+
}
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.partial_template_json_rendered(engine, locals)
|
7
17
|
{ 'thing' => {
|
8
|
-
'id' => service_handler.identifier,
|
9
|
-
'name' => service_handler.name,
|
10
18
|
'local1' => locals['local1'],
|
11
19
|
'logger' => engine.logger.to_s
|
12
20
|
}
|
File without changes
|
@@ -17,7 +17,7 @@ class Sanford::Nm::TemplateEngine
|
|
17
17
|
subject{ @engine }
|
18
18
|
|
19
19
|
should have_imeths :nm_source, :nm_handler_local, :nm_logger_local
|
20
|
-
should have_imeths :render
|
20
|
+
should have_imeths :render, :partial
|
21
21
|
|
22
22
|
should "be a Sanford template engine" do
|
23
23
|
assert_kind_of Sanford::TemplateEngine, subject
|
@@ -66,8 +66,14 @@ class Sanford::Nm::TemplateEngine
|
|
66
66
|
:name => Factory.string
|
67
67
|
})
|
68
68
|
locals = { 'local1' => Factory.string }
|
69
|
-
exp = Factory.
|
70
|
-
assert_equal exp, subject.render('
|
69
|
+
exp = Factory.render_template_json_rendered(subject, service_handler, locals)
|
70
|
+
assert_equal exp, subject.render('render_template.json', service_handler, locals)
|
71
|
+
end
|
72
|
+
|
73
|
+
should "render nm partial template files" do
|
74
|
+
locals = { 'local1' => Factory.string }
|
75
|
+
exp = Factory.partial_template_json_rendered(subject, locals)
|
76
|
+
assert_equal exp, subject.partial('partial_template.json', locals)
|
71
77
|
end
|
72
78
|
|
73
79
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sanford-nm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kelly Redding
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date:
|
13
|
+
date: 2017-08-17 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: assert
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 0.19.
|
32
|
+
version: 0.19.1
|
33
33
|
type: :runtime
|
34
34
|
version_requirements: *id002
|
35
35
|
- !ruby/object:Gem::Dependency
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
requirements:
|
40
40
|
- - ~>
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 0.5.
|
42
|
+
version: 0.5.4
|
43
43
|
type: :runtime
|
44
44
|
version_requirements: *id003
|
45
45
|
description: Sanford template engine for Nm templates
|
@@ -63,8 +63,9 @@ files:
|
|
63
63
|
- sanford-nm.gemspec
|
64
64
|
- test/helper.rb
|
65
65
|
- test/support/factory.rb
|
66
|
-
- test/support/
|
67
|
-
- test/support/
|
66
|
+
- test/support/partial_template.json.nm
|
67
|
+
- test/support/render_template.json.aaa
|
68
|
+
- test/support/render_template.json.nm
|
68
69
|
- test/unit/template_engine_tests.rb
|
69
70
|
- tmp/.gitkeep
|
70
71
|
homepage: http://github.com/redding/sanford-nm
|
@@ -89,13 +90,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
90
|
requirements: []
|
90
91
|
|
91
92
|
rubyforge_project:
|
92
|
-
rubygems_version: 2.6.
|
93
|
+
rubygems_version: 2.6.6
|
93
94
|
signing_key:
|
94
95
|
specification_version: 4
|
95
96
|
summary: Sanford template engine for Nm templates
|
96
97
|
test_files:
|
97
98
|
- test/helper.rb
|
98
99
|
- test/support/factory.rb
|
99
|
-
- test/support/
|
100
|
-
- test/support/
|
100
|
+
- test/support/partial_template.json.nm
|
101
|
+
- test/support/render_template.json.aaa
|
102
|
+
- test/support/render_template.json.nm
|
101
103
|
- test/unit/template_engine_tests.rb
|