semantic_date_time_tags 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 934300461e0addc97ecc73e8d78011df83995a1c
|
4
|
+
data.tar.gz: 4c151e2b331430f8bbcf8b7eb79d3f094ea179b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9acd12e27af6506a9a8f88cc01e0ad10fed1267de892a00d0191761707da126dbed7b2d0ed7b0d70b9cc9f68cc231dbc38f0386594152939b90eae5838a30e6f
|
7
|
+
data.tar.gz: b17fa62a62b0f293723d9a94ea7fcf8167255073fe901f232d15126fe063381c0e7e0786236434ab9cd03bb4d7932b7a826c76eba7489144df9adb05fc5f20bc
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
semantic_date_time_tags (0.0.
|
4
|
+
semantic_date_time_tags (0.0.6)
|
5
5
|
rails (>= 3.0.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -42,7 +42,7 @@ GEM
|
|
42
42
|
minitest (~> 5.1)
|
43
43
|
thread_safe (~> 0.3, >= 0.3.4)
|
44
44
|
tzinfo (~> 1.1)
|
45
|
-
arel (6.0.
|
45
|
+
arel (6.0.2)
|
46
46
|
builder (3.2.2)
|
47
47
|
celluloid (0.16.0)
|
48
48
|
timers (~> 4.0.0)
|
@@ -46,7 +46,7 @@ module SemanticDateTimeTags
|
|
46
46
|
case comp
|
47
47
|
when /%-?[YCy]/ then ['year', comp[/\w/]]
|
48
48
|
when /%-?[mBbh]/ then ['month', comp[/\w/]]
|
49
|
-
when /%-?[
|
49
|
+
when /%-?[Adej]/ then ['day', comp[/\w/]]
|
50
50
|
when /%-?[HKIl]/ then ['hours', comp[/\w/]]
|
51
51
|
when /%-?[M]/ then ['minutes', comp[/\w/]]
|
52
52
|
when /%-?[p]/ then ['ampm', comp[/\w/]]
|
@@ -15,6 +15,7 @@ module SemanticDateTimeTags
|
|
15
15
|
@obj = obj
|
16
16
|
@tag_name = tag_name
|
17
17
|
@options = options
|
18
|
+
@scope = @options.fetch(:scope, nil)
|
18
19
|
end
|
19
20
|
|
20
21
|
def to_html
|
@@ -30,7 +31,7 @@ module SemanticDateTimeTags
|
|
30
31
|
# ---------------------------------------------------------------------
|
31
32
|
|
32
33
|
def localized_obj
|
33
|
-
I18n.l(@obj, format: :full)
|
34
|
+
I18n.l(@obj, format: :full, scope: @scope)
|
34
35
|
end
|
35
36
|
|
36
37
|
# ---------------------------------------------------------------------
|
@@ -34,5 +34,14 @@ describe SemanticDateTimeTags::FormatParser do
|
|
34
34
|
to_html.must_equal '<span class="hours I">10</span><span class="sep">.</span><span class="minutes M">00</span><span class="sep"> </span><span class="ampm p">AM</span>'
|
35
35
|
end
|
36
36
|
end
|
37
|
+
|
38
|
+
describe 'A d / m / Y' do
|
39
|
+
let(:format) { '%A %d / %m / %Y' }
|
40
|
+
let(:string) { 'Saturday 12 / 12 / 2014' }
|
41
|
+
|
42
|
+
it 'wraps the components into span tags' do
|
43
|
+
to_html.must_equal '<span class="day A">Saturday</span><span class="sep"> </span><span class="day d">12</span><span class="sep"> / </span><span class="month m">12</span><span class="sep"> / </span><span class="year Y">2014</span>'
|
44
|
+
end
|
45
|
+
end
|
37
46
|
end
|
38
47
|
end
|
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.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomas Celizna
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|