prismic.io 1.0.8 → 1.0.9
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/Gemfile.lock +1 -1
- data/lib/prismic/json_parsers.rb +12 -3
- data/lib/prismic/version.rb +1 -1
- data/spec/json_parsers_spec.rb +1 -1
- data/spec/responses_mocks/document.json +2 -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: f497718ba2bd089e57df07768002414936d16b88
|
|
4
|
+
data.tar.gz: ed6c0a61282b5103fa37944d46d404f75d5a54a8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 83a15ad2f3f28020e0c36ca73a330f84e29103a914a190224e6006842d4985a676b9b6c8b9f94d5f040a3e63a280c66e56df04cd3082cb633d0519da8c613b9f
|
|
7
|
+
data.tar.gz: 4c549baab450a23a98f6101587a76e7364f93eff8c56b97a0534f738235a37cc47b8b9eaee8c08217d0bb847a31916e513494df35f96f55b55999e48a2f69e94
|
data/Gemfile.lock
CHANGED
data/lib/prismic/json_parsers.rb
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require 'uri'
|
|
4
|
+
|
|
2
5
|
module Prismic
|
|
3
6
|
module JsonParser
|
|
4
7
|
class << self
|
|
@@ -30,7 +33,7 @@ module Prismic
|
|
|
30
33
|
doc['id'],
|
|
31
34
|
doc['type'],
|
|
32
35
|
doc['tags'],
|
|
33
|
-
doc['slug'],
|
|
36
|
+
URI.unescape(doc['slug']),
|
|
34
37
|
json['value']['isBroken'])
|
|
35
38
|
end
|
|
36
39
|
|
|
@@ -206,8 +209,14 @@ module Prismic
|
|
|
206
209
|
|
|
207
210
|
linked_documents = linked_documents_parser(json['linked_documents'])
|
|
208
211
|
|
|
209
|
-
Prismic::Document.new(
|
|
210
|
-
|
|
212
|
+
Prismic::Document.new(
|
|
213
|
+
json['id'],
|
|
214
|
+
json['type'],
|
|
215
|
+
json['href'],
|
|
216
|
+
json['tags'],
|
|
217
|
+
json['slugs'].map { |slug| URI.unescape(slug) },
|
|
218
|
+
linked_documents,
|
|
219
|
+
fragments)
|
|
211
220
|
end
|
|
212
221
|
|
|
213
222
|
def results_parser(results)
|
data/lib/prismic/version.rb
CHANGED
data/spec/json_parsers_spec.rb
CHANGED
|
@@ -360,7 +360,7 @@ describe 'document_parser' do
|
|
|
360
360
|
@document.type.should == 'product'
|
|
361
361
|
@document.href.should == 'doc-url'
|
|
362
362
|
@document.tags.should == ['Macaron']
|
|
363
|
-
@document.slugs.should == ['vanilla-macaron']
|
|
363
|
+
@document.slugs.should == ['vanilla-macaron', '南大沢']
|
|
364
364
|
end
|
|
365
365
|
|
|
366
366
|
it "correctly parses the document's fragments" do
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: prismic.io
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Étienne Vallette d'Osia
|
|
@@ -11,7 +11,7 @@ authors:
|
|
|
11
11
|
autorequire:
|
|
12
12
|
bindir: bin
|
|
13
13
|
cert_chain: []
|
|
14
|
-
date: 2014-11-
|
|
14
|
+
date: 2014-11-17 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|
|
17
17
|
name: bundler
|