mirror of
https://github.com/jimeh/redistat.git
synced 2026-02-19 13:26:39 +00:00
some cleanup
This commit is contained in:
@@ -1,27 +1,3 @@
|
||||
class Time
|
||||
include Redistat::DateHelper
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -26,14 +26,17 @@ module Redistat
|
||||
def to_t
|
||||
::Time.local(@year, @month, @day, @hour, @min, @sec, @usec)
|
||||
end
|
||||
alias :to_time :to_t
|
||||
|
||||
def to_d
|
||||
::Date.civil(@year, @month, @day)
|
||||
end
|
||||
alias :to_date :to_d
|
||||
|
||||
def to_i
|
||||
to_time.to_i
|
||||
end
|
||||
alias :to_integer :to_i
|
||||
|
||||
def to_s(depth = nil)
|
||||
depth ||= :sec
|
||||
@@ -49,12 +52,7 @@ module Redistat
|
||||
end
|
||||
output
|
||||
end
|
||||
|
||||
alias :to_time :to_t
|
||||
alias :to_date :to_d
|
||||
alias :to_integer :to_i
|
||||
alias :to_string :to_s
|
||||
|
||||
alias :to_string :to_s
|
||||
|
||||
private
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
require "spec_helper"
|
||||
|
||||
describe Redistat::Summary do
|
||||
include Redistat::Database
|
||||
|
||||
before(:each) do
|
||||
db.flushdb
|
||||
@@ -45,10 +46,27 @@ describe Redistat::Summary do
|
||||
end
|
||||
end
|
||||
|
||||
it "should fetch summary collections for date ranges"
|
||||
|
||||
def db
|
||||
Redistat.redis
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user