Class: PathList::PathRegexpBuilder
- Inherits:
-
String
- Object
- String
- PathList::PathRegexpBuilder
- Defined in:
- lib/path_list/path_regexp_builder.rb
Instance Method Summary collapse
- #append_any_dir ⇒ Object
- #append_any_non_dir ⇒ Object
- #append_character_class_close ⇒ Object
- #append_character_class_dash ⇒ Object
- #append_character_class_negation ⇒ Object
- #append_character_class_open ⇒ Object
- #append_dir ⇒ Object
- #append_dir_or_end_anchor ⇒ Object
- #append_dir_or_start_anchor ⇒ Object
- #append_end_anchor ⇒ Object
- #append_escaped(value) ⇒ Object
- #append_many_non_dir ⇒ Object
- #append_one_non_dir ⇒ Object
- #append_start_anchor ⇒ Object
- #to_regexp ⇒ Object
Instance Method Details
#append_any_dir ⇒ Object
20 21 22 |
# File 'lib/path_list/path_regexp_builder.rb', line 20 def append_any_dir append_unescaped('(?:.*/)?') end |
#append_any_non_dir ⇒ Object
28 29 30 31 |
# File 'lib/path_list/path_regexp_builder.rb', line 28 def append_any_non_dir append_one_non_dir append_unescaped('*') end |
#append_character_class_close ⇒ Object
66 67 68 |
# File 'lib/path_list/path_regexp_builder.rb', line 66 def append_character_class_close append_unescaped(']') end |
#append_character_class_dash ⇒ Object
62 63 64 |
# File 'lib/path_list/path_regexp_builder.rb', line 62 def append_character_class_dash append_unescaped('-') end |
#append_character_class_negation ⇒ Object
58 59 60 |
# File 'lib/path_list/path_regexp_builder.rb', line 58 def append_character_class_negation append_unescaped('^') end |
#append_character_class_open ⇒ Object
54 55 56 |
# File 'lib/path_list/path_regexp_builder.rb', line 54 def append_character_class_open append_unescaped('(?!/)[') end |
#append_dir ⇒ Object
16 17 18 |
# File 'lib/path_list/path_regexp_builder.rb', line 16 def append_dir append_unescaped('/') end |
#append_dir_or_end_anchor ⇒ Object
50 51 52 |
# File 'lib/path_list/path_regexp_builder.rb', line 50 def append_dir_or_end_anchor append_unescaped('(?:/|\\z)') end |
#append_dir_or_start_anchor ⇒ Object
46 47 48 |
# File 'lib/path_list/path_regexp_builder.rb', line 46 def append_dir_or_start_anchor append_unescaped('(?:\\A|/)') end |
#append_end_anchor ⇒ Object
38 39 40 |
# File 'lib/path_list/path_regexp_builder.rb', line 38 def append_end_anchor append_unescaped('\\z') end |
#append_escaped(value) ⇒ Object
10 11 12 13 14 |
# File 'lib/path_list/path_regexp_builder.rb', line 10 def append_escaped(value) return unless value append_unescaped(::Regexp.escape(value)) end |
#append_many_non_dir ⇒ Object
33 34 35 36 |
# File 'lib/path_list/path_regexp_builder.rb', line 33 def append_many_non_dir append_one_non_dir append_unescaped('+') end |
#append_one_non_dir ⇒ Object
24 25 26 |
# File 'lib/path_list/path_regexp_builder.rb', line 24 def append_one_non_dir append_unescaped('[^/]') end |
#append_start_anchor ⇒ Object
42 43 44 |
# File 'lib/path_list/path_regexp_builder.rb', line 42 def append_start_anchor append_unescaped('\\A') end |
#to_regexp ⇒ Object
5 6 7 8 |
# File 'lib/path_list/path_regexp_builder.rb', line 5 def to_regexp # Regexp::IGNORECASE = 1 ::Regexp.new(self, 1) end |