timescopes 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/timescopes/rails/active_record_extension.rb +1 -1
- data/lib/timescopes/scopes.rb +6 -0
- data/timescopes.gemspec +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 752aca084979b6cf8f7accb289f263ffe3199fd3
|
4
|
+
data.tar.gz: cf83c98deb5a85670346a582eb5ba372e5fce76d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d983876cfe71225d424739fadabd93c48520aa68ae8b94e2094c934535cafe1562f057fee9cb27e2b5cabe3d5fd8c5316155be2ef49145335b3b4d5bca8346e
|
7
|
+
data.tar.gz: 435ed29a6550208042181e3b73f69a0626160f3b395f46d5ac6746d089c50e2450c17321698e32f403a4ed1b62f2e06878806c367d1f415aea4107af875f6dad
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/lib/timescopes/scopes.rb
CHANGED
@@ -2,6 +2,12 @@ require 'chronic'
|
|
2
2
|
|
3
3
|
module TimeScopes
|
4
4
|
class << self
|
5
|
+
def hourly(start=nil)
|
6
|
+
start ||= Time.now
|
7
|
+
[ Chronic.parse(start.strftime("%Y-%m-%d #{start.hour}:00:00Z")),
|
8
|
+
Chronic.parse(start.strftime("%Y-%m-%d #{start.hour}:59:59Z")) ]
|
9
|
+
end
|
10
|
+
|
5
11
|
def daily(start=nil)
|
6
12
|
start ||= Time.now
|
7
13
|
[ Chronic.parse(start_of_day(start.utc)),
|
data/timescopes.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: timescopes 0.1.
|
5
|
+
# stub: timescopes 0.1.2 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "timescopes"
|
9
|
-
s.version = "0.1.
|
9
|
+
s.version = "0.1.2"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Ian Hunter"]
|
14
|
-
s.date = "2015-
|
14
|
+
s.date = "2015-11-15"
|
15
15
|
s.description = ""
|
16
16
|
s.email = "ianhunter@gmail.com"
|
17
17
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timescopes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian Hunter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chronic
|