semantic_date_time_tags 0.0.5 → 0.0.6

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: 2975079385f557aa60e14bb78f0b83aaf5afdcf7
4
- data.tar.gz: 84faa5d5976e83fd2abdc6b46d8060ce1c1256b4
3
+ metadata.gz: 934300461e0addc97ecc73e8d78011df83995a1c
4
+ data.tar.gz: 4c151e2b331430f8bbcf8b7eb79d3f094ea179b6
5
5
  SHA512:
6
- metadata.gz: 6a38754927e40af9ad808fc017e0ec5dfea2f27ed7ae3c594bab55a6c3ba34cf9fe98c56e3fb518a4620b3343159ee36231f59b868c03f25d57c084bae39fac1
7
- data.tar.gz: d3e1dfa449ce5a76b97e2858f46f9fd1bc4e4942991a168e993580c51d4e5d7a7721b3adce88306d56383e36521db96f69e0ac9fb0dd7cb96144be298dd47b29
6
+ metadata.gz: 9acd12e27af6506a9a8f88cc01e0ad10fed1267de892a00d0191761707da126dbed7b2d0ed7b0d70b9cc9f68cc231dbc38f0386594152939b90eae5838a30e6f
7
+ data.tar.gz: b17fa62a62b0f293723d9a94ea7fcf8167255073fe901f232d15126fe063381c0e7e0786236434ab9cd03bb4d7932b7a826c76eba7489144df9adb05fc5f20bc
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- semantic_date_time_tags (0.0.5)
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.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 /%-?[dej]/ then ['day', comp[/\w/]]
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
  # ---------------------------------------------------------------------
@@ -1,3 +1,3 @@
1
1
  module SemanticDateTimeTags
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -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.5
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-06-27 00:00:00.000000000 Z
11
+ date: 2015-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails