dryml 1.3.0.pre15 → 1.3.0.pre16
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.
- data/VERSION +1 -1
- data/lib/dryml.rb +15 -28
- metadata +7 -7
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.3.0.
|
|
1
|
+
1.3.0.pre16
|
data/lib/dryml.rb
CHANGED
|
@@ -97,20 +97,6 @@ module Dryml
|
|
|
97
97
|
end
|
|
98
98
|
end
|
|
99
99
|
|
|
100
|
-
def get_field(object, field)
|
|
101
|
-
return nil if object.nil?
|
|
102
|
-
field_str = field.to_s
|
|
103
|
-
begin
|
|
104
|
-
return object.send(field_str)
|
|
105
|
-
rescue NoMethodError => ex
|
|
106
|
-
if field_str =~ /^\d+$/
|
|
107
|
-
return object[field.to_i]
|
|
108
|
-
else
|
|
109
|
-
return object[field]
|
|
110
|
-
end
|
|
111
|
-
end
|
|
112
|
-
end
|
|
113
|
-
|
|
114
100
|
def get_field(object, field)
|
|
115
101
|
return nil if object.nil?
|
|
116
102
|
field_str = field.to_s
|
|
@@ -193,25 +179,26 @@ module Dryml
|
|
|
193
179
|
private
|
|
194
180
|
|
|
195
181
|
def taglibs_for(controller_path)
|
|
196
|
-
(
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
end
|
|
201
|
-
|
|
202
|
-
def application_taglibs
|
|
203
|
-
Dir.chdir(Rails.root) do
|
|
204
|
-
Dir["app/views/taglibs/application/**/*.dryml"].map{|f| File.basename f, '.dryml'}.map do |n|
|
|
205
|
-
{ :src => "taglibs/application/#{n}" }
|
|
206
|
-
end
|
|
207
|
-
end
|
|
182
|
+
( taglibs_in_dir('application').unshift(APPLICATION_TAGLIB) +
|
|
183
|
+
subsite_taglibs(controller_path) +
|
|
184
|
+
(controller_path.camelize+"Controller").constantize.try.included_taglibs||[]
|
|
185
|
+
).compact
|
|
208
186
|
end
|
|
209
187
|
|
|
210
|
-
def
|
|
188
|
+
def subsite_taglibs(controller_path)
|
|
211
189
|
parts = controller_path.split("/")
|
|
212
190
|
subsite = parts.length >= 2 ? parts[0..-2].join('_') : "front"
|
|
213
191
|
src = "taglibs/#{subsite}_site"
|
|
214
|
-
|
|
192
|
+
Object.const_defined?(:Rails) && File.exists?("#{Rails.root}/app/views/#{src}.dryml") ?
|
|
193
|
+
taglibs_in_dir("#{subsite}_site").unshift({ :src => src }) : []
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
def taglibs_in_dir(dir_name)
|
|
197
|
+
Dir.chdir(Rails.root) do
|
|
198
|
+
Dir["app/views/taglibs/#{dir_name}/**/*.dryml"].map{|f| File.basename f, '.dryml'}.map do |n|
|
|
199
|
+
{ :src => "taglibs/#{dir_name}/#{n}" }
|
|
200
|
+
end
|
|
201
|
+
end
|
|
215
202
|
end
|
|
216
203
|
|
|
217
204
|
# create and compile a renderer class (AKA Dryml::Template::Environment)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dryml
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash: -
|
|
4
|
+
hash: -1637175965
|
|
5
5
|
prerelease: true
|
|
6
6
|
segments:
|
|
7
7
|
- 1
|
|
8
8
|
- 3
|
|
9
9
|
- 0
|
|
10
|
-
-
|
|
11
|
-
version: 1.3.0.
|
|
10
|
+
- pre16
|
|
11
|
+
version: 1.3.0.pre16
|
|
12
12
|
platform: ruby
|
|
13
13
|
authors:
|
|
14
14
|
- Tom Locke
|
|
@@ -16,7 +16,7 @@ autorequire:
|
|
|
16
16
|
bindir: bin
|
|
17
17
|
cert_chain: []
|
|
18
18
|
|
|
19
|
-
date: 2010-11-
|
|
19
|
+
date: 2010-11-08 00:00:00 -04:00
|
|
20
20
|
default_executable:
|
|
21
21
|
dependencies:
|
|
22
22
|
- !ruby/object:Gem::Dependency
|
|
@@ -43,13 +43,13 @@ dependencies:
|
|
|
43
43
|
requirements:
|
|
44
44
|
- - "="
|
|
45
45
|
- !ruby/object:Gem::Version
|
|
46
|
-
hash: -
|
|
46
|
+
hash: -1637175965
|
|
47
47
|
segments:
|
|
48
48
|
- 1
|
|
49
49
|
- 3
|
|
50
50
|
- 0
|
|
51
|
-
-
|
|
52
|
-
version: 1.3.0.
|
|
51
|
+
- pre16
|
|
52
|
+
version: 1.3.0.pre16
|
|
53
53
|
type: :runtime
|
|
54
54
|
version_requirements: *id002
|
|
55
55
|
- !ruby/object:Gem::Dependency
|