prismic.io 1.0.8 → 1.0.9

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: c7f2d0b0ba3d6766562edf42e7538f6ea33511a4
4
- data.tar.gz: a372c1dcdcfd3e4c45309335b6ead48a1e40b390
3
+ metadata.gz: f497718ba2bd089e57df07768002414936d16b88
4
+ data.tar.gz: ed6c0a61282b5103fa37944d46d404f75d5a54a8
5
5
  SHA512:
6
- metadata.gz: a4405dddff6efff77e345c58fbe95f3487d6ff5654526a2e2c855e89f8198f38792b11f07e2a881404b196b22027177f062377774de7322508323f2a6ff71fa9
7
- data.tar.gz: e72e6fbd322acfb9d635b1339b24dc265769bb3cafe7d4774359722cbf668612c8a5b5e91688c1958c47fd6593f5a12ef0e97e50b4c517aad3723dd6b300dbd7
6
+ metadata.gz: 83a15ad2f3f28020e0c36ca73a330f84e29103a914a190224e6006842d4985a676b9b6c8b9f94d5f040a3e63a280c66e56df04cd3082cb633d0519da8c613b9f
7
+ data.tar.gz: 4c549baab450a23a98f6101587a76e7364f93eff8c56b97a0534f738235a37cc47b8b9eaee8c08217d0bb847a31916e513494df35f96f55b55999e48a2f69e94
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- prismic.io (1.0.8)
4
+ prismic.io (1.0.9)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -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(json['id'], json['type'], json['href'], json['tags'],
210
- json['slugs'], linked_documents, fragments)
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)
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  module Prismic
3
3
 
4
- VERSION = '1.0.8'
4
+ VERSION = '1.0.9'
5
5
 
6
6
  end
@@ -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
@@ -6,7 +6,8 @@
6
6
  "Macaron"
7
7
  ],
8
8
  "slugs": [
9
- "vanilla-macaron"
9
+ "vanilla-macaron",
10
+ "%E5%8D%97%E5%A4%A7%E6%B2%A2"
10
11
  ],
11
12
  "data": {
12
13
  "product": {
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.8
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 00:00:00.000000000 Z
14
+ date: 2014-11-17 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler