Module: TextUtils

Extended by:
AddressHelper, StringFilter, TitleHelper, TitleTable, UnicodeHelper
Defined in:
lib/textutils/page.rb,
lib/textutils/title.rb,
lib/textutils/title.rb,
lib/textutils/utils.rb,
lib/textutils/version.rb,
lib/textutils/patterns.rb,
lib/textutils/classifier.rb,
lib/textutils/sanitizier.rb,
lib/textutils/title_mapper.rb,
lib/textutils/title_mapper2.rb,
lib/textutils/filter/erb_filter.rb,
lib/textutils/helper/tag_helper.rb,
lib/textutils/helper/xml_helper.rb,
lib/textutils/filter/code_filter.rb,
lib/textutils/helper/date_helper.rb,
lib/textutils/helper/title_helper.rb,
lib/textutils/filter/string_filter.rb,
lib/textutils/filter/comment_filter.rb,
lib/textutils/helper/address_helper.rb,
lib/textutils/helper/unicode_helper.rb,
lib/textutils/helper/value_helper_i.rb,
lib/textutils/helper/value_helper_ii.rb,
lib/textutils/helper/hypertext_helper.rb,
lib/textutils/filter/erb_django_filter.rb,
lib/textutils/helper/value_helper_iii_numbers.rb

Overview

match numbers (units)

e.g  km_squared, abv, etc.

Defined Under Namespace

Modules: AddressHelper, DateHelper, Filter, HypertextHelper, StringFilter, TagHelper, TitleHelper, TitleTable, UnicodeHelper, ValueHelper, XmlHelper Classes: Classifier, Page, PageTemplate, Sanitizier, TitleMapper, TitleMapper2

Constant Summary collapse

MAJOR =

todo: namespace inside version or something - why? why not??

1
MINOR =
4
PATCH =
0
VERSION =
[MAJOR,MINOR,PATCH].join('.')
EMPTY_LINE_PATTERN =

about ruby regexps

try the rubular - Ruby regular expression editor and tester

-> http://rubular.com
 code -> ??  by ??

Jeff Avallone’s Regexper - Shows State-Automata Diagrams

try -> http://regexper.com
  code -> https://github.com/javallone/regexper

Regular Expressions | The Bastards Book of Ruby by Dan Nguyen

ruby.bastardsbook.com/chapters/regexes/

move to notes regex|patterns on geraldb.github.io ??

'^\s*$'
COMMENT_LINE_PATTERN =

Start of Line Comment Patterns

'^\s*#'
COMMENT_LINE_HASKELL_PATTERN =

e.g. Ruby/Shell style starting w/ # this is a comment

'^\s*--'
COMMENT_LINE_ALT_PATTERN =

e.g. Haskell/Ada? style starting w/ –

COMMENT_LINE_HASKELL_PATTERN
COMMENT_LINE_TEX_PATTERN =

e.g. TeX/LaTeX style starting w/ %

'^\s*%'
COMMENT_LINE_ALT_II_PATTERN =
COMMENT_LINE_TEX_PATTERN
EOL_COMMENT_PATTERN =

End of Line (EOL) Comment Patterns

'\s+#.+$'
YYYY_STRICT_19_20_PATTERN =
'(?:19|20)\d\d'
YYYY_STRICT_20_PATTERN =
'20\d\d'
MM_STRICT_PATTERN =
'0[1-9]|1[012]'
M_STRICT_PATTERN =
'0?[1-9]|1[012]'
DD_STRICT_PATTERN =
'0[1-9]|[12][0-9]|3[01]'
D_STRICT_PATTERN =
'0?[1-9]|[12][0-9]|3[01]'

Constants included from UnicodeHelper

UnicodeHelper::U_HYPHEN, UnicodeHelper::U_MDASH, UnicodeHelper::U_MINUS, UnicodeHelper::U_NDASH, UnicodeHelper::U_NON_BREAKING_HYPHEN

Constants included from StringFilter

StringFilter::ASCIIFY_MAPPINGS

Class Method Summary collapse

Methods included from TitleTable

build_title_table_for, find_key_for!, find_keys_for!, map_title_worker_for!, map_titles_for!

Methods included from UnicodeHelper

convert_unicode_dashes_to_plain_ascii

Methods included from TitleHelper

strip_part_markers, strip_special_chars, strip_subtitles, strip_tags, strip_translations, strip_whitespaces, title_esc_regex, title_to_key

Methods included from AddressHelper

find_city_in_addr, find_city_in_addr_with_postal_code, find_city_in_addr_without_postal_code, normalize_addr

Methods included from StringFilter

asciify, slugify

Class Method Details



14
15
16
# File 'lib/textutils/version.rb', line 14

def self.banner
  "textutils/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
end

.rootObject



18
19
20
# File 'lib/textutils/version.rb', line 18

def self.root
  "#{File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) )}"
end

.versionObject



10
11
12
# File 'lib/textutils/version.rb', line 10

def self.version
  VERSION
end