human_date 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1c7efdd174fc1a7ea1602944f2f24017241a2295
4
+ data.tar.gz: 4e0aded98ffe429be3aa632d35dd737e516e1e0b
5
+ SHA512:
6
+ metadata.gz: 25353f382c252c23effee652867bd69819eb51b1b44d78de6c73c5d8c94bf9f6dfbc9513e6ccb6f6e1aaba823e406f7bd7afa11b4bffcbe4b040891bb72b1246
7
+ data.tar.gz: 4a7593312a0e265b053301ca23bfe9d765897bc5f2b58da106449488d4af6cae775257e705c91a286e217d99a87b0d51061907e8a203be7301153d1a693968c2
data/README.md CHANGED
@@ -6,10 +6,10 @@
6
6
  date = Date.current # 2012-08-28
7
7
 
8
8
  human_date(date) # Today
9
- human_date(time + 1.day) # Tomorrow
10
- human_date(time - 1.day) # Yesterday
11
- human_date(time - 2.days) # Aug 26
12
- human_date(time - 1.year) # Aug 28, 2011
9
+ human_date(date + 1.day) # Tomorrow
10
+ human_date(date - 1.day) # Yesterday
11
+ human_date(date - 2.days) # Aug 26
12
+ human_date(date - 1.year) # Aug 28, 2011
13
13
 
14
14
  # it works with times, too
15
15
 
@@ -22,7 +22,7 @@ human_time(time - 1.day) # Yesterday
22
22
 
23
23
  `human_date` provides you with 5 states for your Time/Date objects:
24
24
 
25
- - `today` displays time only: `5:20 pm`
25
+ - `today` displays `Today` for Date and time for Time (`5:20 pm`)
26
26
 
27
27
  - `tomorrow` displays: `Tomorrow`
28
28
 
@@ -32,7 +32,7 @@ human_time(time - 1.day) # Yesterday
32
32
 
33
33
  - `other_year` displays the month, the day and the year: `Aug 28, 2011`
34
34
 
35
- The default values can be overwriten in the locale file. See the I18n section for details.
35
+ The default values can be overwritten in the locale file. See the I18n section for details.
36
36
 
37
37
  ## Installation
38
38
 
@@ -50,9 +50,9 @@ Or install it yourself as:
50
50
 
51
51
  ## Usage
52
52
 
53
- - `human_date` for human dates
53
+ - `human_date` for dates
54
54
 
55
- - `human_time` for human times
55
+ - `human_time` for times
56
56
 
57
57
  - `human_time_tag` generates HTML5 `<time>` tag
58
58
 
@@ -142,7 +142,7 @@ en:
142
142
  tomorrow: "Tomorrow"
143
143
  yesterday: "Yesterday"
144
144
  current_year: "%h %e"
145
- previous_years: "%h %e, %Y"
145
+ other_year: "%h %e, %Y"
146
146
 
147
147
  ```
148
148
 
@@ -1,3 +1,3 @@
1
1
  module HumanDate
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -1,7 +1,7 @@
1
- include ActionView::Helpers::TagHelper
2
-
3
1
  module HumanDate
4
2
  module ViewHelpers
3
+ include ActionView::Helpers::TagHelper
4
+
5
5
  def human_date(object, namespace = nil)
6
6
  I18n.localize(object, format: format_for_object(object, namespace)).strip
7
7
  end
@@ -1,10 +1,8 @@
1
1
  # encoding: UTF-8
2
2
  require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
3
3
 
4
- include HumanDate::ViewHelpers
5
-
6
-
7
4
  describe HumanDate::ViewHelpers do
5
+ include HumanDate::ViewHelpers
8
6
 
9
7
  before do
10
8
  Timecop.freeze Time.parse('2012-08-28 17:20:54 +01:00').in_time_zone
metadata CHANGED
@@ -1,71 +1,85 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: human_date
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
5
- prerelease:
4
+ version: 0.0.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Alexander Zaytsev
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-12-14 00:00:00.000000000 Z
11
+ date: 2013-05-19 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: activesupport
16
- requirement: &2154725500 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :development
23
21
  prerelease: false
24
- version_requirements: *2154725500
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
25
27
  - !ruby/object:Gem::Dependency
26
28
  name: actionpack
27
- requirement: &2168723400 !ruby/object:Gem::Requirement
28
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
- - - ! '>='
31
+ - - '>='
31
32
  - !ruby/object:Gem::Version
32
33
  version: '0'
33
34
  type: :development
34
35
  prerelease: false
35
- version_requirements: *2168723400
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
36
41
  - !ruby/object:Gem::Dependency
37
42
  name: rspec
38
- requirement: &2168722980 !ruby/object:Gem::Requirement
39
- none: false
43
+ requirement: !ruby/object:Gem::Requirement
40
44
  requirements:
41
- - - ! '>='
45
+ - - '>='
42
46
  - !ruby/object:Gem::Version
43
47
  version: '0'
44
48
  type: :development
45
49
  prerelease: false
46
- version_requirements: *2168722980
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
47
55
  - !ruby/object:Gem::Dependency
48
56
  name: timecop
49
- requirement: &2168722560 !ruby/object:Gem::Requirement
50
- none: false
57
+ requirement: !ruby/object:Gem::Requirement
51
58
  requirements:
52
- - - ! '>='
59
+ - - '>='
53
60
  - !ruby/object:Gem::Version
54
61
  version: '0'
55
62
  type: :development
56
63
  prerelease: false
57
- version_requirements: *2168722560
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
58
69
  - !ruby/object:Gem::Dependency
59
70
  name: tzinfo
60
- requirement: &2168722140 !ruby/object:Gem::Requirement
61
- none: false
71
+ requirement: !ruby/object:Gem::Requirement
62
72
  requirements:
63
- - - ! '>='
73
+ - - '>='
64
74
  - !ruby/object:Gem::Version
65
75
  version: '0'
66
76
  type: :development
67
77
  prerelease: false
68
- version_requirements: *2168722140
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  description: View helpers to make your Dates and Times more human like
70
84
  email:
71
85
  - alexander@say26.com
@@ -91,27 +105,26 @@ files:
91
105
  - spec/spec_helper.rb
92
106
  homepage: http://github.com/AlexanderZaytsev/human_date
93
107
  licenses: []
108
+ metadata: {}
94
109
  post_install_message:
95
110
  rdoc_options: []
96
111
  require_paths:
97
112
  - lib
98
113
  required_ruby_version: !ruby/object:Gem::Requirement
99
- none: false
100
114
  requirements:
101
- - - ! '>='
115
+ - - '>='
102
116
  - !ruby/object:Gem::Version
103
117
  version: '0'
104
118
  required_rubygems_version: !ruby/object:Gem::Requirement
105
- none: false
106
119
  requirements:
107
- - - ! '>='
120
+ - - '>='
108
121
  - !ruby/object:Gem::Version
109
122
  version: '0'
110
123
  requirements: []
111
124
  rubyforge_project:
112
- rubygems_version: 1.8.15
125
+ rubygems_version: 2.0.0
113
126
  signing_key:
114
- specification_version: 3
127
+ specification_version: 4
115
128
  summary: Display dates and times for humans, not robots!
116
129
  test_files:
117
130
  - spec/human_date_spec.rb