hutch-xamplr 1.3.13 → 1.3.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 1
3
3
  :minor: 3
4
- :patch: 13
4
+ :patch: 14
@@ -27,7 +27,8 @@ module Xampl
27
27
  end
28
28
 
29
29
  $lexical_indexes = Set.new(%w{ class pid time-stamp xampl-from xampl-to xampl-place }) unless defined?($lexical_indexes)
30
- $numeric_indexes = Set.new unless defined?($numeric_indexes)
30
+
31
+ $numeric_indexes = Set.new(%w{ scheduled-delete-at }) unless defined?($numeric_indexes)
31
32
 
32
33
  def TokyoCabinetPersister.add_lexical_indexs(indexes)
33
34
  $lexical_indexes.merge(indexes)
@@ -397,12 +398,22 @@ module Xampl
397
398
  @tc_db.put(place, xampl_hash)
398
399
  end
399
400
 
401
+ #TODO -- smarter regarding when to delete (e.g. mentions)
402
+ if xampl.should_schedule_delete? and xampl.scheduled_for_deletion_at then
403
+ secondary_descriptions = [] unless secondary_descriptions
404
+ secondary_descriptions << { 'scheduled-delete-at' => xampl.scheduled_for_deletion_at }
405
+ elsif xampl.scheduled_for_deletion_at then
406
+ puts "#{ __FILE__ }:#{ __LINE__ } HOW TO DO THIS without violating xampl's change rules????? "
407
+ #xampl.scheduled_for_deletion_at = nil
408
+ end
409
+
400
410
  if secondary_descriptions then
401
411
  xampl_hash = {
402
412
  'class' => xampl.class.name,
403
413
  'pid' => xampl.get_the_index,
404
414
  'xampl-place' => place
405
415
  }
416
+
406
417
  secondary_descriptions.each do | secondary_description |
407
418
  description = secondary_description.merge(xampl_hash)
408
419
 
@@ -187,15 +187,16 @@ module Xampl
187
187
  ################################################################################################
188
188
  ################################################################################################
189
189
 
190
- def Xampl.find_things_to_delete
190
+ def Xampl.find_things_to_delete(scheduled_before=Time.now.to_i)
191
191
  #TODO -- one of these for XamplObject to limit search???
192
- Xampl.query do | q |
193
- q.add_condition('scheduled-delete', :streq, 'true')
192
+ things = Xampl.query do | q |
193
+ q.add_condition('scheduled-delete-at', :lte, scheduled_before)
194
194
  end
195
+ things
195
196
  end
196
197
 
197
198
  def should_schedule_delete?
198
- puts "Xampl#should_schedule_delete? is NOT IMPLEMENTED FOR: #{ self.class.name }"
199
+ #puts "Xampl#should_schedule_delete? is NOT IMPLEMENTED FOR: #{ self.class.name }"
199
200
  false
200
201
  end
201
202
 
@@ -203,18 +204,6 @@ module Xampl
203
204
  @scheduled_for_deletion_at = should_schedule_delete? ? at.to_s : nil #TODO -- necessary??
204
205
  end
205
206
 
206
- def schedule_delete_at
207
- #TODO -- smarter regarding when to delete
208
- if should_schedule_delete? and @scheduled_for_deletion_at then
209
- [{ 'scheduled-delete' => 'true',
210
- 'scheduled-delete-at' => @scheduled_for_deletion_at }]
211
- elsif @scheduled_for_deletion_at then
212
- @scheduled_for_deletion_at = nil
213
- else
214
- nil
215
- end
216
- end
217
-
218
207
  ################################################################################################
219
208
  ################################################################################################
220
209
  ################################################################################################
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{xamplr}
5
- s.version = "1.3.13"
5
+ s.version = "1.3.14"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Bob Hutchison"]
9
- s.date = %q{2009-06-25}
9
+ s.date = %q{2009-06-26}
10
10
  s.email = %q{hutch@recursive.ca}
11
11
  s.extra_rdoc_files = [
12
12
  "LICENSE",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hutch-xamplr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.13
4
+ version: 1.3.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Hutchison
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-06-25 00:00:00 -07:00
12
+ date: 2009-06-26 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency