0
uri_element more_elements:(uri_element)* {
0
- #raise more_elements.elements.inspect
0
uri_element.value(env) << more_elements.elements.map{|el| el.value(env)}.join
0
- if c.respond_to? :value
0
- c.interval.to_s + "<>"
0
(unreserved / reserved / pct_encoded) {
0
(reserved / unreserved / pct_encoded)*
0
- # If one or more of the variables are defined and non-empty then
0
- # substitute the value of 'arg', otherwise substitute the empty string.
0
- lambda do |env, arg, vars|
0
- vars.split(',').each do |var|
0
- if !env[var].to_s.blank?
0
+ # If one or more of the variables are defined and non-empty then
0
+ # substitute the value of 'arg', otherwise substitute the empty string.
0
+ lambda do |env, arg, vars|
0
+ vars.split(',').each do |var|
0
+ if !env[var].to_s.blank?
0
- # If all of the variables are un-defined or empty then substitute the
0
- # value of arg, otherwise substitute the empty string.
0
+ # If all of the variables are un-defined or empty then substitute the
0
+ # value of arg, otherwise substitute the empty string.
0
lambda do |env, arg, vars|
0
- # The prefix operator MUST only have one variable in its expansion. If
0
- # the variable is defined and non-empty then substitute the value of
0
- # arg followed by the value of the variable, otherwise substitute the
0
+ # The prefix operator MUST only have one variable in its expansion. If
0
+ # the variable is defined and non-empty then substitute the value of
0
+ # arg followed by the value of the variable, otherwise substitute the
0
lambda do |env, prefix, vars|
0
- if vars =~ /([^=]+)=([^=]+)/
0
- var, default = $1.dup, $2.dup
0
- v = default if v.to_s.blank?
0
- !v.blank? ? "#{prefix}#{UriTemplate::Encoder.encode(v)}" : ""
0
+ if vars =~ /([^=]+)=([^=]+)/
0
+ var, default = $1.dup, $2.dup
0
+ v = default if v.to_s.blank?
0
+ !v.blank? ? "#{prefix}#{UriTemplate::Encoder.encode(v)}" : ""
0
- # The append operator MUST only have one variable in its expansion. If
0
- # the variable is defined and non-empty then substitute the value of
0
- # the variable followed by the value of arg, otherwise substitute the
0
+ # The append operator MUST only have one variable in its expansion. If
0
+ # the variable is defined and non-empty then substitute the value of
0
+ # the variable followed by the value of arg, otherwise substitute the
0
lambda do |env, append, vars|
0
- if vars =~ /([^=]+)=([^=]+)/
0
- var, default = $1.dup, $2.dup
0
- v = default if v.to_s.blank?
0
- val = UriTemplate::Encoder.encode(v)
0
- !val.blank? ? "#{val}#{append}" : ""
0
+ if vars =~ /([^=]+)=([^=]+)/
0
+ var, default = $1.dup, $2.dup
0
+ v = default if v.to_s.blank?
0
+ val = UriTemplate::Encoder.encode(v)
0
+ !val.blank? ? "#{val}#{append}" : ""
0
- # For each variable that is defined and non-empty create a keyvalue
0
- # string that is the concatenation of the variable name, "=", and the
0
- # variable value. Concatenate more than one keyvalue string with
0
- # intervening values of arg to create the substitution value.
0
+ # For each variable that is defined and non-empty create a keyvalue
0
+ # string that is the concatenation of the variable name, "=", and the
0
+ # variable value. Concatenate more than one keyvalue string with
0
+ # intervening values of arg to create the substitution value.
0
lambda do |env, joinop, vars|
0
- vars.split(',').map do |var|
0
- if var =~ /([^=]+)=([^=]+)/
0
- var, default = $1.dup, $2.dup
0
- v = default if v.to_s.blank?
0
- "#{var}=#{UriTemplate::Encoder.encode(v)}" if v
0
- end.compact.join(joinop)
0
+ vars.split(',').map do |var|
0
+ if var =~ /([^=]+)=([^=]+)/
0
+ var, default = $1.dup, $2.dup
0
+ v = default if v.to_s.blank?
0
+ "#{var}=#{UriTemplate::Encoder.encode(v)}" if v
0
+ end.compact.join(joinop)
0
- # The listjoin operator MUST have only one variable in its expansion
0
- # and that variable must be a list. If the list is non-empty then
0
- # substitute the concatenation of all the list members with intevening
0
+ # The listjoin operator MUST have only one variable in its expansion
0
+ # and that variable must be a list. If the list is non-empty then
0
+ # substitute the concatenation of all the list members with intevening
0
- # The result of substitution MUST match the URI-reference rule and
0
- # SHOULD also match any known rules for the scheme of the resulting
0
- lambda do |env, joinop, vars|
0
- return "" unless env[vars].respond_to? :each
0
- "#{UriTemplate::Encoder.encode(v)}" if v
0
- end.compact.join(joinop)
0
+ # The result of substitution MUST match the URI-reference rule and
0
+ # SHOULD also match any known rules for the scheme of the resulting
0
+ lambda do |env, joinop, vars|
0
+ return "" unless env[vars].respond_to? :each
0
+ "#{UriTemplate::Encoder.encode(v)}" if v
0
+ end.compact.join(joinop)
0
- # see http://www.ietf.org/rfc/rfc3986.txt
0
- alphanumeric / "-" / "." / "_" / "~"
0
- # see http://www.ietf.org/rfc/rfc3986.txt
0
- # see http://www.ietf.org/rfc/rfc3986.txt
0
- gen_delims / sub_delims
0
- ":" / "/" / "?" / "#" / "[" / "]" / "@"
0
- "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="
0
(unreserved / pct_encoded)*
0
varname defaults:('=' vardefault)* {
0
- return UriTemplate::Encoder.encode(env[name]) if env[name] # UriTemplate::Encoder.encode(env[name])
0
- #defaults.elements[0].text_value if defaults.elements.size > 0
0
- defaults.text_value.gsub(/=/, '')
0
+ return UriTemplate::Encoder.encode(env[name]) if env[name]
0
+ defaults.text_value.gsub(/=/, '')
0
+ # see http://www.ietf.org/rfc/rfc3986.txt
0
+ alphanumeric / "-" / "." / "_" / "~"
0
+ # see http://www.ietf.org/rfc/rfc3986.txt
0
+ # see http://www.ietf.org/rfc/rfc3986.txt
0
+ gen_delims / sub_delims
0
+ ":" / "/" / "?" / "#" / "[" / "]" / "@"
0
+ "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="