prismic.io 1.3.3 → 1.3.4

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: 7cbde76204856e505b82ac45adb61cd68702f09c
4
- data.tar.gz: 7c21ecbbc04606fa9a82aab31759b2cdeaa711ee
3
+ metadata.gz: c7dfa484c60b5ed88daaabf4f9343c86e5c35a8b
4
+ data.tar.gz: a730877b1e1bc65835d62d991ac94cdc7908626f
5
5
  SHA512:
6
- metadata.gz: 0968b9132d8ed2bfa9bd23be6d04b12d55437d5a92d7e24785a18b9c3da7c77e514cda73d7eca02a27979660c1c0d89010304f2dcc485881e09208628bc91edf
7
- data.tar.gz: 32bbfee438edd7be035268c889e5f0afd927659cc4726b036864f2ec9cb131b3de240aadcd377ada5912bc42c6c633ef14890f36e482131d9c04e1799c0b1786
6
+ metadata.gz: 215855a35082376fef3d9cb28099d86bd02d3f01789fe90eac9adf17ea0bbe85105480f1a3d7dcfab15828d200cc291afcf6813fd2684c097cbfa9a3b7dff755
7
+ data.tar.gz: ae6797087e10dc0dfd2b2fef328f6703b0ad42c7ad8cfb75a0fd8df3884fef4078af0ed8ed429c93aa53402e3210c600cef8bb6f258e2eb950092cc704a84141
data/lib/prismic/api.rb CHANGED
@@ -14,7 +14,7 @@ module Prismic
14
14
  attr_accessor :refs
15
15
  # @return [Hash{String => String}] list of bookmarks, as name -> documentId
16
16
  attr_accessor :bookmarks
17
- # @return [Hash{String => SearchForm}] list of bookmarks, as name -> documentId
17
+ # @return [Hash{String => Form}] list of forms, as name -> Form
18
18
  attr_accessor :forms
19
19
  attr_accessor :tags, :types, :oauth, :cache
20
20
  # @return [Experiments] list of all experiments from Prismic
@@ -0,0 +1,20 @@
1
+ # encoding: utf-8
2
+ module Prismic
3
+ module Fragments
4
+ class Separator < Fragment
5
+ attr_accessor :value
6
+
7
+ def initialize(value)
8
+ @value = value
9
+ end
10
+
11
+ def as_html(link_resolver=nil)
12
+ %(<hr class="separator" />)
13
+ end
14
+
15
+ def as_text
16
+ @value
17
+ end
18
+ end
19
+ end
20
+ end
@@ -14,3 +14,4 @@ require 'prismic/fragments/structured_text'
14
14
  require 'prismic/fragments/text'
15
15
  require 'prismic/fragments/timestamp'
16
16
  require 'prismic/fragments/slices'
17
+ require 'prismic/fragments/separator'
@@ -17,14 +17,15 @@ module Prismic
17
17
  'Timestamp' => method(:timestamp_parser),
18
18
  'Number' => method(:number_parser),
19
19
  'Embed' => method(:embed_parser),
20
- 'GeoPoint' => method(:geo_point_parser),
20
+ 'GeoPoint' => method(:geo_point_parser),
21
21
  'Image' => method(:image_parser),
22
22
  'Color' => method(:color_parser),
23
23
  'StructuredText' => method(:structured_text_parser),
24
24
  'Select' => method(:select_parser),
25
25
  'Multiple' => method(:multiple_parser),
26
26
  'Group' => method(:group_parser),
27
- 'SliceZone' => method(:slices_parser)
27
+ 'SliceZone' => method(:slices_parser),
28
+ 'Separator' => method(:separator_parser)
28
29
  }
29
30
  end
30
31
 
@@ -63,6 +64,10 @@ module Prismic
63
64
  Prismic::Fragments::Text.new(json['value'])
64
65
  end
65
66
 
67
+ def separator_parser(json)
68
+ Prismic::Fragments::Separator.new('')
69
+ end
70
+
66
71
  def select_parser(json)
67
72
  Prismic::Fragments::Text.new(json['value'])
68
73
  end
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  module Prismic
3
3
 
4
- VERSION = '1.3.3'
4
+ VERSION = '1.3.4'
5
5
 
6
6
  end
data/spec/doc_spec.rb CHANGED
@@ -153,7 +153,7 @@ describe 'Documentation' do
153
153
  # Most of the time you will be using the "main" view
154
154
  url = image.main.url
155
155
  # endgist
156
- url.should == 'https://lesbonneschoses.cdn.prismic.io/lesbonneschoses/f606ad513fcc2a73b909817119b84d6fd0d61a6d.png'
156
+ url.should == 'https://d2aw36oac6sa9o.cloudfront.net/lesbonneschoses/f606ad513fcc2a73b909817119b84d6fd0d61a6d.png'
157
157
  end
158
158
 
159
159
  it 'date and timestamp' do
@@ -712,8 +712,8 @@ describe 'Slices' do
712
712
  end
713
713
 
714
714
  it 'parses correctly' do
715
- @slices.as_text.should == "\nc'est un bloc features\nC'est un bloc content"
716
- @slices.as_html(@link_resolver).gsub('&#39;', "'").should == %[<div data-slicetype="features" class="slice features-label"><section data-field="illustration"><img src="https://wroomdev.s3.amazonaws.com/toto/db3775edb44f9818c54baa72bbfc8d3d6394b6ef_hsf_evilsquall.jpg" alt="" width="4285" height="709" /></section>\n<section data-field="title"><span class="text">c'est un bloc features</span></section></div>\n<div data-slicetype="text" class="slice"><p>C'est un bloc content</p></div>]
715
+ @slices.as_text.should == "\nc'est un bloc features\nC'est un bloc content\n"
716
+ @slices.as_html(@link_resolver).gsub('&#39;', "'").should == %[<div data-slicetype="features" class="slice features-label"><section data-field="illustration"><img src="https://wroomdev.s3.amazonaws.com/toto/db3775edb44f9818c54baa72bbfc8d3d6394b6ef_hsf_evilsquall.jpg" alt="" width="4285" height="709" /></section>\n<section data-field="title"><span class="text">c'est un bloc features</span></section></div>\n<div data-slicetype="text" class="slice"><p>C'est un bloc content</p></div>\n<div data-slicetype="separator" class="slice"><section data-field="sep"><hr class="separator" /></section></div>]
717
717
  end
718
718
 
719
719
  end
@@ -51,7 +51,7 @@ describe 'LesBonnesChoses' do
51
51
  documents.results_size.should == 20
52
52
  documents.total_results_size.should == 40
53
53
  documents.total_pages.should == 2
54
- documents.next_page.should == 'https://lesbonneschoses.cdn.prismic.io/api/documents/search?ref=UlfoxUnM08QWYXdl&page=2&pageSize=20'
54
+ documents.next_page.should == 'https://d2aw36oac6sa9o.cloudfront.net/api/documents/search?ref=UlfoxUnM08QWYXdl&page=2&pageSize=20'
55
55
  documents.prev_page.should == nil
56
56
  end
57
57
  it 'works when passing nil' do
@@ -61,7 +61,7 @@ describe 'LesBonnesChoses' do
61
61
  documents.results_size.should == 20
62
62
  documents.total_results_size.should == 40
63
63
  documents.total_pages.should == 2
64
- documents.next_page.should == 'https://lesbonneschoses.cdn.prismic.io/api/documents/search?ref=UlfoxUnM08QWYXdl&page=2&pageSize=20'
64
+ documents.next_page.should == 'https://d2aw36oac6sa9o.cloudfront.net/api/documents/search?ref=UlfoxUnM08QWYXdl&page=2&pageSize=20'
65
65
  documents.prev_page.should == nil
66
66
  end
67
67
  it 'works on page 2' do
@@ -72,7 +72,7 @@ describe 'LesBonnesChoses' do
72
72
  documents.total_results_size.should == 40
73
73
  documents.total_pages.should == 2
74
74
  documents.next_page.should == nil
75
- documents.prev_page.should == 'https://lesbonneschoses.cdn.prismic.io/api/documents/search?ref=UlfoxUnM08QWYXdl&page=1&pageSize=20'
75
+ documents.prev_page.should == 'https://d2aw36oac6sa9o.cloudfront.net/api/documents/search?ref=UlfoxUnM08QWYXdl&page=1&pageSize=20'
76
76
  end
77
77
  it 'works on page 2 with a pagination step of 10' do
78
78
  documents = @api.form('everything').page('2').page_size('10').submit(@master_ref)
@@ -81,8 +81,8 @@ describe 'LesBonnesChoses' do
81
81
  documents.results_size.should == 10
82
82
  documents.total_results_size.should == 40
83
83
  documents.total_pages.should == 4
84
- documents.next_page.should == 'https://lesbonneschoses.cdn.prismic.io/api/documents/search?ref=UlfoxUnM08QWYXdl&page=3&pageSize=10'
85
- documents.prev_page.should == 'https://lesbonneschoses.cdn.prismic.io/api/documents/search?ref=UlfoxUnM08QWYXdl&page=1&pageSize=10'
84
+ documents.next_page.should == 'https://d2aw36oac6sa9o.cloudfront.net/api/documents/search?ref=UlfoxUnM08QWYXdl&page=3&pageSize=10'
85
+ documents.prev_page.should == 'https://d2aw36oac6sa9o.cloudfront.net/api/documents/search?ref=UlfoxUnM08QWYXdl&page=1&pageSize=10'
86
86
  end
87
87
  it 'works when passing nil' do
88
88
  documents = @api.form('everything').page(nil).submit(@master_ref)
@@ -91,7 +91,7 @@ describe 'LesBonnesChoses' do
91
91
  documents.results_size.should == 20
92
92
  documents.total_results_size.should == 40
93
93
  documents.total_pages.should == 2
94
- documents.next_page.should == 'https://lesbonneschoses.cdn.prismic.io/api/documents/search?ref=UlfoxUnM08QWYXdl&page=2&pageSize=20'
94
+ documents.next_page.should == 'https://d2aw36oac6sa9o.cloudfront.net/api/documents/search?ref=UlfoxUnM08QWYXdl&page=2&pageSize=20'
95
95
  documents.prev_page.should == nil
96
96
  end
97
97
  end
@@ -169,7 +169,7 @@ describe 'LesBonnesChoses' do
169
169
  "<p>A lot of people touch base with us to know about one of our key ingredients, and the essential role it plays in our creations: ganache.</p>\n\n"\
170
170
  "<p>Indeed, ganache is the macaron's softener, or else, macarons would be but tough biscuits; it is the cupcake's wrapper, or else, cupcakes would be but plain old cake. We even sometimes use ganache within our cupcakes, to soften the cake itself, or as a support to our pies' content.</p>\n\n"\
171
171
  "<h2>How to approach ganache</h2>\n\n"\
172
- "<p class=\"block-img\"><img src=\"https://lesbonneschoses.cdn.prismic.io/lesbonneschoses/ee7b984b98db4516aba2eabd54ab498293913c6c.jpg\" alt=\"\" width=\"640\" height=\"425\" /></p>\n\n"\
172
+ "<p class=\"block-img\"><img src=\"https://d2aw36oac6sa9o.cloudfront.net/lesbonneschoses/ee7b984b98db4516aba2eabd54ab498293913c6c.jpg\" alt=\"\" width=\"640\" height=\"425\" /></p>\n\n"\
173
173
  "<p>Apart from the taste balance, which is always a challenge when it comes to pastry, the tough part about ganache is about thickness. It is even harder to predict through all the phases the ganache gets to meet (how long will it get melted? how long will it remain in the fridge?). "\
174
174
  "Things get a hell of a lot easier to get once you consider that there are two main ways to get the perfect ganache:</p>\n\n"\
175
175
  "<ul><li><strong>working from the top down</strong>: start with a thick, almost hard material, and soften it by manipulating it, or by mixing it with a more liquid ingredient (like milk)</li>"\
@@ -191,7 +191,7 @@ describe 'LesBonnesChoses' do
191
191
  "<p>As a child, Jean-Michel Pastranova learned the art of fine cuisine from his grand-father, Jacques Pastranova, who was the creator of the &quot;taste-design&quot; art current, and still today an unmissable reference of forward-thinking in cuisine. At first an assistant in his grand-father's kitchen, Jean-Michel soon found himself fascinated by sweet flavors and the tougher art of pastry, drawing his own path in the ever-changing cuisine world.</p>\n\n"\
192
192
  "<p>In 1992, the first Les Bonnes Choses store opened on rue Saint-Lazare, in Paris (<a href=\"http://localhost/UlfoxUnM0wkXYXbb\">we're still there!</a>), much to everyone's surprise; indeed, back then, it was very surprising for a highly promising young man with a preordained career as a restaurant chef, to open a pastry shop instead. But soon enough, contemporary chefs understood that Jean-Michel had the drive to redefine a new nobility to pastry, the same way many other kinds of cuisine were being qualified as &quot;fine&quot;.</p>\n\n"\
193
193
  "<p>In 1996, meeting an overwhelming demand, Jean-Michel Pastranova opened <a href=\"http://localhost/UlfoxUnM0wkXYXbP\">a second shop on Paris's Champs-Élysées</a>, and <a href=\"http://localhost/UlfoxUnM0wkXYXbr\">a third one in London</a>, the same week! Eventually, Les Bonnes Choses gained an international reputation as &quot;a perfection so familiar and new at the same time, that it will feel like a taste travel&quot; (New York Gazette), &quot;the finest balance between surprise and comfort, enveloped in sweetness&quot; (The Tokyo Tribune), &quot;a renewal of the pastry genre (...), the kind that changed the way pastry is approached globally&quot; (The San Francisco Gourmet News). Therefore, it was only a matter of time before Les Bonnes Choses opened shops in <a href=\"http://localhost/UlfoxUnM0wkXYXbc\">New York</a> (2000) and <a href=\"http://localhost/UlfoxUnM0wkXYXbU\">Tokyo</a> (2004).</p>\n\n"\
194
- "<p>In 2013, Jean-Michel Pastranova stepped down as the CEO and Director of Workshops, remaining a senior advisor to the board and to the workshop artists; he passed the light on to Selena, his daugther, who initially learned the art of pastry from him. Passion for great food runs in the Pastranova family...</p>\n\n<img src=\"https://lesbonneschoses.cdn.prismic.io/lesbonneschoses/df6c1d87258a5bfadf3479b163fd85c829a5c0b8.jpg\" alt=\"\" width=\"800\" height=\"533\" />\n\n"\
194
+ "<p>In 2013, Jean-Michel Pastranova stepped down as the CEO and Director of Workshops, remaining a senior advisor to the board and to the workshop artists; he passed the light on to Selena, his daugther, who initially learned the art of pastry from him. Passion for great food runs in the Pastranova family...</p>\n\n<img src=\"https://d2aw36oac6sa9o.cloudfront.net/lesbonneschoses/df6c1d87258a5bfadf3479b163fd85c829a5c0b8.jpg\" alt=\"\" width=\"800\" height=\"533\" />\n\n"\
195
195
  "<h2>Our main value: our customers' delight</h2>\n\n"\
196
196
  "<p>Our every action is driven by the firm belief that there is art in pastry, and that this art is one of the dearest pleasures one can experience.</p>\n\n"\
197
197
  "<p>At Les Bonnes Choses, people preparing your macarons are not simply &quot;pastry chefs&quot;: they are &quot;<a href=\"http://localhost/UlfoxUnM0wkXYXba\">ganache specialists</a>&quot;, &quot;<a href=\"http://localhost/UlfoxUnM0wkXYXbQ\">fruit experts</a>&quot;, or &quot;<a href=\"http://localhost/UlfoxUnM0wkXYXbn\">oven instrumentalists</a>&quot;. They are the best people out there to perform the tasks they perform to create your pastry, giving it the greatest value. And they just love to make their specialized pastry skill better and better until perfection.</p>\n\n"\
@@ -207,7 +207,7 @@ describe 'LesBonnesChoses' do
207
207
  "<p>As a child, Jean-Michel Pastranova learned the art of fine cuisine from his grand-father, Jacques Pastranova, who was the creator of the &quot;taste-design&quot; art current, and still today an unmissable reference of forward-thinking in cuisine. At first an assistant in his grand-father's kitchen, Jean-Michel soon found himself fascinated by sweet flavors and the tougher art of pastry, drawing his own path in the ever-changing cuisine world.</p>\n\n"\
208
208
  "<p>In 1992, the first Les Bonnes Choses store opened on rue Saint-Lazare, in Paris (<a href=\"http://localhost/UlfoxUnM0wkXYXbb\">we're still there!</a>), much to everyone's surprise; indeed, back then, it was very surprising for a highly promising young man with a preordained career as a restaurant chef, to open a pastry shop instead. But soon enough, contemporary chefs understood that Jean-Michel had the drive to redefine a new nobility to pastry, the same way many other kinds of cuisine were being qualified as &quot;fine&quot;.</p>\n\n"\
209
209
  "<p>In 1996, meeting an overwhelming demand, Jean-Michel Pastranova opened <a href=\"http://localhost/UlfoxUnM0wkXYXbP\">a second shop on Paris's Champs-Élysées</a>, and <a href=\"http://localhost/UlfoxUnM0wkXYXbr\">a third one in London</a>, the same week! Eventually, Les Bonnes Choses gained an international reputation as &quot;a perfection so familiar and new at the same time, that it will feel like a taste travel&quot; (New York Gazette), &quot;the finest balance between surprise and comfort, enveloped in sweetness&quot; (The Tokyo Tribune), &quot;a renewal of the pastry genre (...), the kind that changed the way pastry is approached globally&quot; (The San Francisco Gourmet News). Therefore, it was only a matter of time before Les Bonnes Choses opened shops in <a href=\"http://localhost/UlfoxUnM0wkXYXbc\">New York</a> (2000) and <a href=\"http://localhost/UlfoxUnM0wkXYXbU\">Tokyo</a> (2004).</p>\n\n"\
210
- "<p>In 2013, Jean-Michel Pastranova stepped down as the CEO and Director of Workshops, remaining a senior advisor to the board and to the workshop artists; he passed the light on to Selena, his daugther, who initially learned the art of pastry from him. Passion for great food runs in the Pastranova family...</p>\n\n<p class=\"block-img\"><img src=\"https://lesbonneschoses.cdn.prismic.io/lesbonneschoses/df6c1d87258a5bfadf3479b163fd85c829a5c0b8.jpg\" alt=\"\" width=\"800\" height=\"533\" /></p>\n\n"\
210
+ "<p>In 2013, Jean-Michel Pastranova stepped down as the CEO and Director of Workshops, remaining a senior advisor to the board and to the workshop artists; he passed the light on to Selena, his daugther, who initially learned the art of pastry from him. Passion for great food runs in the Pastranova family...</p>\n\n<p class=\"block-img\"><img src=\"https://d2aw36oac6sa9o.cloudfront.net/lesbonneschoses/df6c1d87258a5bfadf3479b163fd85c829a5c0b8.jpg\" alt=\"\" width=\"800\" height=\"533\" /></p>\n\n"\
211
211
  "<h2>Our main value: our customers' delight</h2>\n\n"\
212
212
  "<p>Our every action is driven by the firm belief that there is art in pastry, and that this art is one of the dearest pleasures one can experience.</p>\n\n"\
213
213
  "<p>At Les Bonnes Choses, people preparing your macarons are not simply &quot;pastry chefs&quot;: they are &quot;<a href=\"http://localhost/UlfoxUnM0wkXYXba\">ganache specialists</a>&quot;, &quot;<a href=\"http://localhost/UlfoxUnM0wkXYXbQ\">fruit experts</a>&quot;, or &quot;<a href=\"http://localhost/UlfoxUnM0wkXYXbn\">oven instrumentalists</a>&quot;. They are the best people out there to perform the tasks they perform to create your pastry, giving it the greatest value. And they just love to make their specialized pastry skill better and better until perfection.</p>\n\n"\
@@ -91,6 +91,20 @@
91
91
  "spans":[]
92
92
  }]
93
93
  }
94
+ },{
95
+ "type": "Slice",
96
+ "slice_type": "separator",
97
+ "slice_label": null,
98
+ "value": {
99
+ "type": "Group",
100
+ "value": [
101
+ {
102
+ "sep": {
103
+ "type": "Separator"
104
+ }
105
+ }
106
+ ]
107
+ }
94
108
  }]
95
109
  }
96
110
  }
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.3.3
4
+ version: 1.3.4
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: 2015-07-17 00:00:00.000000000 Z
14
+ date: 2015-11-12 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -116,6 +116,7 @@ files:
116
116
  - lib/prismic/fragments/multiple.rb
117
117
  - lib/prismic/fragments/number.rb
118
118
  - lib/prismic/fragments/select.rb
119
+ - lib/prismic/fragments/separator.rb
119
120
  - lib/prismic/fragments/slices.rb
120
121
  - lib/prismic/fragments/structured_text.rb
121
122
  - lib/prismic/fragments/text.rb