armadillo 0.0.4 → 0.0.5

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: 901fa44ce57d06843a063988b7e2497265952aa7
4
- data.tar.gz: 72eaf5b820e92a89fe0d9d6aa4113bdf1d2c85f5
3
+ metadata.gz: 708c0aa944b119c3a39a0872be76237cfe0e23be
4
+ data.tar.gz: 30c62970324900dd052ef97c4911b81c1424dcbc
5
5
  SHA512:
6
- metadata.gz: f7851e91367188ed73d126c7c589b05e42869e182efae3a51f52eb9866ef923a71b1b41bd140de4e062eb984808dabd2c47dc3796a06fea798cbddfc04b5f910
7
- data.tar.gz: 678ebb62b9389fa262e5b9470a68c4b23ceb0ed920668a5444ddb31dfd1d9a03822c50674a2daf9cf4e8bbe94dcdda6299cc157e7ed329e293499c30c791cff8
6
+ metadata.gz: 4f93b5bad07de610b17bb5596c4305b392d1d0415a4cd0244000615bacaefff6458cb38727658a5a4495f5a8a95cbdc05efb17911a2673c844c0fb7de45d8cdb
7
+ data.tar.gz: b7146c572401f76bc4e74f5796fee206ceccdf2534d284198dc5be9ecaf3ee1822218b902ab68137fed249e523161c5d8579a06731b30a23b68e7c95bf47ed32
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "armadillo"
3
- s.version = "0.0.4"
3
+ s.version = "0.0.5"
4
4
  s.summary = "Template inheritance with ERB templates"
5
5
  s.description = "A small library for Django-like template inheritance adapted for ERB"
6
6
  s.authors = ["Sebastian Borrazas"]
@@ -4,7 +4,7 @@ require "delegate"
4
4
 
5
5
  module Armadillo
6
6
 
7
- VERSION = "0.0.4"
7
+ VERSION = "0.0.5"
8
8
 
9
9
  DEFAULT_OPTIONS = {
10
10
  :default_encoding => Encoding.default_external,
@@ -141,7 +141,7 @@ module Armadillo
141
141
  # @return [String]
142
142
  # @api public
143
143
  def self.render(template_path, locals = {}, options = {})
144
- scope = options.delete(:scope) { Object.new }
144
+ scope = options.fetch(:scope) { Object.new }
145
145
  context = TemplateContext.new(scope, options)
146
146
  _render(template_path, locals, context, options)
147
147
  end
@@ -88,6 +88,21 @@ describe Armadillo do
88
88
  "<h2>Subtitle</h2>"
89
89
  ])
90
90
  end
91
+
92
+ it "uses the same scope object" do
93
+ obj = Object.new
94
+ def obj.some_text
95
+ "text!"
96
+ end
97
+ content = Armadillo.render("with_sub_template2.html", {}, {
98
+ :base_path => TEMPLATES_PATH,
99
+ :escape_html => true,
100
+ :scope => obj
101
+ })
102
+ assert_lines_match(content, [
103
+ "<h2>text!</h2>"
104
+ ])
105
+ end
91
106
  end
92
107
  end
93
108
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: armadillo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Borrazas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-23 00:00:00.000000000 Z
11
+ date: 2015-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: erubis