item 0.0.4 → 0.0.5

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: f659a6a1b8a33fbe1c3b78fb764927699ce50dd1
4
- data.tar.gz: d1f938c0a4a94e67044e6ffb0a48846f91c2b992
3
+ metadata.gz: 896e577ff1509ed63b85717b0629b16d202253b7
4
+ data.tar.gz: 805b031c703dfedf62692c3442c06ec7e6df594e
5
5
  SHA512:
6
- metadata.gz: f9e50b82f80724ae893663fb0616522c28ed326d8cd37f774f313c43c7a2de8fda7305ff5b07b3eb669b0acb3404da9f166af45a9e439b8cde999c0bda4ca4a0
7
- data.tar.gz: 0105194be5e2f59c2913d4f83f14157545ab22331413a69e717d4bd10a715760f7cd349613353d751e69e803dab205637ab493fb482245be46ae94dcb1eb888e
6
+ metadata.gz: ca45cbaf092ec7d9a830e604e06022c0393e28d19b613c73d2990f9fae28537c9ba4393ca8960de1da872fd59044f8fc04f03fbdf174bbeed8f0cf1c9f30c038
7
+ data.tar.gz: d57f6be3192403b90e1be271757e808682c0ce43696bb485f69adee389eee82915aff96a65513194d7a6d8943b2ebc68f18730942c05fded31769dae42d3eb90
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ### 0.0.5
4
+
5
+ * Set itemscope attribute explicitly for backwards Rails compatibility
6
+
3
7
  ### 0.0.4
4
8
 
5
9
  * Support passing options to `scope` and `prop`, like `:tag` and `:class`
@@ -1,3 +1,3 @@
1
1
  module Item
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -2,7 +2,7 @@ module Item
2
2
  module ViewHelpers
3
3
  def scope(key, options = {}, &block)
4
4
  tag = options.delete(:tag) || :div
5
- tag_options = { itemscope: true, itemtype: Util.itemtype(key) }.merge(options)
5
+ tag_options = { itemscope: "itemscope", itemtype: Util.itemtype(key) }.merge(options)
6
6
  content_tag(tag, tag_options, &block)
7
7
  end
8
8
 
@@ -24,7 +24,7 @@ module Item
24
24
  if block
25
25
  tag = options.delete(:tag) || :div
26
26
  itemtype = Util.itemtype(options.delete(:type) || key)
27
- tag_options = { itemprop: itemprop, itemscope: true, itemtype: itemtype }.merge(options)
27
+ tag_options = { itemprop: itemprop, itemscope: "itemscope", itemtype: itemtype }.merge(options)
28
28
  content_tag(tag, tag_options, &block)
29
29
  else
30
30
  tag = options.delete(:tag) || :span
@@ -36,9 +36,9 @@ class ViewHelpersTest < ActionView::TestCase
36
36
  end
37
37
 
38
38
  test "hidden prop" do
39
- content = prop(aggregate_rating: "Rating content", title: "Title content")
39
+ content = prop(aggregate_rating: "Rating content", availability: :in_stock)
40
40
 
41
- assert_equal %{<meta content="Rating content" itemprop="aggregateRating" />\n<meta content="Title content" itemprop="title" />},
41
+ assert_equal %{<meta content="Rating content" itemprop="aggregateRating" />\n<link href="http://schema.org/InStock" itemprop="availability" />},
42
42
  content
43
43
  end
44
44
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: item
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lasse Bunk