lib/jpmobile/resolver.rb
# Helper for building query glob string based on resolver's pattern.
Helper for building query glob string based on resolver's pattern.
Helper for building query glob string based on resolver ' s pattern .
def build_query(path, details)
      if path.prefix.match(/^\//) and !File.exists?(path.prefix)
        path = Path.build(path.name, File.join(@path, path.prefix), path.partial)
      end
      query = @pattern.dup
      prefix = path.prefix.empty? ? "" : "#{escape_entry(path.prefix)}\\1"
      query.gsub!(/\:prefix(\/)?/, prefix)
      partial = escape_entry(path.partial? ? "_#{path.name}" : path.name)
      query.gsub!(/\:action/, partial)
      details.each do |ext, variants|
        query.gsub!(/\:#{ext}/, "{#{variants.compact.uniq.join(',')}}")
      end
      File.expand_path(query, @path)
    end
def build_query ( path , details ) if path . prefix . match ( / ^ \/ / ) and ! File . exists? ( path . prefix ) path = Path . build ( path . name , File . join ( @path , path . prefix ) , path . partial ) end query = @pattern . dup prefix = path . prefix . empty? ? "" : "#{escape_entry(path.prefix)}\\1" query . gsub! ( / \: prefix( \/ )? / , prefix ) partial = escape_entry ( path . partial? ? "_#{path.name}" : path . name ) query . gsub! ( / \: action / , partial ) details . each do | ext , variants | query . gsub! ( / \: #{ ext } / , "{#{variants.compact.uniq.join(',')}}" ) end File . expand_path ( query , @path ) end
Helper for building query glob string based on resolver's pattern.
Helper for building query glob string based on resolver ' s pattern .
path
details