ice_cube_chosko 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +7 -0
  2. data/config/locales/en.yml +178 -0
  3. data/config/locales/es.yml +176 -0
  4. data/config/locales/ja.yml +107 -0
  5. data/lib/ice_cube.rb +92 -0
  6. data/lib/ice_cube/builders/hash_builder.rb +27 -0
  7. data/lib/ice_cube/builders/ical_builder.rb +59 -0
  8. data/lib/ice_cube/builders/string_builder.rb +76 -0
  9. data/lib/ice_cube/deprecated.rb +36 -0
  10. data/lib/ice_cube/errors/count_exceeded.rb +7 -0
  11. data/lib/ice_cube/errors/until_exceeded.rb +7 -0
  12. data/lib/ice_cube/flexible_hash.rb +40 -0
  13. data/lib/ice_cube/i18n.rb +24 -0
  14. data/lib/ice_cube/null_i18n.rb +28 -0
  15. data/lib/ice_cube/occurrence.rb +101 -0
  16. data/lib/ice_cube/parsers/hash_parser.rb +91 -0
  17. data/lib/ice_cube/parsers/ical_parser.rb +91 -0
  18. data/lib/ice_cube/parsers/yaml_parser.rb +19 -0
  19. data/lib/ice_cube/rule.rb +123 -0
  20. data/lib/ice_cube/rules/daily_rule.rb +16 -0
  21. data/lib/ice_cube/rules/hourly_rule.rb +16 -0
  22. data/lib/ice_cube/rules/minutely_rule.rb +16 -0
  23. data/lib/ice_cube/rules/monthly_rule.rb +16 -0
  24. data/lib/ice_cube/rules/secondly_rule.rb +15 -0
  25. data/lib/ice_cube/rules/weekly_rule.rb +16 -0
  26. data/lib/ice_cube/rules/yearly_rule.rb +16 -0
  27. data/lib/ice_cube/schedule.rb +529 -0
  28. data/lib/ice_cube/single_occurrence_rule.rb +28 -0
  29. data/lib/ice_cube/time_util.rb +328 -0
  30. data/lib/ice_cube/validated_rule.rb +184 -0
  31. data/lib/ice_cube/validations/count.rb +61 -0
  32. data/lib/ice_cube/validations/daily_interval.rb +54 -0
  33. data/lib/ice_cube/validations/day.rb +71 -0
  34. data/lib/ice_cube/validations/day_of_month.rb +55 -0
  35. data/lib/ice_cube/validations/day_of_week.rb +77 -0
  36. data/lib/ice_cube/validations/day_of_year.rb +61 -0
  37. data/lib/ice_cube/validations/fixed_value.rb +95 -0
  38. data/lib/ice_cube/validations/hour_of_day.rb +55 -0
  39. data/lib/ice_cube/validations/hourly_interval.rb +54 -0
  40. data/lib/ice_cube/validations/lock.rb +95 -0
  41. data/lib/ice_cube/validations/minute_of_hour.rb +54 -0
  42. data/lib/ice_cube/validations/minutely_interval.rb +54 -0
  43. data/lib/ice_cube/validations/month_of_year.rb +54 -0
  44. data/lib/ice_cube/validations/monthly_interval.rb +53 -0
  45. data/lib/ice_cube/validations/schedule_lock.rb +46 -0
  46. data/lib/ice_cube/validations/second_of_minute.rb +54 -0
  47. data/lib/ice_cube/validations/secondly_interval.rb +51 -0
  48. data/lib/ice_cube/validations/until.rb +57 -0
  49. data/lib/ice_cube/validations/weekly_interval.rb +67 -0
  50. data/lib/ice_cube/validations/yearly_interval.rb +53 -0
  51. data/lib/ice_cube/version.rb +5 -0
  52. data/spec/spec_helper.rb +64 -0
  53. metadata +166 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7318cf1fa18615e995456fc2b6d865a2e9a0194f
4
+ data.tar.gz: 33b64364bdd3d381ac5f62750d4af0261b2e80e4
5
+ SHA512:
6
+ metadata.gz: 267d707fed39bcdeb1dd9fa831657a0ffcd38e2747c39b024c58cc44a80f065a7b7a74b5b2a187b38c2ad9e0c8d55b2225e4fca8cfe39f7d470184974929afdc
7
+ data.tar.gz: 3836ed551883742f31dc8711d2c84cf51d7bd8227e6a2d03d949ccc25f9d5053f9df909db44a6f8e514ccfc46866186d039ad4e81bd73fc8ee30dc85f08c1285
@@ -0,0 +1,178 @@
1
+ en:
2
+ ice_cube:
3
+ pieces_connector: ' / '
4
+ not: 'not %{target}'
5
+ not_on: 'not on %{target}'
6
+ date:
7
+ formats:
8
+ default: '%B %-d, %Y'
9
+ month_names:
10
+ -
11
+ - January
12
+ - February
13
+ - March
14
+ - April
15
+ - May
16
+ - June
17
+ - July
18
+ - August
19
+ - September
20
+ - October
21
+ - November
22
+ - December
23
+ day_names:
24
+ - Sunday
25
+ - Monday
26
+ - Tuesday
27
+ - Wednesday
28
+ - Thursday
29
+ - Friday
30
+ - Saturday
31
+ times:
32
+ other: '%{count} times'
33
+ one: '%{count} time'
34
+ until: 'until %{date}'
35
+ days_of_week: '%{segments} %{day}'
36
+ days_of_month:
37
+ other: '%{segments} days of the month'
38
+ one: '%{segments} day of the month'
39
+ days_of_year:
40
+ other: '%{segments} days of the year'
41
+ one: '%{segments} day of the year'
42
+ at_hours_of_the_day:
43
+ other: on the %{segments} hours of the day
44
+ one: on the %{segments} hour of the day
45
+ on_minutes_of_hour:
46
+ other: on the %{segments} minutes of the hour
47
+ one: on the %{segments} minute of the hour
48
+ at_seconds_of_minute:
49
+ other: at the %{segments} seconds
50
+ one: at the %{segments} second
51
+ on_seconds_of_minute:
52
+ other: on the %{segments} seconds of the minute
53
+ one: on the %{segments} second of the minute
54
+ each_second:
55
+ one: Secondly
56
+ other: Every %{count} seconds
57
+ each_minute:
58
+ one: Minutely
59
+ other: Every %{count} minutes
60
+ each_hour:
61
+ one: Hourly
62
+ other: Every %{count} hours
63
+ each_day:
64
+ one: Daily
65
+ other: Every %{count} days
66
+ each_week:
67
+ one: Weekly
68
+ other: Every %{count} weeks
69
+ each_month:
70
+ one: Monthly
71
+ other: Every %{count} months
72
+ each_year:
73
+ one: Yearly
74
+ other: Every %{count} years
75
+ 'on': on the %{sentence}
76
+ in: 'in %{target}'
77
+ integer:
78
+ negative: '%{ordinal} to last'
79
+ literal_ordinals:
80
+ -1: last
81
+ -2: 2nd to last
82
+ ordinal: '%{number}%{ordinal}'
83
+ ordinals:
84
+ default: th
85
+ 1: st
86
+ 2: nd
87
+ 3: rd
88
+ 11: th
89
+ 12: th
90
+ 13: th
91
+ on_weekends: on Weekends
92
+ on_weekdays: on Weekdays
93
+ days_on:
94
+ - Sundays
95
+ - Mondays
96
+ - Tuesdays
97
+ - Wednesdays
98
+ - Thursdays
99
+ - Fridays
100
+ - Saturdays
101
+ on_days: on %{days}
102
+ array:
103
+ last_word_connector: ', and '
104
+ two_words_connector: ' and '
105
+ words_connector: ', '
106
+ string:
107
+ format:
108
+ day: '%{rest} %{current}'
109
+ day_of_week: '%{rest} %{current}'
110
+ day_of_month: '%{rest} %{current}'
111
+ day_of_year: '%{rest} %{current}'
112
+ hour_of_day: '%{rest} %{current}'
113
+ minute_of_hour: '%{rest} %{current}'
114
+ until: '%{rest} %{current}'
115
+ count: '%{rest} %{current}'
116
+ default: '%{rest} %{current}'
117
+
118
+ date:
119
+ abbr_day_names:
120
+ - Sun
121
+ - Mon
122
+ - Tue
123
+ - Wed
124
+ - Thu
125
+ - Fri
126
+ - Sat
127
+ abbr_month_names:
128
+ -
129
+ - Jan
130
+ - Feb
131
+ - Mar
132
+ - Apr
133
+ - May
134
+ - Jun
135
+ - Jul
136
+ - Aug
137
+ - Sep
138
+ - Oct
139
+ - Nov
140
+ - Dec
141
+ day_names:
142
+ - Sunday
143
+ - Monday
144
+ - Tuesday
145
+ - Wednesday
146
+ - Thursday
147
+ - Friday
148
+ - Saturday
149
+ formats:
150
+ default: "%Y-%m-%d"
151
+ long: "%B %d, %Y"
152
+ short: "%b %d"
153
+ month_names:
154
+ -
155
+ - January
156
+ - February
157
+ - March
158
+ - April
159
+ - May
160
+ - June
161
+ - July
162
+ - August
163
+ - September
164
+ - October
165
+ - November
166
+ - December
167
+ order:
168
+ - :year
169
+ - :month
170
+ - :day
171
+
172
+ time:
173
+ am: am
174
+ formats:
175
+ default: "%a, %d %b %Y %H:%M:%S %z"
176
+ long: "%B %d, %Y %H:%M"
177
+ short: "%d %b %H:%M"
178
+ pm: pm
@@ -0,0 +1,176 @@
1
+ es:
2
+ ice_cube:
3
+ pieces_connector: ', '
4
+ not: 'excepto %{target}'
5
+ not_on: 'excepto el %{target}'
6
+ date:
7
+ formats:
8
+ default: '%-d de %B de %Y'
9
+ month_names:
10
+ -
11
+ - Enero
12
+ - Febrero
13
+ - Marzo
14
+ - Abril
15
+ - Mayo
16
+ - Junio
17
+ - Julio
18
+ - Agosto
19
+ - Septiembre
20
+ - Octubre
21
+ - Noviembre
22
+ - Diciembre
23
+ day_names:
24
+ - Domingo
25
+ - Lunes
26
+ - Martes
27
+ - Miércoles
28
+ - Jueves
29
+ - Viernes
30
+ - Sábado
31
+ times:
32
+ other: '%{count} veces'
33
+ one: '%{count} vez'
34
+ until: 'hasta el %{date}'
35
+ days_of_week: '%{segments} %{day}'
36
+ days_of_month:
37
+ other: 'los días %{segments} del mes'
38
+ one: 'el día %{segments} del mes'
39
+ days_of_year:
40
+ one: 'el día %{segments}'
41
+ other: 'los días %{segments}'
42
+ at_hours_of_the_day:
43
+ one: 'en la hora %{segments}'
44
+ other: 'en las horas %{segments}'
45
+ on_minutes_of_hour:
46
+ one: 'en el minuto %{segments}'
47
+ other: 'en los minutos %{segments}'
48
+ at_seconds_of_minute:
49
+ one: 'en el segundo %{segments}'
50
+ other: 'en los segundos %{segments}'
51
+ on_seconds_of_minute:
52
+ one: 'en el segundo %{segments} del minuto'
53
+ other: 'en los segundos %{segments} del minuto'
54
+ on_days: '%{days}'
55
+ each_second:
56
+ one: Cada segundo
57
+ other: 'Cada %{count} segundos'
58
+ each_minute:
59
+ one: Cada minuto
60
+ other: 'Cada %{count} minutos'
61
+ each_hour:
62
+ one: Cada hora
63
+ other: 'Cada %{count} horas'
64
+ each_day:
65
+ one: Diariamente
66
+ other: 'Cada %{count} días'
67
+ each_week:
68
+ one: Semanalmente
69
+ other: 'Cada %{count} semanas'
70
+ each_month:
71
+ one: Mensualmente
72
+ other: 'Cada %{count} meses'
73
+ each_year:
74
+ one: Anualmente
75
+ other: 'Cada %{count} años'
76
+ 'on': 'en %{sentence}'
77
+ in: 'en %{target}'
78
+ integer:
79
+ negative: '%{ordinal} por la cola'
80
+ literal_ordinals:
81
+ -1: el último
82
+ -2: el penúltimo
83
+ ordinal: '%{number}%{ordinal}'
84
+ ordinals:
85
+ default: º
86
+ 1: º
87
+ 2: º
88
+ 3: º
89
+ 11: º
90
+ 12: º
91
+ 13: º
92
+ on_weekends: en fin de semana
93
+ on_weekdays: en días laborables
94
+ days_on:
95
+ - los domingos
96
+ - los lunes
97
+ - los martes
98
+ - los miércoles
99
+ - los jueves
100
+ - los viernes
101
+ - los sábados
102
+ on_days: '%{days}'
103
+ array:
104
+ last_word_connector: ' y '
105
+ two_words_connector: ' y '
106
+ words_connector: ', '
107
+ string:
108
+ format:
109
+ day: '%{rest} %{current}'
110
+ day_of_week: '%{rest} %{current}'
111
+ day_of_month: '%{rest} %{current}'
112
+ day_of_year: '%{rest} %{current}'
113
+ hour_of_day: '%{rest} %{current}'
114
+ minute_of_hour: '%{rest} %{current}'
115
+ until: '%{rest} %{current}'
116
+ count: '%{rest} %{current}'
117
+ default: '%{rest} %{current}'
118
+
119
+ date:
120
+ day_names:
121
+ - Domingo
122
+ - Lunes
123
+ - Martes
124
+ - Miércoles
125
+ - Jueves
126
+ - Viernes
127
+ - Sábado
128
+ abbr_day_names:
129
+ - Dom
130
+ - Lun
131
+ - Mar
132
+ - Mie
133
+ - Jue
134
+ - Vie
135
+ - Sab
136
+ # Don't forget the nil at the beginning; there's no such thing as a 0th month
137
+ month_names:
138
+ -
139
+ - Enero
140
+ - Febrero
141
+ - Marzo
142
+ - Abril
143
+ - Mayo
144
+ - Junio
145
+ - Julio
146
+ - Agosto
147
+ - Septiembre
148
+ - Octubre
149
+ - Noviembre
150
+ - Diciembre
151
+ abbr_month_names:
152
+ -
153
+ - Ene
154
+ - Feb
155
+ - Mar
156
+ - Abr
157
+ - May
158
+ - Jun
159
+ - Jul
160
+ - Ago
161
+ - Sep
162
+ - Oct
163
+ - Nov
164
+ - Dic
165
+ formats:
166
+ default: '%d/%m/%Y'
167
+ long: '%d de %B de %Y'
168
+ short: '%d de %B'
169
+
170
+ time:
171
+ formats:
172
+ default: "%A, %d de %B de %Y %H:%M:%S %z"
173
+ short: "%d de %b %H:%M"
174
+ long: "%d de %B de %Y a las %H:%M"
175
+ am: "am"
176
+ pm: "pm"
@@ -0,0 +1,107 @@
1
+ ja:
2
+ ice_cube:
3
+ pieces_connector: ' / '
4
+ not: '%{target}以外'
5
+ not_on: '%{target}以外'
6
+ date:
7
+ formats:
8
+ default: '%Y年%m月%d日'
9
+ month_names:
10
+ -
11
+ - 1月
12
+ - 2月
13
+ - 3月
14
+ - 4月
15
+ - 5月
16
+ - 6月
17
+ - 7月
18
+ - 8月
19
+ - 9月
20
+ - 10月
21
+ - 11月
22
+ - 12月
23
+ day_names:
24
+ - 日曜
25
+ - 月曜
26
+ - 火曜
27
+ - 水曜
28
+ - 木曜
29
+ - 金曜
30
+ - 土曜
31
+ times:
32
+ other: '%{count}回'
33
+ one: '%{count}回'
34
+ until: '%{date}まで'
35
+ days_of_week: '%{segments}%{day}'
36
+ days_of_month:
37
+ other: '%{segments}日'
38
+ one: '%{segments}日'
39
+ days_of_year:
40
+ other: '%{segments}日'
41
+ one: '%{segments}日'
42
+ at_hours_of_the_day:
43
+ other: '%{segments}時'
44
+ one: '%{segments}時'
45
+ on_minutes_of_hour:
46
+ other: '%{segments}分'
47
+ one: '%{segments}分'
48
+ on_seconds_of_minute:
49
+ other: '%{segments}秒'
50
+ one: '%{segments}秒'
51
+ each_second:
52
+ one: 毎秒
53
+ other: '%{count}秒ごと'
54
+ each_minute:
55
+ one: 毎分
56
+ other: '%{count}分ごと'
57
+ each_hour:
58
+ one: 毎時間
59
+ other: '%{count}時間ごと'
60
+ each_day:
61
+ one: 毎日
62
+ other: '%{count}日ごと'
63
+ each_week:
64
+ one: 毎週
65
+ other: '%{count}週間ごと'
66
+ each_month:
67
+ one: 毎月
68
+ other: '%{count}ヶ月ごと'
69
+ each_year:
70
+ one: 毎年
71
+ other: '%{count}年ごと'
72
+ 'on': '%{sentence}'
73
+ in: '%{target}'
74
+ integer:
75
+ negative: '最終%{ordinal}'
76
+ literal_ordinals:
77
+ -1: 最終
78
+ -2: 最後から2番目の
79
+ ordinal: '%{ordinal}%{number}'
80
+ ordinals:
81
+ default: ''
82
+ on_weekends: 週末
83
+ on_weekdays: 平日
84
+ days_on:
85
+ - 日曜
86
+ - 月曜
87
+ - 火曜
88
+ - 水曜
89
+ - 木曜
90
+ - 金曜
91
+ - 土曜
92
+ on_days: '%{days}'
93
+ array:
94
+ last_word_connector: '、'
95
+ two_words_connector: '、'
96
+ words_connector: '、'
97
+ string:
98
+ format:
99
+ day: '%{rest}%{current}'
100
+ day_of_week: '%{rest}%{current}'
101
+ day_of_month: '%{rest}%{current}'
102
+ day_of_year: '%{rest}%{current}'
103
+ hour_of_day: '%{rest}%{current}'
104
+ minute_of_hour: '%{rest}%{current}'
105
+ until: '%{current}%{rest}'
106
+ count: '%{rest}%{current}'
107
+ default: '%{rest}%{current}'