hublot 0.0.1
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.
- data/.gitignore +17 -0
- data/.rspec +1 -0
- data/Gemfile +9 -0
- data/LICENSE.txt +22 -0
- data/README.md +50 -0
- data/Rakefile +2 -0
- data/hublot.gemspec +24 -0
- data/lib/clock/clockmanifest.rb +17 -0
- data/lib/clock/friday.rb +9 -0
- data/lib/clock/last_friday.rb +9 -0
- data/lib/clock/last_monday.rb +9 -0
- data/lib/clock/last_saturday.rb +9 -0
- data/lib/clock/last_sunday.rb +9 -0
- data/lib/clock/last_thursday.rb +9 -0
- data/lib/clock/last_tuesday.rb +9 -0
- data/lib/clock/last_wednesday.rb +9 -0
- data/lib/clock/monday.rb +9 -0
- data/lib/clock/next_monday.rb +9 -0
- data/lib/clock/next_sunday.rb +9 -0
- data/lib/clock/saturday.rb +9 -0
- data/lib/clock/sunday.rb +9 -0
- data/lib/clock/thursday.rb +9 -0
- data/lib/clock/timepiece.rb +15 -0
- data/lib/clock/tuesday.rb +9 -0
- data/lib/clock/wednesday.rb +9 -0
- data/lib/example_objects/active_record_example.rb +14 -0
- data/lib/hublot.rb +6 -0
- data/lib/hublot/pretty.rb +120 -0
- data/lib/hublot/version.rb +3 -0
- data/spec/clock_spec.rb +119 -0
- data/spec/pretty_spec.rb +77 -0
- metadata +149 -0
data/.gitignore
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Brett Shollenberger
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
Hublot
|
2
|
+
==================================
|
3
|
+
|
4
|
+
Hublot makes Facebook-style datetime-contextual datetimes a cinch for your ActiveRecord objects.
|
5
|
+
|
6
|
+
Examples
|
7
|
+
==================================
|
8
|
+
####Comment created a just now:
|
9
|
+
|
10
|
+
just now
|
11
|
+
|
12
|
+
####Comment created seconds or minutes ago
|
13
|
+
|
14
|
+
10 seconds ago
|
15
|
+
2 minutes ago
|
16
|
+
|
17
|
+
####Comment created today
|
18
|
+
|
19
|
+
Today at 5:30PM
|
20
|
+
|
21
|
+
####Comment created yesterday
|
22
|
+
|
23
|
+
Yesterday at 5:30PM
|
24
|
+
|
25
|
+
####Comment created this week
|
26
|
+
|
27
|
+
Monday at 5:30PM
|
28
|
+
|
29
|
+
####Comment created last week
|
30
|
+
|
31
|
+
Last Monday at 5:30PM
|
32
|
+
|
33
|
+
####After that:
|
34
|
+
|
35
|
+
Monday, July 1 at 5:30PM
|
36
|
+
|
37
|
+
Use
|
38
|
+
=================================
|
39
|
+
|
40
|
+
gem 'hublot'
|
41
|
+
|
42
|
+
Include Hublot in your ActiveRecord models:
|
43
|
+
|
44
|
+
class Comment < ActiveRecord::Base
|
45
|
+
include Hublot
|
46
|
+
end
|
47
|
+
|
48
|
+
Call the pretty method in your views:
|
49
|
+
|
50
|
+
<%= @comment.pretty %>
|
data/Rakefile
ADDED
data/hublot.gemspec
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'hublot/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "hublot"
|
8
|
+
gem.version = Hublot::VERSION
|
9
|
+
gem.authors = ["Brett Shollenberger"]
|
10
|
+
gem.email = ["brett.shollenberger@gmail.com"]
|
11
|
+
gem.description = "Date-sensitive humanized datetim"
|
12
|
+
gem.summary = "Include hublot inside any class that includes a created_at attribute, and call the pretty method on that object to return context-sensitive datetime."
|
13
|
+
gem.homepage = ""
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($/)
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
+
gem.require_paths = ["lib"]
|
19
|
+
|
20
|
+
gem.add_development_dependency 'rspec'
|
21
|
+
gem.add_development_dependency 'active_support'
|
22
|
+
gem.add_development_dependency 'i18n'
|
23
|
+
gem.add_development_dependency 'rake'
|
24
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'clock/timepiece'
|
2
|
+
require 'clock/monday'
|
3
|
+
require 'clock/tuesday'
|
4
|
+
require 'clock/wednesday'
|
5
|
+
require 'clock/thursday'
|
6
|
+
require 'clock/friday'
|
7
|
+
require 'clock/saturday'
|
8
|
+
require 'clock/sunday'
|
9
|
+
require 'clock/last_monday'
|
10
|
+
require 'clock/last_tuesday'
|
11
|
+
require 'clock/last_wednesday'
|
12
|
+
require 'clock/last_thursday'
|
13
|
+
require 'clock/last_friday'
|
14
|
+
require 'clock/last_saturday'
|
15
|
+
require 'clock/last_sunday'
|
16
|
+
require 'clock/next_monday'
|
17
|
+
require 'clock/next_sunday'
|
data/lib/clock/friday.rb
ADDED
data/lib/clock/monday.rb
ADDED
data/lib/clock/sunday.rb
ADDED
data/lib/hublot.rb
ADDED
@@ -0,0 +1,120 @@
|
|
1
|
+
module Hublot
|
2
|
+
|
3
|
+
# Clock argument for testing; defaults to Time
|
4
|
+
def pretty(clock=Time.now)
|
5
|
+
@expired = (clock-self.created_at).to_i
|
6
|
+
@today = clock.strftime('%A')
|
7
|
+
@created = self.created_at.strftime('%A')
|
8
|
+
|
9
|
+
@days = {
|
10
|
+
"Monday" => 1,
|
11
|
+
"Tuesday" => 2,
|
12
|
+
"Wednesday" => 3,
|
13
|
+
"Thursday" => 4,
|
14
|
+
"Friday" => 5,
|
15
|
+
"Saturday" => 6,
|
16
|
+
"Sunday" => 7
|
17
|
+
}
|
18
|
+
|
19
|
+
return just_now if just_now?
|
20
|
+
return a_second_ago if a_second_ago?
|
21
|
+
return seconds_ago if seconds_ago?
|
22
|
+
return a_minute_ago if a_minute_ago?
|
23
|
+
return minutes_ago if minutes_ago?
|
24
|
+
return an_hour_ago if an_hour_ago?
|
25
|
+
return today if today?
|
26
|
+
return yesterday if yesterday?
|
27
|
+
return this_week if this_week?
|
28
|
+
return last_week if last_week?
|
29
|
+
return datetimefiesta
|
30
|
+
end
|
31
|
+
|
32
|
+
protected
|
33
|
+
def just_now
|
34
|
+
'just now'
|
35
|
+
end
|
36
|
+
|
37
|
+
def just_now?
|
38
|
+
@expired == 0
|
39
|
+
end
|
40
|
+
|
41
|
+
def a_second_ago
|
42
|
+
'a second ago'
|
43
|
+
end
|
44
|
+
|
45
|
+
def a_second_ago?
|
46
|
+
@expired == 1
|
47
|
+
end
|
48
|
+
|
49
|
+
def seconds_ago
|
50
|
+
@expired.to_s+' seconds ago'
|
51
|
+
end
|
52
|
+
|
53
|
+
def seconds_ago?
|
54
|
+
@expired >= 2 && @expired <= 59
|
55
|
+
end
|
56
|
+
|
57
|
+
def a_minute_ago
|
58
|
+
'a minute ago'
|
59
|
+
end
|
60
|
+
|
61
|
+
def a_minute_ago?
|
62
|
+
@expired >= 60 && @expired <= 119 #120 = 2 minutes
|
63
|
+
end
|
64
|
+
|
65
|
+
def minutes_ago
|
66
|
+
(@expired/60).to_i.to_s+' minutes ago'
|
67
|
+
end
|
68
|
+
|
69
|
+
def minutes_ago?
|
70
|
+
@expired >= 120 && @expired <= 3599
|
71
|
+
end
|
72
|
+
|
73
|
+
def an_hour_ago
|
74
|
+
'an hour ago'
|
75
|
+
end
|
76
|
+
|
77
|
+
def an_hour_ago?
|
78
|
+
@expired >= 3600 && @expired <= 7199 # 3600 = 1 hour
|
79
|
+
end
|
80
|
+
|
81
|
+
def today
|
82
|
+
"Today at#{time}"
|
83
|
+
end
|
84
|
+
|
85
|
+
def time
|
86
|
+
"#{self.created_at.strftime("%l:%M%p")}"
|
87
|
+
end
|
88
|
+
|
89
|
+
def today?
|
90
|
+
@days[@today] - @days[@created] == 0 && @expired >= 7200 && @expired <= 82800
|
91
|
+
end
|
92
|
+
|
93
|
+
def yesterday
|
94
|
+
"Yesterday at #{time}"
|
95
|
+
end
|
96
|
+
|
97
|
+
def yesterday?
|
98
|
+
(@days[@today] - @days[@created] == 1 || @days[@created] + @days[@today] == 8) && @expired <= 172800
|
99
|
+
end
|
100
|
+
|
101
|
+
def this_week
|
102
|
+
"#{@created} at #{time}"
|
103
|
+
end
|
104
|
+
|
105
|
+
def this_week?
|
106
|
+
@expired <= 604800 && @days[@today] - @days[@created] != 0
|
107
|
+
end
|
108
|
+
|
109
|
+
def last_week
|
110
|
+
"Last #{@created} at #{time}"
|
111
|
+
end
|
112
|
+
|
113
|
+
def last_week?
|
114
|
+
@expired >= 518400 && @expired <= 1209600
|
115
|
+
end
|
116
|
+
|
117
|
+
def datetimefiesta
|
118
|
+
self.created_at.strftime("%A, %B%e at %l:%M%p")
|
119
|
+
end
|
120
|
+
end
|
data/spec/clock_spec.rb
ADDED
@@ -0,0 +1,119 @@
|
|
1
|
+
require 'rspec'
|
2
|
+
require 'active_support/core_ext'
|
3
|
+
|
4
|
+
require_relative '../lib/clock/clockmanifest'
|
5
|
+
|
6
|
+
describe Clock do
|
7
|
+
let(:monday) { Clock::Monday.new }
|
8
|
+
let(:tuesday) { Clock::Tuesday.new }
|
9
|
+
let(:wednesday) { Clock::Wednesday.new }
|
10
|
+
let(:thursday) { Clock::Thursday.new }
|
11
|
+
let(:friday) { Clock::Friday.new }
|
12
|
+
let(:saturday) { Clock::Saturday.new }
|
13
|
+
let(:sunday) { Clock::Sunday.new }
|
14
|
+
let(:last_monday) { Clock::LastMonday.new }
|
15
|
+
let(:last_tuesday) { Clock::LastTuesday.new }
|
16
|
+
let(:last_wednesday) { Clock::LastWednesday.new }
|
17
|
+
let(:last_thursday) { Clock::LastThursday.new }
|
18
|
+
let(:last_friday) { Clock::LastFriday.new }
|
19
|
+
let(:last_saturday) { Clock::LastSaturday.new }
|
20
|
+
let(:last_sunday) { Clock::LastSunday.new }
|
21
|
+
let(:next_monday) { Clock::NextMonday.new }
|
22
|
+
let(:next_sunday) { Clock::NextSunday.new }
|
23
|
+
|
24
|
+
describe "Monday" do
|
25
|
+
it "is Monday" do
|
26
|
+
expect(monday.day_of_week).to eql("Monday")
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe "Tuesday" do
|
31
|
+
it "is Tuesday" do
|
32
|
+
expect(tuesday.day_of_week).to eql("Tuesday")
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe "Wednesday" do
|
37
|
+
it "is Wednesday" do
|
38
|
+
expect(wednesday.day_of_week).to eql("Wednesday")
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
describe "Thursday" do
|
43
|
+
it "is Thursday" do
|
44
|
+
expect(thursday.day_of_week).to eql("Thursday")
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
describe "Friday" do
|
49
|
+
it "is Friday" do
|
50
|
+
expect(friday.day_of_week).to eql("Friday")
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
describe "Saturday" do
|
55
|
+
it "is Saturday" do
|
56
|
+
expect(saturday.day_of_week).to eql("Saturday")
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
describe "Sunday" do
|
61
|
+
it "is Sunday" do
|
62
|
+
expect(sunday.day_of_week).to eql("Sunday")
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
describe "LastMonday" do
|
67
|
+
it "is Monday" do
|
68
|
+
expect(last_monday.day_of_week).to eql("Monday")
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
describe "LastTuesday" do
|
73
|
+
it "is Tuesday" do
|
74
|
+
expect(last_tuesday.day_of_week).to eql("Tuesday")
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
describe "LastWednesday" do
|
79
|
+
it "is Wednesday" do
|
80
|
+
expect(last_wednesday.day_of_week).to eql("Wednesday")
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
describe "LastThursday" do
|
85
|
+
it "is Thursday" do
|
86
|
+
expect(last_thursday.day_of_week).to eql("Thursday")
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
describe "LastFriday" do
|
91
|
+
it "is Friday" do
|
92
|
+
expect(last_friday.day_of_week).to eql("Friday")
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
describe "LastSaturday" do
|
97
|
+
it "is Saturday" do
|
98
|
+
expect(last_saturday.day_of_week).to eql("Saturday")
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
describe "LastSunday" do
|
103
|
+
it "is Sunday" do
|
104
|
+
expect(last_sunday.day_of_week).to eql("Sunday")
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
describe "NextMonday" do
|
109
|
+
it "is Monday" do
|
110
|
+
expect(next_monday.day_of_week).to eql("Monday")
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
describe "NextSunday" do
|
115
|
+
it "is Sunday" do
|
116
|
+
expect(next_sunday.day_of_week).to eql("Sunday")
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
data/spec/pretty_spec.rb
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
require 'rspec'
|
2
|
+
require 'active_support/core_ext'
|
3
|
+
|
4
|
+
require_relative '../lib/hublot'
|
5
|
+
require_relative '../lib/clock/clockmanifest'
|
6
|
+
require_relative '../lib/example_objects/active_record_example'
|
7
|
+
|
8
|
+
describe Hublot do
|
9
|
+
let(:example_object) { ExampleObjects::ActiveRecordExample.new }
|
10
|
+
let(:monday) { Clock::Monday.new }
|
11
|
+
let(:tuesday) { Clock::Tuesday.new }
|
12
|
+
let(:wednesday) { Clock::Wednesday.new }
|
13
|
+
let(:sunday) { Clock::Sunday.new }
|
14
|
+
let(:last_monday) { Clock::LastMonday.new }
|
15
|
+
let(:next_monday) { Clock::NextMonday.new }
|
16
|
+
let(:next_sunday) { Clock::NextSunday.new }
|
17
|
+
|
18
|
+
describe "#pretty" do
|
19
|
+
it "returns just now when the object was just created" do
|
20
|
+
expect(example_object.pretty).to eql("just now")
|
21
|
+
end
|
22
|
+
|
23
|
+
it "returns just now when the object was just created" do
|
24
|
+
example_object.created_at = Time.now - 1.second
|
25
|
+
expect(example_object.pretty).to eql("a second ago")
|
26
|
+
end
|
27
|
+
|
28
|
+
it "returns x seconds ago when it's been less than one minute since creation" do
|
29
|
+
example_object.created_at = Time.now - 2.seconds
|
30
|
+
expect(example_object.pretty).to eql("2 seconds ago")
|
31
|
+
example_object.created_at = Time.now - 59.seconds
|
32
|
+
expect(example_object.pretty).to eql("59 seconds ago")
|
33
|
+
end
|
34
|
+
|
35
|
+
it "returns x minutes ago when it's been less than one hour since creation" do
|
36
|
+
example_object.created_at = Time.now - 1.minute
|
37
|
+
expect(example_object.pretty).to eql("a minute ago")
|
38
|
+
example_object.created_at = Time.now - 59.minutes
|
39
|
+
expect(example_object.pretty).to eql("59 minutes ago")
|
40
|
+
end
|
41
|
+
|
42
|
+
it "returns an hour ago when it's been less than two hours since creation" do
|
43
|
+
example_object.created_at = Time.now - 1.hour
|
44
|
+
expect(example_object.pretty).to eql("an hour ago")
|
45
|
+
example_object.created_at = Time.now - 2.hours + 1.second
|
46
|
+
expect(example_object.pretty).to eql("an hour ago")
|
47
|
+
end
|
48
|
+
|
49
|
+
it "returns Today at time when it's been more than an hour, and it's still the same day" do
|
50
|
+
example_object.created_at = monday.datetime - 2.hours
|
51
|
+
expect(example_object.pretty(monday.datetime)).to eql("Today at 8:00PM")
|
52
|
+
end
|
53
|
+
|
54
|
+
it "returns Yesterday at time when it's been more than a day" do
|
55
|
+
example_object.created_at = monday.datetime
|
56
|
+
expect(example_object.pretty(tuesday.datetime)).to eql("Yesterday at 10:00PM")
|
57
|
+
end
|
58
|
+
|
59
|
+
it "returns the day of week at time when it's been more than two days and it's the same week" do
|
60
|
+
example_object.created_at = monday.datetime
|
61
|
+
expect(example_object.pretty(wednesday.datetime)).to eql("Monday at 10:00PM")
|
62
|
+
expect(example_object.pretty(sunday.datetime)).to eql("Monday at 10:00PM")
|
63
|
+
end
|
64
|
+
|
65
|
+
it "returns last day of week at time when it's been more than one week" do
|
66
|
+
example_object.created_at = last_monday.datetime
|
67
|
+
expect(example_object.pretty(monday.datetime)).to eql("Last Monday at 10:00PM")
|
68
|
+
expect(example_object.pretty(sunday.datetime)).to eql("Last Monday at 10:00PM")
|
69
|
+
end
|
70
|
+
|
71
|
+
it "returns a fully qualified datetime when it's been more than two weeks" do
|
72
|
+
example_object.created_at = last_monday.datetime
|
73
|
+
expect(example_object.pretty(next_monday.datetime)).to eql("Monday, July 1 at 10:00PM")
|
74
|
+
expect(example_object.pretty(next_sunday.datetime)).to eql("Monday, July 1 at 10:00PM")
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
metadata
ADDED
@@ -0,0 +1,149 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: hublot
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Brett Shollenberger
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-07-09 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rspec
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: active_support
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: i18n
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rake
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
description: Date-sensitive humanized datetim
|
79
|
+
email:
|
80
|
+
- brett.shollenberger@gmail.com
|
81
|
+
executables: []
|
82
|
+
extensions: []
|
83
|
+
extra_rdoc_files: []
|
84
|
+
files:
|
85
|
+
- .gitignore
|
86
|
+
- .rspec
|
87
|
+
- Gemfile
|
88
|
+
- LICENSE.txt
|
89
|
+
- README.md
|
90
|
+
- Rakefile
|
91
|
+
- hublot.gemspec
|
92
|
+
- lib/clock/clockmanifest.rb
|
93
|
+
- lib/clock/friday.rb
|
94
|
+
- lib/clock/last_friday.rb
|
95
|
+
- lib/clock/last_monday.rb
|
96
|
+
- lib/clock/last_saturday.rb
|
97
|
+
- lib/clock/last_sunday.rb
|
98
|
+
- lib/clock/last_thursday.rb
|
99
|
+
- lib/clock/last_tuesday.rb
|
100
|
+
- lib/clock/last_wednesday.rb
|
101
|
+
- lib/clock/monday.rb
|
102
|
+
- lib/clock/next_monday.rb
|
103
|
+
- lib/clock/next_sunday.rb
|
104
|
+
- lib/clock/saturday.rb
|
105
|
+
- lib/clock/sunday.rb
|
106
|
+
- lib/clock/thursday.rb
|
107
|
+
- lib/clock/timepiece.rb
|
108
|
+
- lib/clock/tuesday.rb
|
109
|
+
- lib/clock/wednesday.rb
|
110
|
+
- lib/example_objects/active_record_example.rb
|
111
|
+
- lib/hublot.rb
|
112
|
+
- lib/hublot/pretty.rb
|
113
|
+
- lib/hublot/version.rb
|
114
|
+
- spec/clock_spec.rb
|
115
|
+
- spec/pretty_spec.rb
|
116
|
+
homepage: ''
|
117
|
+
licenses: []
|
118
|
+
post_install_message:
|
119
|
+
rdoc_options: []
|
120
|
+
require_paths:
|
121
|
+
- lib
|
122
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
123
|
+
none: false
|
124
|
+
requirements:
|
125
|
+
- - ! '>='
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: '0'
|
128
|
+
segments:
|
129
|
+
- 0
|
130
|
+
hash: 2396956993484912416
|
131
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
|
+
none: false
|
133
|
+
requirements:
|
134
|
+
- - ! '>='
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
version: '0'
|
137
|
+
segments:
|
138
|
+
- 0
|
139
|
+
hash: 2396956993484912416
|
140
|
+
requirements: []
|
141
|
+
rubyforge_project:
|
142
|
+
rubygems_version: 1.8.25
|
143
|
+
signing_key:
|
144
|
+
specification_version: 3
|
145
|
+
summary: Include hublot inside any class that includes a created_at attribute, and
|
146
|
+
call the pretty method on that object to return context-sensitive datetime.
|
147
|
+
test_files:
|
148
|
+
- spec/clock_spec.rb
|
149
|
+
- spec/pretty_spec.rb
|