sanford-nm 0.4.1 → 0.4.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
- SHA1:
3
- data.tar.gz: 834a6d7ec88b5a1333806023e84ab1dd76074e99
4
- metadata.gz: 20bb17567ddf1f61018f6f88a44e739ae208f155
5
2
  SHA512:
6
- data.tar.gz: 27728ab96990d686d2386d83852cb7e21f2e77ea0967db981b5b50ac5fcf82f4fe5b4f1a3a3cd01093f22f99487147b7317896e68a28de93bacd52d95c3d356b
7
- metadata.gz: bdfa6729427b79e95890cea950a028a8810f8d2c5a63c408b26bb13543aecf7d9c85e125164ef4cd95a414d0f9237ed2619be1f2581f4706b36f4391e74a3b7a
3
+ metadata.gz: 9a277e6a97d5c4273efa7f3a0f084aebd8466cc1becb93cdb86ec491da5f1cec7c67fdc8d6747745fb3b332c5b7ecef6a5675d52e9534d580c4a23c49172baa9
4
+ data.tar.gz: fec62baa930cdbaa65ac8413cd0cd272c0a74d76de90b135d297f77d428d56d0e5136c53ca9ef967dbacb32c4a28248e2f2d6cd00d6c65428d2e81aa0f71f65f
5
+ SHA1:
6
+ metadata.gz: b488dfeea72b5d62f7acc40c0818f52c746867f7
7
+ data.tar.gz: 2561e842cef70807e6d89cb074c684825eb16112
data/lib/sanford-nm.rb CHANGED
@@ -12,6 +12,7 @@ module Sanford::Nm
12
12
  def nm_source
13
13
  @nm_source ||= Nm::Source.new(self.source_path, {
14
14
  :cache => self.opts['cache'],
15
+ :ext => self.opts['ext'],
15
16
  :locals => { self.nm_logger_local => self.logger }
16
17
  })
17
18
  end
@@ -1,4 +1,4 @@
1
1
  module Sanford; end
2
2
  module Sanford::Nm
3
- VERSION = "0.4.1"
3
+ VERSION = "0.4.2"
4
4
  end
data/sanford-nm.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |gem|
20
20
 
21
21
  gem.add_development_dependency("assert", ["~> 2.15.1"])
22
22
 
23
- gem.add_dependency("sanford", ["~> 0.16.1"])
24
- gem.add_dependency("nm", ["~> 0.5.1"])
23
+ gem.add_dependency("sanford", ["~> 0.17.0"])
24
+ gem.add_dependency("nm", ["~> 0.5.2"])
25
25
 
26
26
  end
@@ -0,0 +1,4 @@
1
+ # This files is just to provide a conflict when rendering. If sanford-nm isn't
2
+ # passing an extension down to nm then nm will try and render this file which
3
+ # will error.
4
+ raise "oops - trying to render wrong template"
@@ -10,7 +10,8 @@ class Sanford::Nm::TemplateEngine
10
10
  desc "Sanford::Nm::TemplateEngine"
11
11
  setup do
12
12
  @engine = Sanford::Nm::TemplateEngine.new({
13
- 'source_path' => TEST_SUPPORT_PATH
13
+ 'source_path' => TEST_SUPPORT_PATH,
14
+ 'ext' => 'nm'
14
15
  })
15
16
  end
16
17
  subject{ @engine }
@@ -43,6 +44,12 @@ class Sanford::Nm::TemplateEngine
43
44
  assert_kind_of Hash, engine.nm_source.cache
44
45
  end
45
46
 
47
+ should "pass any given ext option to the Nm source" do
48
+ ext = Factory.string
49
+ engine = Sanford::Nm::TemplateEngine.new('ext' => ext)
50
+ assert_equal ".#{ext}", engine.nm_source.ext
51
+ end
52
+
46
53
  should "use 'logger' as the logger local name by default" do
47
54
  assert_equal 'logger', subject.nm_logger_local
48
55
  end
@@ -56,11 +63,10 @@ class Sanford::Nm::TemplateEngine
56
63
  should "render nm template files" do
57
64
  service_handler = OpenStruct.new({
58
65
  :identifier => Factory.integer,
59
- :name => Factory.string
66
+ :name => Factory.string
60
67
  })
61
68
  locals = { 'local1' => Factory.string }
62
69
  exp = Factory.template_json_rendered(subject, service_handler, locals)
63
-
64
70
  assert_equal exp, subject.render('template.json', service_handler, locals)
65
71
  end
66
72
 
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.1
4
+ version: 0.4.2
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: 2016-04-05 00:00:00 Z
13
+ date: 2016-04-11 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.16.1
32
+ version: 0.17.0
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.1
42
+ version: 0.5.2
43
43
  type: :runtime
44
44
  version_requirements: *id003
45
45
  description: Sanford template engine for Nm templates
@@ -63,6 +63,7 @@ files:
63
63
  - sanford-nm.gemspec
64
64
  - test/helper.rb
65
65
  - test/support/factory.rb
66
+ - test/support/template.json.aaa
66
67
  - test/support/template.json.nm
67
68
  - test/unit/template_engine_tests.rb
68
69
  - tmp/.gitkeep
@@ -95,5 +96,6 @@ summary: Sanford template engine for Nm templates
95
96
  test_files:
96
97
  - test/helper.rb
97
98
  - test/support/factory.rb
99
+ - test/support/template.json.aaa
98
100
  - test/support/template.json.nm
99
101
  - test/unit/template_engine_tests.rb