lib/masterview/directive_helpers.rb in masterview-0.0.17 vs lib/masterview/directive_helpers.rb in masterview-0.1.0

- old
+ new

@@ -8,15 +8,25 @@ #convenience constants defined to allow priority to directives #higher priority (lower value) will be executed first in chain module DirectivePriorities Highest = 0 + VeryHigh = 0x3FFFFFFF/8 High = 0x3FFFFFFF/4 MediumHigh = 0x3FFFFFFF/3 Medium = 0x3FFFFFFF/2 MediumLow = (0x3FFFFFFF/3)*2 Low = (0x3FFFFFFF/4)*3 + VeryLow = (0x3FFFFFFF/8)*7 Lowest = 0x3FFFFFFF + end + + # convert render_partial_name to file_name, ex foo/bar to foo/_bar.rhtml + def render_partial_name_to_file_name(render_partial_name) + dir = File.dirname(render_partial_name) + base = File.basename(render_partial_name, PartialExtension) + filename = '_'+base+PartialExtension + path = ( (dir != '.') ? File.join(dir,filename) : filename ) end # find the last string that fully matches exactly the # parent tags content string array