xml-kit 0.1.10 → 0.1.11

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
2
  SHA256:
3
- metadata.gz: c12fc0042cdb6c3b7e4dac42717dface3aabdc4562daff5064a8b9625098c830
4
- data.tar.gz: c48ffe5e10168c54b00b06f4a4fdd4d507081b9e095a99ecb0e2e36836f51962
3
+ metadata.gz: 925e83f414bc42a59834de793c7a37d174ebb0a787524c2188701f6851150a79
4
+ data.tar.gz: 4b1fd806847050b19df10455f3fd21cffa6835c6298b160ef56aa00acd90a879
5
5
  SHA512:
6
- metadata.gz: c79570b9ca7f4d5d2af0c73ba6ebab99036431eedea25d5172d9821be9eed8a93032bae1f17c5a741dbef9082eb34d79789e171e33533c874c7a09ef00c5233a
7
- data.tar.gz: '08f7701cf7910493854373ab64babf67d801f88d0a3d0f565b8da4b64b342e9cd71f4a14b2ad38dffc18f6fe732691327d72f1f9829d8c371053bdab10ba10f3'
6
+ metadata.gz: c7426c0584ed0487fed5012a7ed794c3b22de1841af005224c4286feb6f8fa78117f3ae5fa1570d93479c867254aa9ce3c6ae26e44d821bfc08286020e1e1cc0
7
+ data.tar.gz: 952246a69a2ac54a07075fa72f9c8b3769a1cb73fe5dceb60c0c7f50a22fbc1ed2a93d5c6e1afff2a4af9388b597f1a2d95de08ed604c2a1b5dc58685b935767
data/lib/xml/kit.rb CHANGED
@@ -6,6 +6,7 @@ require "builder"
6
6
  require "logger"
7
7
  require "nokogiri"
8
8
  require "openssl"
9
+ require "pathname"
9
10
  require "tilt"
10
11
  require "xmldsig"
11
12
 
@@ -1,6 +1,8 @@
1
1
  module Xml
2
2
  module Kit
3
3
  class Template
4
+ TEMPLATES_DIR=Pathname.new(File.join(__dir__, "templates/" ))
5
+
4
6
  attr_reader :target
5
7
 
6
8
  def initialize(target)
@@ -18,14 +20,15 @@ module Xml
18
20
 
19
21
  def template_path
20
22
  return target.template_path if target.respond_to?(:template_path)
23
+ TEMPLATES_DIR.join(template_name)
24
+ end
21
25
 
22
- root_path = File.expand_path(File.dirname(__FILE__))
23
- template_name = "#{target.class.name.split("::").last.underscore}.builder"
24
- File.join(root_path, "templates/", template_name)
26
+ def template_name
27
+ "#{target.class.name.split("::").last.underscore}.builder"
25
28
  end
26
29
 
27
30
  def template
28
- Tilt.new(template_path)
31
+ @template ||= Tilt.new(template_path.to_s)
29
32
  end
30
33
  end
31
34
  end
@@ -1,5 +1,5 @@
1
1
  module Xml
2
2
  module Kit
3
- VERSION = "0.1.10"
3
+ VERSION = "0.1.11"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xml-kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - mo khan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-16 00:00:00.000000000 Z
11
+ date: 2018-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -214,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
214
  version: '0'
215
215
  requirements: []
216
216
  rubyforge_project:
217
- rubygems_version: 2.7.5
217
+ rubygems_version: 2.7.3
218
218
  signing_key:
219
219
  specification_version: 4
220
220
  summary: A simple toolkit for working with XML.