jgrouper 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/HISTORY.md CHANGED
@@ -1,6 +1,11 @@
1
1
  JGrouper History
2
2
  ================
3
3
 
4
+ 2013-07-18 JGrouper v0.4.2
5
+ --------------------------
6
+ * Fix "JGrouper::AuditArchiver" end-of-day calculation
7
+
8
+
4
9
  2013-07-18 JGrouper v0.4.1
5
10
  --------------------------
6
11
  * Update "JGrouper::AuditArchiver" to detect re-archive attempts and increment date
@@ -60,17 +60,17 @@ module JGrouper # :nodoc:
60
60
 
61
61
  connect do
62
62
  mappings do
63
- last_date = nil
63
+ last_date = Date.new
64
64
  1.upto @number_of_days do
65
65
  @date = oldest_entry # Date of oldest entry
66
- if @date == last_date
67
- warn "WARNING: attempt to re-archive #{ @date }, moving one day forward..."
68
- @date = @date + 1
66
+ if @date <= last_date
67
+ warn "WARNING: attempt to re-archive #{ @date }, aborting ..."
68
+ break
69
69
  end
70
70
  break if stop?
71
71
 
72
- start_at = time_to_microseconds @date.to_time # @date start-of-day
73
- stop_at = time_to_microseconds ( @date + 1 ).to_time - 1 # @date end-of-day
72
+ start_at = time_to_microseconds @date.to_time # @date start-of-day
73
+ stop_at = ( time_to_microseconds ( @date + 1 ).to_time ) - 1 # @date end-of-day
74
74
  # TODO Verify number of entries is greater than 0?
75
75
 
76
76
  num_entries = 0
@@ -273,8 +273,8 @@ module JGrouper # :nodoc:
273
273
  stmt = @conn.create_statement
274
274
  rs = stmt.execute_query "SELECT MIN(created_on) FROM #{GROUPER_AUDIT_ENTRY} ORDER BY created_on"
275
275
  while rs.next
276
- # String Microseconds -> Float Microseconds -> Round Up -> Seconds -> Time -> Date
277
- d = Time.at( microseconds_to_seconds( rs.get_object(1).to_s.to_f.ceil ) ).to_date
276
+ # Object => String => Float => Time => Date
277
+ d = Time.at( microseconds_to_seconds( rs.get_object(1).to_s.to_f ) ).to_date
278
278
  break
279
279
  end
280
280
  rs.close
@@ -1,4 +1,4 @@
1
1
  module JGrouper
2
- VERSION = '0.4.1'
2
+ VERSION = '0.4.2'
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jgrouper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: