semantic_date_time_tags 0.1.16 → 0.1.18

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6312925ee44e3f19a3cc43667234383e4ff94f6e
4
- data.tar.gz: 7e5216ba936def1f2c6008d4aaeb2adbd75dff60
3
+ metadata.gz: 1c20d269f312b59d4fbe3f925ea9878228bb0861
4
+ data.tar.gz: d000cff436dc9d5c2a1bbe3b773386411084ab7d
5
5
  SHA512:
6
- metadata.gz: eb6e01fb0305336df88b0dcf96723bf9cb17868066c3694b48d0a7fa2611ec744ad17de4bbcfc7635a29652ceefec6b7ed2a998c1756bd97c4c39c3ed88ec7aa
7
- data.tar.gz: 3727825770e022a75345b1b8605f49b300a9bc5daf851268521b95522da4846cbb03886d08182a18f6119184d6101e04f0f7b9ecd9ed4509f6476672d56c0181
6
+ metadata.gz: e80126f88f83a8572d12158c5d6cfa3d7e14eaf6b44cd9cd3d18611df72aa4e5339f04ff7df42e3d346f6fae3091c797096a4eb1ffb71bb6180e41ec5ea02ee3
7
+ data.tar.gz: d7cb59136ca69351eb869cfbb0708e7e58a3d1a07f8a1f2b249b235477c6c43bf19d8e4f3a4c1684bbbfd945c60c4b7514d80574c8048c3128ab6adfe8ae0475
@@ -0,0 +1,5 @@
1
+ # CHANGELOG
2
+
3
+ ## 0.1.18
4
+
5
+ * removed `:separator` from options passed to the `time` tag (in effect producing invalid HTML)
@@ -1,50 +1,50 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- semantic_date_time_tags (0.1.16)
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.0.2)
11
- actionpack (= 5.0.2)
12
- nio4r (>= 1.2, < 3.0)
10
+ actioncable (5.1.4)
11
+ actionpack (= 5.1.4)
12
+ nio4r (~> 2.0)
13
13
  websocket-driver (~> 0.6.1)
14
- actionmailer (5.0.2)
15
- actionpack (= 5.0.2)
16
- actionview (= 5.0.2)
17
- activejob (= 5.0.2)
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.0.2)
21
- actionview (= 5.0.2)
22
- activesupport (= 5.0.2)
20
+ actionpack (5.1.4)
21
+ actionview (= 5.1.4)
22
+ activesupport (= 5.1.4)
23
23
  rack (~> 2.0)
24
- rack-test (~> 0.6.3)
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.0.2)
28
- activesupport (= 5.0.2)
27
+ actionview (5.1.4)
28
+ activesupport (= 5.1.4)
29
29
  builder (~> 3.1)
30
- erubis (~> 2.7.0)
30
+ erubi (~> 1.4)
31
31
  rails-dom-testing (~> 2.0)
32
32
  rails-html-sanitizer (~> 1.0, >= 1.0.3)
33
- activejob (5.0.2)
34
- activesupport (= 5.0.2)
33
+ activejob (5.1.4)
34
+ activesupport (= 5.1.4)
35
35
  globalid (>= 0.3.6)
36
- activemodel (5.0.2)
37
- activesupport (= 5.0.2)
38
- activerecord (5.0.2)
39
- activemodel (= 5.0.2)
40
- activesupport (= 5.0.2)
41
- arel (~> 7.0)
42
- activesupport (5.0.2)
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 (7.1.4)
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
- erubis (2.7.0)
59
+ erubi (1.6.1)
59
60
  ffi (1.9.18)
60
61
  formatador (0.2.5)
61
- globalid (0.3.7)
62
- activesupport (>= 4.1.0)
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.1)
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.0.3)
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.4)
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.1.0)
93
+ mini_portile2 (2.3.0)
92
94
  minitest (5.10.1)
93
95
  nenv (0.3.0)
94
- nio4r (2.0.0)
95
- nokogiri (1.7.0.1)
96
- mini_portile2 (~> 2.1.0)
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.1)
105
- rack-test (0.6.3)
106
- rack (>= 1.0)
107
- rails (5.0.2)
108
- actioncable (= 5.0.2)
109
- actionmailer (= 5.0.2)
110
- actionpack (= 5.0.2)
111
- actionview (= 5.0.2)
112
- activejob (= 5.0.2)
113
- activemodel (= 5.0.2)
114
- activerecord (= 5.0.2)
115
- activesupport (= 5.0.2)
116
- bundler (>= 1.3.0, < 2.0)
117
- railties (= 5.0.2)
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.2)
120
- activesupport (>= 4.2.0, < 6.0)
121
- nokogiri (~> 1.6)
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.0.2)
125
- actionpack (= 5.0.2)
126
- activesupport (= 5.0.2)
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.0)
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.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.13.6
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
@@ -5,6 +5,9 @@ module SemanticDateTimeTags
5
5
  class DateTime < Tag
6
6
  def initialize(obj, options = {})
7
7
  raise 'object must be DateTime' unless obj.instance_of?(::DateTime)
8
+
9
+ options = options.except(*%i(separator))
10
+
8
11
  super(obj, options)
9
12
  end
10
13
 
@@ -1,3 +1,3 @@
1
1
  module SemanticDateTimeTags
2
- VERSION = '0.1.16'.freeze
2
+ VERSION = '0.1.18'.freeze
3
3
  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.16
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-03-04 00:00:00.000000000 Z
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.4.5.1
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.