metamagic 3.0.0.beta3 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/README.md +9 -0
- data/lib/metamagic/renderer.rb +2 -0
- data/lib/metamagic/version.rb +1 -1
- data/test/metamagic_test.rb +6 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51fe3e857376924eb66e388066c0c0b6a26e0ec8
|
4
|
+
data.tar.gz: 76f4eefc651bcf2efa087e9a283db8e747856447
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ad6a68d73ce4b98057ff488618ccec093e2b6cd1a75b4611fc4f80795916b336073f4f206a243e71d64ed843e96b73eb020d3003ea26c354a4a45f8a18671bd
|
7
|
+
data.tar.gz: 87383b4816f9403bdc96daa0e381cb6a6b3616409c0c977c51ed427c0509670918d9453cad3458873c97cfbc7a0ff16c7c071ea2faa841a5ce90aad36fd3b523
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -248,6 +248,15 @@ This will render the following:
|
|
248
248
|
<custom_tag first="custom:key_two" second="My second key" />
|
249
249
|
```
|
250
250
|
|
251
|
+
When you register a new tag type, a shortcut helper is automatically defined. The above could therefore also be written as:
|
252
|
+
|
253
|
+
```erb
|
254
|
+
<%
|
255
|
+
custom key_one: "My first key",
|
256
|
+
key_two: "My second key"
|
257
|
+
%>
|
258
|
+
```
|
259
|
+
|
251
260
|
Requirements
|
252
261
|
------------
|
253
262
|
|
data/lib/metamagic/renderer.rb
CHANGED
@@ -35,6 +35,8 @@ module Metamagic
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def add(hash = {})
|
38
|
+
raise ArgumentError, "Defining meta properties via arrays has been removed in Metamagic v3.0 and replaced by some pretty helpers. Please see the readme at https://github.com/lassebunk/metamagic for more info." if hash.is_a?(Array)
|
39
|
+
|
38
40
|
transform_hash(hash).each do |k, v|
|
39
41
|
klass = self.class.tag_type_for_key(k)
|
40
42
|
tag = if klass.is_a?(Proc)
|
data/lib/metamagic/version.rb
CHANGED
data/test/metamagic_test.rb
CHANGED
@@ -99,4 +99,10 @@ class HelperMethodsTest < ActionView::TestCase
|
|
99
99
|
assert_equal %{<title>My Title</title>\n<meta content="one, two, three" name="keywords" />\n<meta content="My description." name="description" />\n<meta content="http://test.com/image.png" property="og:image" />\n<meta content="summary" property="twitter:card" />},
|
100
100
|
metamagic
|
101
101
|
end
|
102
|
+
|
103
|
+
test "old property definition" do
|
104
|
+
assert_raises ArgumentError do
|
105
|
+
meta [:property => "og:image", :content => "http://mydomain.com/images/my_image.jpg"]
|
106
|
+
end
|
107
|
+
end
|
102
108
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metamagic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.0
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lasse Bunk
|
@@ -118,9 +118,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
118
118
|
version: '0'
|
119
119
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
120
|
requirements:
|
121
|
-
- - "
|
121
|
+
- - ">="
|
122
122
|
- !ruby/object:Gem::Version
|
123
|
-
version:
|
123
|
+
version: '0'
|
124
124
|
requirements: []
|
125
125
|
rubyforge_project:
|
126
126
|
rubygems_version: 2.2.1
|