templight 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d5dfcd9b2767565c16daee921d635b48a769d1a5
4
- data.tar.gz: 09ed4424c00d0dfa2f646f24ae4abe8919955f7c
3
+ metadata.gz: 669de89922a6f57c1c46879a78c77111f1e4272d
4
+ data.tar.gz: 36b2bfe057bce42fad052d3f8aef3e80a2d7def4
5
5
  SHA512:
6
- metadata.gz: 4a4944e62ba7f73a8e4cffd20b4621620f2f32746c5ff25ae562b484777a45b42cd6298aca3230b60c4d868f4b387e02f5183b9deca68b8c0720e83d61c093c8
7
- data.tar.gz: e9950d6d48a44e0e31a4555907bd560c2bf9e9082af2948da670a9fd900f29023e8f2c67fa869b8976b3312f4d3e2fba2723154af243c1caf79d59ac7ccdbfcb
6
+ metadata.gz: 0747c9b97c63d543a3b677c381e3ec5dde357282c034d263ba9b38c8b2b59dda3cfa328d6cf46a55c2531b1a63412898d9cde09dbe264b054a0777068840f64c
7
+ data.tar.gz: d657048a4ea0625a5e5413e008bb9623f9e24102ef4a477466ba9ab4f68182ef21f9a1aa5f15035249903c5d9e35db436882c0e4022f066c8b4511cf48a1aeaa
@@ -1,3 +1,3 @@
1
1
  module Templight
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/templight.rb CHANGED
@@ -9,9 +9,14 @@ class ErbBinding < OpenStruct
9
9
  end
10
10
 
11
11
  module Templight
12
+ @template_path = '.'
12
13
 
13
- def self.render(path, args)
14
- template_string = File.read(path)
14
+ def self.configure(options={:path => @template_path})
15
+ @template_path = options[:path]
16
+ end
17
+
18
+ def self.render(filename, args)
19
+ template_string = File.read(File.join(@template_path, filename))
15
20
  template = ERB.new template_string
16
21
  params = ErbBinding.new(args)
17
22
  return template.result(params.get_binding)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: templight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Breyer-Menke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-06 00:00:00.000000000 Z
11
+ date: 2013-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler