Module: Trenni

Defined in:
lib/trenni/uri.rb,
lib/trenni/tag.rb,
lib/trenni/buffer.rb,
lib/trenni/markup.rb,
lib/trenni/builder.rb,
lib/trenni/strings.rb,
lib/trenni/version.rb,
lib/trenni/entities.rb,
lib/trenni/template.rb,
lib/trenni/parse_error.rb,
lib/trenni/parse_delegate.rb,
lib/trenni/fallback/markup.rb,
lib/trenni/fallback/template.rb,
ext/trenni/trenni.c

Overview

Copyright, 2012, by Samuel G. D. Williams. <www.codeotaku.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Defined Under Namespace

Modules: Entities, Fallback, Markup, Native, Script, Strings Classes: Buffer, Builder, FileBuffer, IOBuffer, Location, MarkupString, MarkupTemplate, ParseDelegate, ParseError, Tag, Template, URI

Constant Summary collapse

Parsers =
Trenni::Fallback
VERSION =
"3.7.1"
OUT =

The output variable that will be used in templates:

:_out
BINDING =
binding

Class Method Summary collapse

Class Method Details

.Buffer(value) ⇒ Object



108
109
110
111
112
113
114
115
116
117
# File 'lib/trenni/buffer.rb', line 108

def self.Buffer(value)
	case value
	when String
		Buffer.new(value)
	when Buffer, FileBuffer, IOBuffer
		value
	else
		value.to_buffer
	end
end

.URI(path = '', parameters = nil) ⇒ Object

Generate a URI from a path and user parameters. The path may contain a ‘#fragment` or `?query=parameters`.



108
109
110
111
112
113
# File 'lib/trenni/uri.rb', line 108

def self.URI(path = '', parameters = nil)
	base, fragment = path.split('#', 2)
	path, query_string = base.split('?', 2)
	
	URI.new(path, query_string, fragment, parameters)
end