tadpole 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -11,7 +11,7 @@ module Tadpole
|
|
11
11
|
end
|
12
12
|
|
13
13
|
class SectionProvider
|
14
|
-
attr_accessor :owner, :content
|
14
|
+
attr_accessor :owner, :content, :full_path
|
15
15
|
|
16
16
|
EXTENSIONS = []
|
17
17
|
|
@@ -42,6 +42,7 @@ module Tadpole
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def initialize(full_path, owner = nil)
|
45
|
+
self.full_path = full_path
|
45
46
|
self.owner = owner
|
46
47
|
self.content = File.read(full_path)
|
47
48
|
end
|
data/lib/tadpole/template.rb
CHANGED
@@ -123,14 +123,19 @@ module Tadpole
|
|
123
123
|
self.options = old_opts
|
124
124
|
out
|
125
125
|
rescue => e
|
126
|
-
|
127
|
-
|
126
|
+
provider = find_section_provider(current_section)
|
127
|
+
line = provider.full_path
|
128
|
+
line += " (template)" if provider.is_a?(SectionProviders::TemplateProvider)
|
129
|
+
line += ":1:in#{@compiled_sections ? ' compiled' : ''} section `#{current_section}'"
|
130
|
+
me = NoMethodError.new(e.message)
|
131
|
+
me.set_backtrace([line] + e.backtrace)
|
128
132
|
raise me
|
129
133
|
end
|
130
134
|
alias to_s run
|
131
135
|
|
132
136
|
def run_sections(sects, break_first = false, locals = {}, &block)
|
133
137
|
out = ''
|
138
|
+
raise ArgumentError, "Template(#{path}) is missing sections" unless sects
|
134
139
|
sects = sects.first if sects.first.is_a?(Array)
|
135
140
|
sects.each_with_index do |section, i|
|
136
141
|
(break_first ? break : next) if section.is_a?(Array)
|
data/lib/tadpole.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tadpole
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Loren Segal
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-07-
|
12
|
+
date: 2009-07-10 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|