Module: CSL
- Defined in:
- lib/csl/extensions.rb,
lib/csl.rb,
lib/csl/info.rb,
lib/csl/node.rb,
lib/csl/style.rb,
lib/csl/errors.rb,
lib/csl/loader.rb,
lib/csl/locale.rb,
lib/csl/parser.rb,
lib/csl/schema.rb,
lib/csl/version.rb,
lib/csl/treelike.rb,
lib/csl/date_part.rb,
lib/csl/style/date.rb,
lib/csl/style/sort.rb,
lib/csl/style/text.rb,
lib/csl/locale/date.rb,
lib/csl/locale/term.rb,
lib/csl/style/group.rb,
lib/csl/style/label.rb,
lib/csl/style/macro.rb,
lib/csl/style/names.rb,
lib/csl/style/choose.rb,
lib/csl/style/layout.rb,
lib/csl/style/number.rb,
lib/csl/compatibility.rb,
lib/csl/pretty_printer.rb,
lib/csl/style/citation.rb,
lib/csl/style/bibliography.rb,
lib/csl/locale/style_options.rb
Overview
Some methods in this file are taken from ActiveSupport and are copyright © 2005-2010 David Heinemeier Hansson. They are loaded only if ActiveSupport is not present.
Defined Under Namespace
Modules: DatePart, Extensions, Loader, PrettyPrinter, Treelike
Classes: Error, Info, Locale, Node, ParseError, Parser, Schema, Sort, Style, TextNode, ValidationError
Constant Summary
collapse
- VERSION =
'1.0.2'.freeze
- XML_ENTITY_SUBSTITUTION =
Hash[*%w{
& & < < > > ' ' " "
}].freeze
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.parse(*arguments) ⇒ Object
50
51
52
|
# File 'lib/csl.rb', line 50
def parse(*arguments)
Parser.instance.parse(*arguments)
end
|
.parse!(*arguments) ⇒ Object
54
55
56
|
# File 'lib/csl.rb', line 54
def parse!(*arguments)
Parser.instance.parse!(*arguments)
end
|
.valid?(node) ⇒ Boolean
62
63
64
|
# File 'lib/csl.rb', line 62
def valid?(node)
Schema.valid?(node)
end
|
.validate(node) ⇒ Object
58
59
60
|
# File 'lib/csl.rb', line 58
def validate(node)
Schema.validate(node)
end
|
Instance Method Details
#encode_xml_attr(string) ⇒ Object
47
48
49
50
51
|
# File 'lib/csl/compatibility.rb', line 47
def encode_xml_attr(string)
string.gsub(/[&<>'"]/) { |match|
XML_ENTITY_SUBSTITUTION[match]
}.inspect
end
|
#encode_xml_text(string) ⇒ Object
41
42
43
44
45
|
# File 'lib/csl/compatibility.rb', line 41
def encode_xml_text(string)
string.gsub(/[&<>]/) { |match|
XML_ENTITY_SUBSTITUTION[match]
}
end
|