timepiece 0.1.11 → 0.1.12

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: f09636ed48c70100cc202344fc32f3adac95af18
4
- data.tar.gz: f4f137ad27e5cb1feb6650956fbb4088ca6d05a4
3
+ metadata.gz: 4011a52353edd24eb8f23f78304aec8dd6d07b93
4
+ data.tar.gz: a5df48bc631f9b27564bdd0a9d603f95880db673
5
5
  SHA512:
6
- metadata.gz: fdb95e64628c38163014d7996f64cba15746adf748020e65bfa7019da1fedc2c9eeac105ccbba5c811fffaab66e5cce4911dbddcb63620847920b830330f466e
7
- data.tar.gz: ed01e22633bbe9e315aba8bf55491053257ca3cb7b94522158666b034e8d28c6b7f6c79caf9f0cccf78233ed11396bc8d3bb298c2eb9535cdaf66d097f30c712
6
+ metadata.gz: ca13f3397694238ec9a55e32caf22299c8e60b1c57f8196515cbe94779b43bafd9f7f507e9006e497714bb344af0eb35d36c2caf8854ef6b9de0c9842253c689
7
+ data.tar.gz: a8d991df7a968ab69141b51d283e2b81a3b5f45fecfeb31e59a128e0ee63e5371ff0555eed3fa006ec78b40813be78496525b15977520de370b0f74c136e4036
@@ -1,5 +1,6 @@
1
1
  module TimepieceHelper
2
2
  def timepiece(location = 'UTC', type: '24', lead: 'none', abbr_sep: 'none', id: '')
3
+ # Note: On the inclusion of IDs, you should /not/ display them if none is given - HTML compliance.
3
4
  Time.zone = location
4
5
  hours = Time.now.in_time_zone.strftime('%H')
5
6
  minutes = Time.now.in_time_zone.strftime('%M')
@@ -36,7 +37,7 @@ module TimepieceHelper
36
37
  if type == '12'
37
38
  time = time + "<span class='timepiece-abbr timepiece-abbr-#{var}'>#{var}</span>"
38
39
  end
39
- content_tag(:span, time.html_safe, class: 'timepiece', 'data-timezone' => location, 'data-tptype' => type, 'data-lead' => lead, 'data-abbr_separator' => abbr_sep, 'id' => id)
40
+ content_tag(:span, time.html_safe, class: 'timepiece', 'data-timezone' => location, 'data-tptype' => type, 'data-lead' => lead, 'data-abbr_separator' => abbr_sep, 'id' => (id unless id.blank?))
40
41
  end
41
42
 
42
43
  def timer(time_since = Time.now, id: '')
@@ -63,7 +64,7 @@ module TimepieceHelper
63
64
  "<span class='timepiece-descriptor tp-descriptor-seconds'> seconds </span>"
64
65
  # "<span class='timepiece-seconds'>#{seconds.to_s.rjust(2, '0')}</span>" # Note: rjust; it might be useful.
65
66
 
66
- content_tag(:span, time.html_safe, class: 'timepiece-timer', 'data-days' => days, 'data-hours' => hours, 'data-minutes' => minutes, 'data-seconds' => seconds, 'id' => id)
67
+ content_tag(:span, time.html_safe, class: 'timepiece-timer', 'data-days' => days, 'data-hours' => hours, 'data-minutes' => minutes, 'data-seconds' => seconds, 'id' => (id unless id.blank?))
67
68
  end
68
69
 
69
70
  def countdown(time_until = Time.new(2016), id: '')
@@ -90,6 +91,6 @@ module TimepieceHelper
90
91
  "<span class='timepiece-descriptor tp-descriptor-seconds'> seconds </span>"
91
92
  # "<span class='timepiece-seconds'>#{seconds.to_s.rjust(2, '0')}</span>" # Note: rjust; it might be useful.
92
93
 
93
- content_tag(:span, time.html_safe, class: 'timepiece-countdown', 'data-days' => days, 'data-hours' => hours, 'data-minutes' => minutes, 'data-seconds' => seconds, 'id' => id)
94
+ content_tag(:span, time.html_safe, class: 'timepiece-countdown', 'data-days' => days, 'data-hours' => hours, 'data-minutes' => minutes, 'data-seconds' => seconds, 'id' => (id unless id.blank?))
94
95
  end
95
96
  end
@@ -1,3 +1,3 @@
1
1
  module Timepiece
2
- VERSION = "0.1.11"
2
+ VERSION = "0.1.12"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timepiece
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thom Bruce