semantic_date_time_tags 0.1.16 → 0.1.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +60 -58
- data/lib/semantic_date_time_tags/tag/date.rb +3 -0
- data/lib/semantic_date_time_tags/tag/date_range.rb +2 -7
- data/lib/semantic_date_time_tags/tag/date_time.rb +3 -0
- data/lib/semantic_date_time_tags/version.rb +1 -1
- data/test/semantic_date_time_tags/view_helpers_test.rb +4 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c20d269f312b59d4fbe3f925ea9878228bb0861
|
4
|
+
data.tar.gz: d000cff436dc9d5c2a1bbe3b773386411084ab7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e80126f88f83a8572d12158c5d6cfa3d7e14eaf6b44cd9cd3d18611df72aa4e5339f04ff7df42e3d346f6fae3091c797096a4eb1ffb71bb6180e41ec5ea02ee3
|
7
|
+
data.tar.gz: d7cb59136ca69351eb869cfbb0708e7e58a3d1a07f8a1f2b249b235477c6c43bf19d8e4f3a4c1684bbbfd945c60c4b7514d80574c8048c3128ab6adfe8ae0475
|
data/CHANGELOG.md
ADDED
data/Gemfile.lock
CHANGED
@@ -1,50 +1,50 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
semantic_date_time_tags (0.1.
|
4
|
+
semantic_date_time_tags (0.1.18)
|
5
5
|
rails (>= 3)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actioncable (5.
|
11
|
-
actionpack (= 5.
|
12
|
-
nio4r (
|
10
|
+
actioncable (5.1.4)
|
11
|
+
actionpack (= 5.1.4)
|
12
|
+
nio4r (~> 2.0)
|
13
13
|
websocket-driver (~> 0.6.1)
|
14
|
-
actionmailer (5.
|
15
|
-
actionpack (= 5.
|
16
|
-
actionview (= 5.
|
17
|
-
activejob (= 5.
|
14
|
+
actionmailer (5.1.4)
|
15
|
+
actionpack (= 5.1.4)
|
16
|
+
actionview (= 5.1.4)
|
17
|
+
activejob (= 5.1.4)
|
18
18
|
mail (~> 2.5, >= 2.5.4)
|
19
19
|
rails-dom-testing (~> 2.0)
|
20
|
-
actionpack (5.
|
21
|
-
actionview (= 5.
|
22
|
-
activesupport (= 5.
|
20
|
+
actionpack (5.1.4)
|
21
|
+
actionview (= 5.1.4)
|
22
|
+
activesupport (= 5.1.4)
|
23
23
|
rack (~> 2.0)
|
24
|
-
rack-test (
|
24
|
+
rack-test (>= 0.6.3)
|
25
25
|
rails-dom-testing (~> 2.0)
|
26
26
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
27
|
-
actionview (5.
|
28
|
-
activesupport (= 5.
|
27
|
+
actionview (5.1.4)
|
28
|
+
activesupport (= 5.1.4)
|
29
29
|
builder (~> 3.1)
|
30
|
-
|
30
|
+
erubi (~> 1.4)
|
31
31
|
rails-dom-testing (~> 2.0)
|
32
32
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
33
|
-
activejob (5.
|
34
|
-
activesupport (= 5.
|
33
|
+
activejob (5.1.4)
|
34
|
+
activesupport (= 5.1.4)
|
35
35
|
globalid (>= 0.3.6)
|
36
|
-
activemodel (5.
|
37
|
-
activesupport (= 5.
|
38
|
-
activerecord (5.
|
39
|
-
activemodel (= 5.
|
40
|
-
activesupport (= 5.
|
41
|
-
arel (~>
|
42
|
-
activesupport (5.
|
36
|
+
activemodel (5.1.4)
|
37
|
+
activesupport (= 5.1.4)
|
38
|
+
activerecord (5.1.4)
|
39
|
+
activemodel (= 5.1.4)
|
40
|
+
activesupport (= 5.1.4)
|
41
|
+
arel (~> 8.0)
|
42
|
+
activesupport (5.1.4)
|
43
43
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
44
44
|
i18n (~> 0.7)
|
45
45
|
minitest (~> 5.1)
|
46
46
|
tzinfo (~> 1.1)
|
47
|
-
arel (
|
47
|
+
arel (8.0.0)
|
48
48
|
builder (3.2.3)
|
49
49
|
coderay (1.1.1)
|
50
50
|
concurrent-ruby (1.0.5)
|
@@ -54,12 +54,13 @@ GEM
|
|
54
54
|
term-ansicolor (~> 1.3)
|
55
55
|
thor (~> 0.19.1)
|
56
56
|
tins (~> 1.6)
|
57
|
+
crass (1.0.2)
|
57
58
|
docile (1.1.5)
|
58
|
-
|
59
|
+
erubi (1.6.1)
|
59
60
|
ffi (1.9.18)
|
60
61
|
formatador (0.2.5)
|
61
|
-
globalid (0.
|
62
|
-
activesupport (>= 4.
|
62
|
+
globalid (0.4.0)
|
63
|
+
activesupport (>= 4.2.0)
|
63
64
|
guard (2.14.1)
|
64
65
|
formatador (>= 0.2.4)
|
65
66
|
listen (>= 2.7, < 4.0)
|
@@ -73,27 +74,28 @@ GEM
|
|
73
74
|
guard-minitest (2.4.6)
|
74
75
|
guard-compat (~> 1.2)
|
75
76
|
minitest (>= 3.0)
|
76
|
-
i18n (0.8.
|
77
|
+
i18n (0.8.6)
|
77
78
|
json (2.0.3)
|
78
79
|
listen (3.1.5)
|
79
80
|
rb-fsevent (~> 0.9, >= 0.9.4)
|
80
81
|
rb-inotify (~> 0.9, >= 0.9.7)
|
81
82
|
ruby_dep (~> 1.2)
|
82
|
-
loofah (2.
|
83
|
+
loofah (2.1.1)
|
84
|
+
crass (~> 1.0.2)
|
83
85
|
nokogiri (>= 1.5.9)
|
84
86
|
lumberjack (1.0.11)
|
85
|
-
mail (2.6.
|
87
|
+
mail (2.6.6)
|
86
88
|
mime-types (>= 1.16, < 4)
|
87
89
|
method_source (0.8.2)
|
88
90
|
mime-types (3.1)
|
89
91
|
mime-types-data (~> 3.2015)
|
90
92
|
mime-types-data (3.2016.0521)
|
91
|
-
mini_portile2 (2.
|
93
|
+
mini_portile2 (2.3.0)
|
92
94
|
minitest (5.10.1)
|
93
95
|
nenv (0.3.0)
|
94
|
-
nio4r (2.
|
95
|
-
nokogiri (1.
|
96
|
-
mini_portile2 (~> 2.
|
96
|
+
nio4r (2.1.0)
|
97
|
+
nokogiri (1.8.1)
|
98
|
+
mini_portile2 (~> 2.3.0)
|
97
99
|
notiffany (0.1.1)
|
98
100
|
nenv (~> 0.1)
|
99
101
|
shellany (~> 0.0)
|
@@ -101,29 +103,29 @@ GEM
|
|
101
103
|
coderay (~> 1.1.0)
|
102
104
|
method_source (~> 0.8.1)
|
103
105
|
slop (~> 3.4)
|
104
|
-
rack (2.0.
|
105
|
-
rack-test (0.
|
106
|
-
rack (>= 1.0)
|
107
|
-
rails (5.
|
108
|
-
actioncable (= 5.
|
109
|
-
actionmailer (= 5.
|
110
|
-
actionpack (= 5.
|
111
|
-
actionview (= 5.
|
112
|
-
activejob (= 5.
|
113
|
-
activemodel (= 5.
|
114
|
-
activerecord (= 5.
|
115
|
-
activesupport (= 5.
|
116
|
-
bundler (>= 1.3.0
|
117
|
-
railties (= 5.
|
106
|
+
rack (2.0.3)
|
107
|
+
rack-test (0.7.0)
|
108
|
+
rack (>= 1.0, < 3)
|
109
|
+
rails (5.1.4)
|
110
|
+
actioncable (= 5.1.4)
|
111
|
+
actionmailer (= 5.1.4)
|
112
|
+
actionpack (= 5.1.4)
|
113
|
+
actionview (= 5.1.4)
|
114
|
+
activejob (= 5.1.4)
|
115
|
+
activemodel (= 5.1.4)
|
116
|
+
activerecord (= 5.1.4)
|
117
|
+
activesupport (= 5.1.4)
|
118
|
+
bundler (>= 1.3.0)
|
119
|
+
railties (= 5.1.4)
|
118
120
|
sprockets-rails (>= 2.0.0)
|
119
|
-
rails-dom-testing (2.0.
|
120
|
-
activesupport (>= 4.2.0
|
121
|
-
nokogiri (
|
121
|
+
rails-dom-testing (2.0.3)
|
122
|
+
activesupport (>= 4.2.0)
|
123
|
+
nokogiri (>= 1.6)
|
122
124
|
rails-html-sanitizer (1.0.3)
|
123
125
|
loofah (~> 2.0)
|
124
|
-
railties (5.
|
125
|
-
actionpack (= 5.
|
126
|
-
activesupport (= 5.
|
126
|
+
railties (5.1.4)
|
127
|
+
actionpack (= 5.1.4)
|
128
|
+
activesupport (= 5.1.4)
|
127
129
|
method_source
|
128
130
|
rake (>= 0.8.7)
|
129
131
|
thor (>= 0.18.1, < 2.0)
|
@@ -142,7 +144,7 @@ GEM
|
|
142
144
|
sprockets (3.7.1)
|
143
145
|
concurrent-ruby (~> 1.0)
|
144
146
|
rack (> 1, < 3)
|
145
|
-
sprockets-rails (3.2.
|
147
|
+
sprockets-rails (3.2.1)
|
146
148
|
actionpack (>= 4.0)
|
147
149
|
activesupport (>= 4.0)
|
148
150
|
sprockets (>= 3.0.0)
|
@@ -151,7 +153,7 @@ GEM
|
|
151
153
|
thor (0.19.4)
|
152
154
|
thread_safe (0.3.6)
|
153
155
|
tins (1.13.2)
|
154
|
-
tzinfo (1.2.
|
156
|
+
tzinfo (1.2.3)
|
155
157
|
thread_safe (~> 0.1)
|
156
158
|
websocket-driver (0.6.5)
|
157
159
|
websocket-extensions (>= 0.1.0)
|
@@ -170,4 +172,4 @@ DEPENDENCIES
|
|
170
172
|
semantic_date_time_tags!
|
171
173
|
|
172
174
|
BUNDLED WITH
|
173
|
-
1.
|
175
|
+
1.14.6
|
@@ -5,6 +5,9 @@ module SemanticDateTimeTags
|
|
5
5
|
class Date < Tag
|
6
6
|
def initialize(obj, options = {})
|
7
7
|
raise 'object must be Date or DateTime' unless [::Date, ::DateTime].any? { |c| obj.instance_of? c }
|
8
|
+
|
9
|
+
options = options.except(*%i(separator))
|
10
|
+
|
8
11
|
super(obj, options)
|
9
12
|
end
|
10
13
|
|
@@ -9,6 +9,7 @@ module SemanticDateTimeTags
|
|
9
9
|
@date_from = date_from
|
10
10
|
@date_to = date_to
|
11
11
|
@options = options
|
12
|
+
@separator = options.delete(:separator) || ' – '
|
12
13
|
end
|
13
14
|
|
14
15
|
# ---------------------------------------------------------------------
|
@@ -68,7 +69,7 @@ module SemanticDateTimeTags
|
|
68
69
|
when ::Date then SemanticDateTimeTags::Tag::Date.new(date_from.to_date, options.merge(class: 'from')).to_html
|
69
70
|
end
|
70
71
|
|
71
|
-
sep = content_tag(:span, separator, class: 'date_range_separator')
|
72
|
+
sep = content_tag(:span, @separator, class: 'date_range_separator')
|
72
73
|
|
73
74
|
to = case date_to
|
74
75
|
when ::DateTime then SemanticDateTimeTags::Tag::DateTime.new(date_to, options.merge(class: 'to')).to_html
|
@@ -77,12 +78,6 @@ module SemanticDateTimeTags
|
|
77
78
|
|
78
79
|
content_tag(:span, class: dom_classes) { [from, sep, to].join.html_safe }.html_safe
|
79
80
|
end
|
80
|
-
|
81
|
-
private # =============================================================
|
82
|
-
|
83
|
-
def separator
|
84
|
-
options.fetch(:separator, ' – ')
|
85
|
-
end
|
86
81
|
end
|
87
82
|
end
|
88
83
|
end
|
@@ -207,6 +207,10 @@ describe SemanticDateTimeTags::ViewHelpers do
|
|
207
207
|
semantic_date_time_range_tag(date_object, date_tomorrow_object).must_match(/class=\".+\s#{I18n.locale}\s.+\"/i)
|
208
208
|
end
|
209
209
|
|
210
|
+
it 'does not include separator attribute' do
|
211
|
+
semantic_date_time_range_tag(date_object, date_tomorrow_object, separator: '–').wont_match(/separator=/)
|
212
|
+
end
|
213
|
+
|
210
214
|
it 'allows to pass :format' do
|
211
215
|
semantic_date_time_range_tag(date_object, date_tomorrow_object, format: :test).must_include '~'
|
212
216
|
semantic_date_time_range_tag(date_object, date_tomorrow_object, format: :test).must_include 'data-format="test"'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: semantic_date_time_tags
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomas Celizna
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -118,6 +118,7 @@ files:
|
|
118
118
|
- ".coveralls.yml"
|
119
119
|
- ".gitignore"
|
120
120
|
- ".travis.yml"
|
121
|
+
- CHANGELOG.md
|
121
122
|
- Gemfile
|
122
123
|
- Gemfile.lock
|
123
124
|
- Guardfile
|
@@ -165,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
165
166
|
version: '0'
|
166
167
|
requirements: []
|
167
168
|
rubyforge_project:
|
168
|
-
rubygems_version: 2.
|
169
|
+
rubygems_version: 2.5.2
|
169
170
|
signing_key:
|
170
171
|
specification_version: 4
|
171
172
|
summary: Rails helpers for handling dates and time.
|