File tree Expand file tree Collapse file tree 2 files changed +3
-11
lines changed
Expand file tree Collapse file tree 2 files changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,6 @@ def query_formatting
4141 Substitutions ::Weekdays . apply ( self )
4242 Substitutions ::Months . apply ( self )
4343 Substitutions ::Numbers . apply ( self )
44- insert_repeats_before_words_indicating_recurrence_lame
4544 query_str . concat ( ' ' )
4645 @after_formatting = query_str . dup # save current state
4746 end
@@ -79,16 +78,6 @@ def query_pre_processing
7978 standardize_input
8079 end
8180
82- def insert_repeats_before_words_indicating_recurrence_lame
83- comps = query_str . split
84- ( daily_index = comps . index ( 'daily' ) ) && comps [ daily_index - 1 ] != 'repeats' && comps [ daily_index ] = 'repeats daily'
85- ( weekly_index = comps . index ( 'weekly' ) ) && comps [ weekly_index - 1 ] != 'repeats' && comps [ weekly_index ] = 'repeats weekly'
86- ( monthly_index = comps . index ( 'monthly' ) ) && comps [ monthly_index - 1 ] != 'repeats' && comps [ monthly_index ] = 'repeats monthly'
87- if ( rejoin = comps . join ( ' ' ) ) != query_str
88- nsub! ( /.+/ , rejoin )
89- end
90- end
91-
9281 def to_s
9382 query_str
9483 end
Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ class Repetition < Substitutor
2121 [ /fridays/ , 'every fri' ] ,
2222 [ /saturdays/ , 'every sat' ] ,
2323 [ /sundays/ , 'every sun' ] ,
24+ [ /(?<!repeats )daily/ , 'repeats daily' ] ,
25+ [ /(?<!repeats )weekly/ , 'repeats weekly' ] ,
26+ [ /(?<!repeats )monthly/ , 'repeats monthly' ] ,
2427 ]
2528 end
2629 end
You can’t perform that action at this time.
0 commit comments