lucid_works 0.7.15 → 0.7.18
Sign up to get free protection for your applications and to get access to all the features.
- data/config/locales/en.yml +28 -33
- data/lib/lucid_works/activity.rb +7 -3
- data/lib/lucid_works/datasource/schedule.rb +4 -1
- data/lib/lucid_works/gem_version.rb +1 -1
- data/spec/lib/lucid_works/collection/activity_spec.rb +115 -101
- data/spec/lib/lucid_works/datasource/schedule_spec.rb +14 -0
- metadata +77 -86
data/config/locales/en.yml
CHANGED
@@ -223,42 +223,37 @@ en:
|
|
223
223
|
max_bytes: Default = 10 MiB. Set to -1 to indicate no file size limit.
|
224
224
|
|
225
225
|
# Custom datasource hints
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
datasource:
|
249
|
-
url: "Please include protocol: s3n://<hostname>/path/to/filesystem"
|
250
|
-
sharepoint:
|
251
|
-
smb:
|
252
|
-
datasource:
|
253
|
-
url: "Format: smb://<hostname or ip address>/<path to folder>/"
|
226
|
+
external_datasource:
|
227
|
+
file_datasource:
|
228
|
+
path: Full pathname to folder
|
229
|
+
ftp_datasource:
|
230
|
+
hdfs_datasource:
|
231
|
+
url: "Please include protocol: hdfs://<hostname>"
|
232
|
+
jdbc_datasource:
|
233
|
+
delta_sql_query: "$ in this query will be replaced by the last successful import time."
|
234
|
+
driver: "Database drivers may be uploaded on the Indexing -> JDBC Drivers page.
|
235
|
+
Drivers are collection specific.
|
236
|
+
JDBC4 drivers will appear in the selector automatically.
|
237
|
+
To use a JDBC3 driver, select \"Other\" and enter the Java class name of the driver."
|
238
|
+
url: "e.g. jdbc:mysql://hostname/database_name"
|
239
|
+
kfs_datasource:
|
240
|
+
lucidworkslogs_datasource:
|
241
|
+
s3_datasource:
|
242
|
+
url: "Please include protocol: s3://<hostname>/path/to/filesystem"
|
243
|
+
s3n_datasource:
|
244
|
+
url: "Please include protocol: s3n://<hostname>/path/to/filesystem"
|
245
|
+
sharepoint_datasource:
|
246
|
+
smb_datasource:
|
247
|
+
url: "Format: smb://<hostname or ip address>/<path to folder>/"
|
254
248
|
solrxml:
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
url: e.g. http://cnn.com. Please include protocol (http/https).
|
249
|
+
web_datasource:
|
250
|
+
include_paths: A list of regular expressions, one per line, e.g. http://example\.com/.*
|
251
|
+
will match everything within the site only.
|
252
|
+
url: e.g. http://cnn.com. Please include protocol (http/https).
|
260
253
|
|
261
254
|
field:
|
262
255
|
copy_fields: A list of fields separated by spaces.
|
256
|
+
jdbcdriver:
|
257
|
+
file: select the jar file of your database driver
|
263
258
|
synonym:
|
264
259
|
mapping: ! 'Example: car, automobile, auto'
|
data/lib/lucid_works/activity.rb
CHANGED
@@ -13,12 +13,13 @@ module LucidWorks
|
|
13
13
|
|
14
14
|
schema do
|
15
15
|
attribute :period
|
16
|
-
attribute :start_time, :iso8601
|
16
|
+
attribute :start_time, :iso8601, :omit_when_blank => true
|
17
17
|
attribute :active, :boolean
|
18
18
|
attribute :type, :string, :values => TYPES, :omit_during_update => true
|
19
19
|
end
|
20
20
|
|
21
|
-
validates_presence_of :type
|
21
|
+
validates_presence_of :type
|
22
|
+
validates_presence_of :start_time, :unless => lambda {|activity| activity.custom? }
|
22
23
|
validates_numericality_of :period, :allow_blank => true
|
23
24
|
|
24
25
|
def frequency
|
@@ -39,6 +40,7 @@ module LucidWorks
|
|
39
40
|
when 'hourly' then 1.hours.seconds.to_i
|
40
41
|
when 'daily' then 1.days.seconds.to_i
|
41
42
|
when 'weekly' then 1.weeks.seconds.to_i
|
43
|
+
when 'custom' then period # don't change anything
|
42
44
|
else raise "unknown frequency"
|
43
45
|
end
|
44
46
|
end
|
@@ -112,6 +114,8 @@ module LucidWorks
|
|
112
114
|
when 'hourly'
|
113
115
|
start = now.change(:min => 0).advance(all_attributes['start'])
|
114
116
|
start < now ? start.advance(:hours => 1) : start
|
117
|
+
when 'custom'
|
118
|
+
# don't change this activity's start_time
|
115
119
|
else
|
116
120
|
puts "*** frequency: <#{all_attributes[:frequency]}>"
|
117
121
|
raise "unexpected frequency encountered"
|
@@ -151,8 +155,8 @@ module LucidWorks
|
|
151
155
|
# or should be described as custom (meaning it is beyond the capabilities of the convenience methods)
|
152
156
|
#
|
153
157
|
def custom?
|
154
|
-
return false unless self.start_time
|
155
158
|
return true if self.frequency == 'custom'
|
159
|
+
return false unless self.start_time
|
156
160
|
return true if self.start_is_more_than_one_period_in_the_future?
|
157
161
|
return false
|
158
162
|
end
|
@@ -20,7 +20,7 @@ module LucidWorks
|
|
20
20
|
|
21
21
|
schema do
|
22
22
|
attribute :period
|
23
|
-
attribute :start_time, :iso8601
|
23
|
+
attribute :start_time, :iso8601, :omit_when_blank => true
|
24
24
|
attribute :active, :boolean
|
25
25
|
attribute :type
|
26
26
|
end
|
@@ -47,6 +47,7 @@ module LucidWorks
|
|
47
47
|
when 'hourly' then 1.hours.seconds.to_i
|
48
48
|
when 'daily' then 1.days.seconds.to_i
|
49
49
|
when 'weekly' then 1.weeks.seconds.to_i
|
50
|
+
when 'custom' then period # don't change anything
|
50
51
|
else raise "unknown frequency"
|
51
52
|
end
|
52
53
|
end
|
@@ -120,6 +121,8 @@ module LucidWorks
|
|
120
121
|
when 'hourly'
|
121
122
|
start = now.change(:min => 0).advance(all_attributes['start'])
|
122
123
|
start < now ? start.advance(:hours => 1) : start
|
124
|
+
when 'custom'
|
125
|
+
# don't change this schedule's start_time
|
123
126
|
else
|
124
127
|
puts "*** frequency: <#{all_attributes[:frequency]}>"
|
125
128
|
raise "unexpected frequency encountered"
|
@@ -27,33 +27,33 @@ describe LucidWorks::Activity do
|
|
27
27
|
|
28
28
|
before do
|
29
29
|
@server = connect_to_live_server
|
30
|
-
@
|
30
|
+
@activity = LucidWorks::Activity.new(:parent => @server)
|
31
31
|
end
|
32
32
|
|
33
33
|
describe '#frequency' do
|
34
34
|
it "should return 'weekly' when period == num of seconds in a week" do
|
35
|
-
@
|
36
|
-
@
|
35
|
+
@activity.period = 604800
|
36
|
+
@activity.frequency.should == 'weekly'
|
37
37
|
end
|
38
38
|
|
39
39
|
it "should return 'daily' when period == num of seconds in a day" do
|
40
|
-
@
|
41
|
-
@
|
40
|
+
@activity.period = 86400
|
41
|
+
@activity.frequency.should == 'daily'
|
42
42
|
end
|
43
43
|
|
44
44
|
it "should return 'hourly' when period == num of seconds in an hour" do
|
45
|
-
@
|
46
|
-
@
|
45
|
+
@activity.period = 3600
|
46
|
+
@activity.frequency.should == 'hourly'
|
47
47
|
end
|
48
48
|
|
49
49
|
it "should return 'custom' when period does not correspond to a common number of seconds" do
|
50
|
-
@
|
51
|
-
@
|
50
|
+
@activity.period = 1
|
51
|
+
@activity.frequency.should == 'custom'
|
52
52
|
end
|
53
53
|
|
54
54
|
it "should return nil when the period is zero" do
|
55
|
-
@
|
56
|
-
@
|
55
|
+
@activity.period = 0
|
56
|
+
@activity.frequency.should == nil
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
@@ -61,8 +61,8 @@ describe LucidWorks::Activity do
|
|
61
61
|
context 'start_time is in the future' do
|
62
62
|
it 'should return start_time' do
|
63
63
|
Timecop.freeze(now = Time.now.utc) do
|
64
|
-
@
|
65
|
-
@
|
64
|
+
@activity.start_time = now + 30.minutes
|
65
|
+
@activity.next_start.should == @activity.start_time
|
66
66
|
end
|
67
67
|
end
|
68
68
|
end
|
@@ -82,9 +82,9 @@ describe LucidWorks::Activity do
|
|
82
82
|
it 'should return now' do
|
83
83
|
# get current time after rounding error
|
84
84
|
Timecop.freeze(@now) do
|
85
|
-
@
|
86
|
-
@
|
87
|
-
@
|
85
|
+
@activity.start_time = @now - 30.minutes
|
86
|
+
@activity.period = 10.minutes
|
87
|
+
@activity.next_start.should == @now
|
88
88
|
end
|
89
89
|
end
|
90
90
|
end
|
@@ -95,33 +95,33 @@ describe LucidWorks::Activity do
|
|
95
95
|
@i = the_interval = 10.minutes
|
96
96
|
@a = a_little_more_than_an_interval_ago = @now - the_interval - 1.minutes
|
97
97
|
|
98
|
-
@
|
99
|
-
@
|
98
|
+
@activity.period = the_interval
|
99
|
+
@activity.start_time = a_little_more_than_an_interval_ago
|
100
100
|
end
|
101
101
|
|
102
102
|
it 'should return a time less than one interval in the future' do
|
103
|
-
one_interval_in_the_future = @now + @
|
104
|
-
@
|
103
|
+
one_interval_in_the_future = @now + @activity.period
|
104
|
+
@activity.next_start.should < one_interval_in_the_future
|
105
105
|
end
|
106
106
|
|
107
107
|
it 'should return a time one interval from the start_time' do
|
108
108
|
# TODO: this should be in terms of start time & period, not @now
|
109
|
-
@
|
109
|
+
@activity.next_start.to_s.should == (@now + 9.minutes).to_s
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
113
113
|
describe 'several (e.g. 4) intervals have passed' do
|
114
114
|
before do
|
115
|
-
@
|
116
|
-
@
|
115
|
+
@activity.start_time = @now - 45.minutes
|
116
|
+
@activity.period = 10.minutes
|
117
117
|
end
|
118
118
|
|
119
119
|
it 'should return a time between 4 and 6 intervals from start_time' do
|
120
|
-
@
|
120
|
+
@activity.next_start.should > @activity.start_time + (4 * @activity.period)
|
121
121
|
end
|
122
122
|
|
123
123
|
it 'should return a start time within 1 period from now' do
|
124
|
-
@
|
124
|
+
@activity.next_start.should < @now + @activity.period
|
125
125
|
end
|
126
126
|
end
|
127
127
|
end
|
@@ -130,13 +130,13 @@ describe LucidWorks::Activity do
|
|
130
130
|
|
131
131
|
describe '#active, #active=' do
|
132
132
|
it 'should maintain specified value' do
|
133
|
-
@
|
134
|
-
@
|
135
|
-
@
|
136
|
-
@
|
133
|
+
@activity.active = true
|
134
|
+
@activity.active.should == true
|
135
|
+
@activity.active = false
|
136
|
+
@activity.active.should == false
|
137
137
|
# make sure the first true wasn't luck
|
138
|
-
@
|
139
|
-
@
|
138
|
+
@activity.active = true
|
139
|
+
@activity.active.should == true
|
140
140
|
end
|
141
141
|
end
|
142
142
|
|
@@ -144,32 +144,46 @@ describe LucidWorks::Activity do
|
|
144
144
|
context 'active attribute supplied' do
|
145
145
|
describe 'updates the "active" attribute in the model' do
|
146
146
|
it 'should update the "active" attribute in the model' do
|
147
|
-
@
|
147
|
+
@activity.active = true
|
148
148
|
attributes = {"frequency"=>"hourly", "start"=>{"minutes"=>"15"}, "active" => 'false'}
|
149
|
-
@
|
150
|
-
@
|
149
|
+
@activity.schedule = attributes
|
150
|
+
@activity.active.should == false
|
151
151
|
|
152
152
|
attributes = {"frequency"=>"hourly", "start"=>{"minutes"=>"15"}, "active" => 'true'}
|
153
|
-
@
|
154
|
-
@
|
153
|
+
@activity.schedule = attributes
|
154
|
+
@activity.active.should == true
|
155
155
|
end
|
156
156
|
end
|
157
157
|
|
158
158
|
describe 'with active attribute not supplied' do
|
159
159
|
it 'should not change the attribute in the model' do
|
160
160
|
attributes = {"frequency"=>"hourly", "start"=>{"minutes"=>"15"}}
|
161
|
-
@
|
162
|
-
@
|
163
|
-
@
|
161
|
+
@activity.active= true
|
162
|
+
@activity.schedule = attributes
|
163
|
+
@activity.active.should == true
|
164
164
|
|
165
|
-
@
|
166
|
-
@
|
167
|
-
@
|
165
|
+
@activity.active= false
|
166
|
+
@activity.schedule = attributes
|
167
|
+
@activity.active.should == false
|
168
168
|
end
|
169
169
|
|
170
170
|
end
|
171
171
|
end
|
172
172
|
|
173
|
+
context "with a 'custom' frequency" do
|
174
|
+
it "doesn't change the period" do
|
175
|
+
old_period = @activity.period
|
176
|
+
@activity.schedule = {"frequency" => "custom"}
|
177
|
+
@activity.period.should == old_period
|
178
|
+
end
|
179
|
+
|
180
|
+
it "sets the start_time to nil to avoid passing it to the core" do
|
181
|
+
@activity.start_time = Time.now
|
182
|
+
@activity.schedule = {"frequency" => "custom"}
|
183
|
+
@activity.start_time.should be_nil
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
173
187
|
context 'supplied start time has elapsed w/rt current interval' do
|
174
188
|
describe 'with hourly frequency' do
|
175
189
|
it "should advance the start time" do
|
@@ -178,10 +192,10 @@ describe LucidWorks::Activity do
|
|
178
192
|
quarter_past_1_am = Time.iso8601('2011-05-09T01:15:00Z').in_time_zone('Eastern Time (US & Canada)')
|
179
193
|
|
180
194
|
Timecop.freeze half_past_midnight do
|
181
|
-
@
|
195
|
+
@activity.start_time.should_not == quarter_past_1_am
|
182
196
|
|
183
|
-
@
|
184
|
-
@
|
197
|
+
@activity.schedule = hourly_at_quarter_past
|
198
|
+
@activity.start_time.should == quarter_past_1_am
|
185
199
|
end
|
186
200
|
end
|
187
201
|
end
|
@@ -192,10 +206,10 @@ describe LucidWorks::Activity do
|
|
192
206
|
tomorrow_at_eleven_am = Time.iso8601('2011-05-10T11:00:00Z').in_time_zone('Eastern Time (US & Canada)')
|
193
207
|
daily_at_11_am = {"frequency"=>"daily", "start"=>{"hours" => "11", "minutes"=>"00"}}
|
194
208
|
Timecop.freeze today_at_noon do
|
195
|
-
@
|
209
|
+
@activity.start_time.should_not == tomorrow_at_eleven_am
|
196
210
|
|
197
|
-
@
|
198
|
-
@
|
211
|
+
@activity.schedule = daily_at_11_am
|
212
|
+
@activity.start_time.should == tomorrow_at_eleven_am
|
199
213
|
end
|
200
214
|
end
|
201
215
|
end
|
@@ -212,10 +226,10 @@ describe LucidWorks::Activity do
|
|
212
226
|
wednesday_of_next_week.weekday.should == 'Wednesday'
|
213
227
|
|
214
228
|
Timecop.freeze friday_of_this_week do
|
215
|
-
@
|
229
|
+
@activity.start_time.should_not == wednesday_of_next_week
|
216
230
|
|
217
|
-
@
|
218
|
-
@
|
231
|
+
@activity.schedule = weekly_on_wednesday
|
232
|
+
@activity.start_time.should == wednesday_of_next_week
|
219
233
|
end
|
220
234
|
end
|
221
235
|
end
|
@@ -229,12 +243,12 @@ describe LucidWorks::Activity do
|
|
229
243
|
hourly_at_three_quarters_past = {"frequency"=>"hourly", "start"=>{"minutes"=>"45"}}
|
230
244
|
|
231
245
|
Timecop.freeze half_past_midnight do
|
232
|
-
@
|
233
|
-
@
|
246
|
+
@activity.start_time.should_not == three_quarters_past_midnight
|
247
|
+
@activity.frequency.should_not == 'hourly'
|
234
248
|
|
235
|
-
@
|
236
|
-
@
|
237
|
-
@
|
249
|
+
@activity.schedule = hourly_at_three_quarters_past
|
250
|
+
@activity.start_time.should == three_quarters_past_midnight
|
251
|
+
@activity.frequency.should == 'hourly'
|
238
252
|
end
|
239
253
|
end
|
240
254
|
end
|
@@ -246,12 +260,12 @@ describe LucidWorks::Activity do
|
|
246
260
|
daily_at_1pm = {"frequency"=>"daily", "start"=>{"hours" => "13", "minutes"=>"00"}}
|
247
261
|
|
248
262
|
Timecop.freeze today_at_noon do
|
249
|
-
@
|
250
|
-
@
|
263
|
+
@activity.start_time.should_not == today_at_1pm
|
264
|
+
@activity.frequency.should_not == 'daily'
|
251
265
|
|
252
|
-
@
|
253
|
-
@
|
254
|
-
@
|
266
|
+
@activity.schedule = daily_at_1pm
|
267
|
+
@activity.start_time.should == today_at_1pm
|
268
|
+
@activity.frequency.should == 'daily'
|
255
269
|
end
|
256
270
|
end
|
257
271
|
end
|
@@ -268,12 +282,12 @@ describe LucidWorks::Activity do
|
|
268
282
|
thursday_of_this_week.weekday.should == 'Thursday'
|
269
283
|
|
270
284
|
Timecop.freeze wednesday_of_this_week do
|
271
|
-
@
|
272
|
-
@
|
285
|
+
@activity.start_time.should_not == thursday_of_this_week
|
286
|
+
@activity.frequency.should_not == 'weekly'
|
273
287
|
|
274
|
-
@
|
275
|
-
@
|
276
|
-
@
|
288
|
+
@activity.schedule = weekly_on_thursday
|
289
|
+
@activity.start_time.should == thursday_of_this_week
|
290
|
+
@activity.frequency.should == 'weekly'
|
277
291
|
end
|
278
292
|
end
|
279
293
|
end
|
@@ -283,37 +297,37 @@ describe LucidWorks::Activity do
|
|
283
297
|
context 'sub-time convenience accessors' do
|
284
298
|
describe '#hour' do
|
285
299
|
it 'should return the hour component of the time' do
|
286
|
-
@
|
287
|
-
@
|
300
|
+
@activity.start_time = Time.parse("2011-04-15 13:11:56")
|
301
|
+
@activity.hour.should == 13
|
288
302
|
end
|
289
303
|
|
290
304
|
it 'should return nil if start_time == nil' do
|
291
|
-
@
|
292
|
-
@
|
305
|
+
@activity.start_time = nil
|
306
|
+
@activity.hour.should == nil
|
293
307
|
end
|
294
308
|
end
|
295
309
|
|
296
310
|
describe '#min' do
|
297
311
|
it 'should return the minute component of the time' do
|
298
|
-
@
|
299
|
-
@
|
312
|
+
@activity.start_time = Time.parse("2011-04-15 13:11:56")
|
313
|
+
@activity.min.should == 11
|
300
314
|
end
|
301
315
|
|
302
316
|
it 'should return nil if start_time == nil' do
|
303
|
-
@
|
304
|
-
@
|
317
|
+
@activity.start_time = nil
|
318
|
+
@activity.min.should == nil
|
305
319
|
end
|
306
320
|
end
|
307
321
|
|
308
322
|
describe '#day_of_week' do
|
309
323
|
it 'should return the week component of the time' do
|
310
|
-
@
|
311
|
-
@
|
324
|
+
@activity.start_time = Time.parse("2011-04-15 13:11:56")
|
325
|
+
@activity.day_of_week.should == 4
|
312
326
|
end
|
313
327
|
|
314
328
|
it 'should return nil if start_time == nil' do
|
315
|
-
@
|
316
|
-
@
|
329
|
+
@activity.start_time = nil
|
330
|
+
@activity.day_of_week.should == nil
|
317
331
|
end
|
318
332
|
end
|
319
333
|
end
|
@@ -321,8 +335,8 @@ describe LucidWorks::Activity do
|
|
321
335
|
describe '#custom?' do
|
322
336
|
context 'schedule can not be represent as simple weekly/daily/hourly' do
|
323
337
|
it 'should be true if frequency is non-standard' do
|
324
|
-
@
|
325
|
-
@
|
338
|
+
@activity.period = 1
|
339
|
+
@activity.should be_custom
|
326
340
|
end
|
327
341
|
|
328
342
|
it 'should be true if period is standard but start_time is > 1 period from now' do
|
@@ -330,10 +344,10 @@ describe LucidWorks::Activity do
|
|
330
344
|
more_than_a_day_later = some_random_time.advance(:days => 2)
|
331
345
|
|
332
346
|
Timecop.freeze some_random_time do
|
333
|
-
@
|
334
|
-
@
|
347
|
+
@activity.frequency = 'daily'
|
348
|
+
@activity.start_time = more_than_a_day_later
|
335
349
|
|
336
|
-
@
|
350
|
+
@activity.should be_custom
|
337
351
|
end
|
338
352
|
end
|
339
353
|
end
|
@@ -345,9 +359,9 @@ describe LucidWorks::Activity do
|
|
345
359
|
some_random_specific_time = Time.iso8601('2011-05-09T01:15:00Z')
|
346
360
|
|
347
361
|
Timecop.freeze some_random_specific_time do
|
348
|
-
@
|
362
|
+
@activity.schedule = a_standard_schedule
|
349
363
|
|
350
|
-
@
|
364
|
+
@activity.should_not be_custom
|
351
365
|
end
|
352
366
|
end
|
353
367
|
|
@@ -355,41 +369,41 @@ describe LucidWorks::Activity do
|
|
355
369
|
some_random_time = Time.parse("2011-04-15 13:11:56")
|
356
370
|
more_than_a_day_ago = some_random_time.advance(:days => -2)
|
357
371
|
Timecop.freeze some_random_time do
|
358
|
-
@
|
359
|
-
@
|
372
|
+
@activity.frequency = 'daily'
|
373
|
+
@activity.start_time = more_than_a_day_ago
|
360
374
|
|
361
|
-
@
|
375
|
+
@activity.should_not be_custom
|
362
376
|
end
|
363
377
|
end
|
364
378
|
|
365
379
|
end
|
366
380
|
|
367
381
|
it 'should be false if the start_time is nil and frequency is standard' do
|
368
|
-
@
|
369
|
-
@
|
370
|
-
@
|
382
|
+
@activity.start_time = nil
|
383
|
+
@activity.frequency = 'weekly'
|
384
|
+
@activity.should_not be_custom
|
371
385
|
end
|
372
386
|
end
|
373
387
|
|
374
388
|
describe '#ui_appropriate_defaults!' do
|
375
389
|
it "should set active to true if start_time is defaulted" do
|
376
|
-
@
|
377
|
-
@
|
378
|
-
@
|
390
|
+
@activity.start_time = nil
|
391
|
+
@activity.period = 1.hours.seconds
|
392
|
+
@activity.active = false
|
379
393
|
|
380
|
-
@
|
394
|
+
@activity.ui_appropriate_defaults!
|
381
395
|
|
382
|
-
@
|
396
|
+
@activity.active.should == true
|
383
397
|
end
|
384
398
|
|
385
399
|
it "should set active to true if period is defaulted" do
|
386
|
-
@
|
387
|
-
@
|
388
|
-
@
|
400
|
+
@activity.start_time = Time.now
|
401
|
+
@activity.period = 0
|
402
|
+
@activity.active = false
|
389
403
|
|
390
|
-
@
|
404
|
+
@activity.ui_appropriate_defaults!
|
391
405
|
|
392
|
-
@
|
406
|
+
@activity.active.should == true
|
393
407
|
end
|
394
408
|
end
|
395
409
|
end
|
@@ -163,6 +163,20 @@ describe LucidWorks::Datasource::Schedule do
|
|
163
163
|
end
|
164
164
|
end
|
165
165
|
|
166
|
+
context "with a 'custom' frequency" do
|
167
|
+
it "doesn't change the period" do
|
168
|
+
old_period = @schedule.period
|
169
|
+
@schedule.schedule = {"frequency" => "custom"}
|
170
|
+
@schedule.period.should == old_period
|
171
|
+
end
|
172
|
+
|
173
|
+
it "sets the start_time to nil to avoid passing it to the core" do
|
174
|
+
@schedule.start_time = Time.now
|
175
|
+
@schedule.schedule = {"frequency" => "custom"}
|
176
|
+
@schedule.start_time.should be_nil
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
166
180
|
context 'supplied start time has elapsed w/rt current interval' do
|
167
181
|
describe 'with hourly frequency' do
|
168
182
|
it "should advance the start time" do
|
metadata
CHANGED
@@ -1,105 +1,100 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: lucid_works
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.7.18
|
4
5
|
prerelease:
|
5
|
-
version: 0.7.15
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Sam Pierson
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
dependencies:
|
16
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-09-19 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
17
15
|
name: activesupport
|
18
|
-
|
19
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &2153358420 !ruby/object:Gem::Requirement
|
20
17
|
none: false
|
21
|
-
requirements:
|
22
|
-
- -
|
23
|
-
- !ruby/object:Gem::Version
|
24
|
-
version:
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '3'
|
25
22
|
type: :runtime
|
26
|
-
version_requirements: *id001
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: activemodel
|
29
23
|
prerelease: false
|
30
|
-
|
24
|
+
version_requirements: *2153358420
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: activemodel
|
27
|
+
requirement: &2153357920 !ruby/object:Gem::Requirement
|
31
28
|
none: false
|
32
|
-
requirements:
|
33
|
-
- -
|
34
|
-
- !ruby/object:Gem::Version
|
35
|
-
version:
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '3'
|
36
33
|
type: :runtime
|
37
|
-
version_requirements: *id002
|
38
|
-
- !ruby/object:Gem::Dependency
|
39
|
-
name: rest-client
|
40
34
|
prerelease: false
|
41
|
-
|
35
|
+
version_requirements: *2153357920
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rest-client
|
38
|
+
requirement: &2153357460 !ruby/object:Gem::Requirement
|
42
39
|
none: false
|
43
|
-
requirements:
|
44
|
-
- -
|
45
|
-
- !ruby/object:Gem::Version
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
46
43
|
version: 1.6.1
|
47
44
|
type: :runtime
|
48
|
-
version_requirements: *id003
|
49
|
-
- !ruby/object:Gem::Dependency
|
50
|
-
name: json
|
51
45
|
prerelease: false
|
52
|
-
|
46
|
+
version_requirements: *2153357460
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: json
|
49
|
+
requirement: &2153357080 !ruby/object:Gem::Requirement
|
53
50
|
none: false
|
54
|
-
requirements:
|
55
|
-
- -
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
version:
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
58
55
|
type: :runtime
|
59
|
-
version_requirements: *id004
|
60
|
-
- !ruby/object:Gem::Dependency
|
61
|
-
name: rsolr
|
62
56
|
prerelease: false
|
63
|
-
|
57
|
+
version_requirements: *2153357080
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: rsolr
|
60
|
+
requirement: &2153356620 !ruby/object:Gem::Requirement
|
64
61
|
none: false
|
65
|
-
requirements:
|
66
|
-
- -
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version:
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
69
66
|
type: :runtime
|
70
|
-
version_requirements: *id005
|
71
|
-
- !ruby/object:Gem::Dependency
|
72
|
-
name: rsolr-ext
|
73
67
|
prerelease: false
|
74
|
-
|
68
|
+
version_requirements: *2153356620
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rsolr-ext
|
71
|
+
requirement: &2153373340 !ruby/object:Gem::Requirement
|
75
72
|
none: false
|
76
|
-
requirements:
|
77
|
-
- -
|
78
|
-
- !ruby/object:Gem::Version
|
79
|
-
version:
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
80
77
|
type: :runtime
|
81
|
-
version_requirements: *id006
|
82
|
-
- !ruby/object:Gem::Dependency
|
83
|
-
name: nokogiri
|
84
78
|
prerelease: false
|
85
|
-
|
79
|
+
version_requirements: *2153373340
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: nokogiri
|
82
|
+
requirement: &2153372920 !ruby/object:Gem::Requirement
|
86
83
|
none: false
|
87
|
-
requirements:
|
88
|
-
- -
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
version:
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
91
88
|
type: :runtime
|
92
|
-
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: *2153372920
|
93
91
|
description: Ruby wrapper for the LucidWorks REST API
|
94
|
-
email:
|
92
|
+
email:
|
95
93
|
- sam.pierson@lucidimagination.com
|
96
94
|
executables: []
|
97
|
-
|
98
95
|
extensions: []
|
99
|
-
|
100
96
|
extra_rdoc_files: []
|
101
|
-
|
102
|
-
files:
|
97
|
+
files:
|
103
98
|
- .autotest
|
104
99
|
- .gitignore
|
105
100
|
- .rspec
|
@@ -194,35 +189,31 @@ files:
|
|
194
189
|
- spec/spec_helper.rb
|
195
190
|
- spec/support/active_model_lint.rb
|
196
191
|
- spec/support/lucid_works.rb
|
197
|
-
|
198
|
-
homepage: ""
|
192
|
+
homepage: ''
|
199
193
|
licenses: []
|
200
|
-
|
201
194
|
post_install_message:
|
202
195
|
rdoc_options: []
|
203
|
-
|
204
|
-
require_paths:
|
196
|
+
require_paths:
|
205
197
|
- lib
|
206
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
198
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
207
199
|
none: false
|
208
|
-
requirements:
|
209
|
-
- -
|
210
|
-
- !ruby/object:Gem::Version
|
211
|
-
version:
|
212
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
200
|
+
requirements:
|
201
|
+
- - ! '>='
|
202
|
+
- !ruby/object:Gem::Version
|
203
|
+
version: '0'
|
204
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
213
205
|
none: false
|
214
|
-
requirements:
|
215
|
-
- -
|
216
|
-
- !ruby/object:Gem::Version
|
217
|
-
version:
|
206
|
+
requirements:
|
207
|
+
- - ! '>='
|
208
|
+
- !ruby/object:Gem::Version
|
209
|
+
version: '0'
|
218
210
|
requirements: []
|
219
|
-
|
220
211
|
rubyforge_project: lucid_works
|
221
|
-
rubygems_version: 1.6
|
212
|
+
rubygems_version: 1.8.6
|
222
213
|
signing_key:
|
223
214
|
specification_version: 3
|
224
215
|
summary: Ruby wrapper for the LucidWorks REST API
|
225
|
-
test_files:
|
216
|
+
test_files:
|
226
217
|
- spec/fixtures/fake_file_ds_to_be_deleted/.gitkeep
|
227
218
|
- spec/fixtures/fake_file_ds_to_be_updated/.gitkeep
|
228
219
|
- spec/fixtures/fake_file_ds_to_get_index_of/.gitkeep
|