timepiece 0.1.3 → 0.1.4
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 +4 -4
- data/README.rdoc +9 -9
- data/app/helpers/timepiece_helper.rb +1 -1
- data/lib/timepiece/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00d04eb51d95ea9b19d0d02120678ffbf08c4300
|
4
|
+
data.tar.gz: 61315b891b0976f674463dde577b35cdd44527ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f983ed67e5c5690690965cc7cd3948f98d87e26871590cba02841287766a9105c1bfab2579f2d3d076eacf468c92dfdf0d1ee1ad7e25510eb478e200188c14dc
|
7
|
+
data.tar.gz: ec3842e177315b3e1d6871f3c4afa80785057caea92cc6bfb5b961399d6882483779b5fa23ce3f80a4f0b530ba0886ab2e130e060621d1ac125a0fe393330fb5
|
data/README.rdoc
CHANGED
@@ -24,30 +24,30 @@ Timepiece is a Rails plugin providing a simple digital clock, accurate to your s
|
|
24
24
|
|
25
25
|
<%= timepiece('London') %>
|
26
26
|
|
27
|
-
* Show a 12 hour clock by specifying
|
27
|
+
* Show a 12 hour clock by specifying its `type:` explicitly
|
28
28
|
|
29
|
-
<%= timepiece('London', '12') %>
|
29
|
+
<%= timepiece('London', type: '12') %>
|
30
30
|
|
31
|
-
By default the 12 hour clock displays time without any leading character, in the format '1:23pm'. You can add either a zero, as present on the 24 hour clock, or a leading space character the size of a numerical digit - useful for keeping your clocks aligned.
|
31
|
+
By default the 12 hour clock displays time without any leading character, in the format '1:23pm'. You can add either a zero, as present on the 24 hour clock, or a leading space character the size of a numerical digit - useful for keeping your clocks aligned. To achieve this, set the Timepiece's `lead:`
|
32
32
|
|
33
33
|
* To add a leading zero to hour values less than ten
|
34
34
|
|
35
|
-
<%= timepiece('London',
|
35
|
+
<%= timepiece('London', lead: '0') %>
|
36
36
|
|
37
37
|
or
|
38
38
|
|
39
|
-
<%= timepiece('London',
|
39
|
+
<%= timepiece('London', lead: 'zero') %>
|
40
40
|
|
41
41
|
* To add a space character
|
42
42
|
|
43
|
-
<%= timepiece('London',
|
43
|
+
<%= timepiece('London', lead: '_') %>
|
44
44
|
|
45
45
|
or
|
46
46
|
|
47
|
-
<%= timepiece('London',
|
47
|
+
<%= timepiece('London', lead: 'space') %>
|
48
48
|
|
49
|
-
You can apply your own styles to any part of the Timepiece clock. For instance, you can capitalize the AM/PM abbreviation by targeting the span with class 'timepiece-abbr'. By default, the abbreviations are displayed without punctuation. To add punctuation, you can specify it
|
49
|
+
You can apply your own styles to any part of the Timepiece clock. For instance, you can capitalize the AM/PM abbreviation by targeting the span with class 'timepiece-abbr'. By default, the abbreviations are displayed without punctuation. To add punctuation, you can specify it with the `abbr_sep:` option.
|
50
50
|
|
51
51
|
* Add punctuation to am/pm abbreviation
|
52
52
|
|
53
|
-
<%= timepiece('London',
|
53
|
+
<%= timepiece('London', abbr_sep: '.') %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module TimepieceHelper
|
2
|
-
def timepiece(location = 'UTC', type
|
2
|
+
def timepiece(location = 'UTC', type: '24', lead: 'none', abbr_sep: 'none')
|
3
3
|
Time.zone = location
|
4
4
|
hours = Time.now.in_time_zone.strftime('%H')
|
5
5
|
minutes = Time.now.in_time_zone.strftime('%M')
|
data/lib/timepiece/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timepiece
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thom Bruce
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jquery-rails
|