prismic.io 1.4.3 → 1.4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/docs/Prismic/API/BadPrismicResponseError.html +44 -43
  4. data/docs/Prismic/API/OAuth.html +99 -98
  5. data/docs/Prismic/API/PrismicWSAuthError.html +67 -66
  6. data/docs/Prismic/API/PrismicWSConnectionError.html +51 -50
  7. data/docs/Prismic/API.html +434 -280
  8. data/docs/Prismic/BasicNullCache.html +49 -48
  9. data/docs/Prismic/DefaultHTTPClient.html +85 -79
  10. data/docs/Prismic/Document.html +279 -83
  11. data/docs/Prismic/Error.html +52 -51
  12. data/docs/Prismic/Experiment.html +60 -59
  13. data/docs/Prismic/Experiments.html +61 -60
  14. data/docs/Prismic/Field.html +54 -53
  15. data/docs/Prismic/Form.html +70 -69
  16. data/docs/Prismic/Fragments/Color.html +60 -59
  17. data/docs/Prismic/Fragments/Date.html +52 -51
  18. data/docs/Prismic/Fragments/DocumentLink.html +78 -76
  19. data/docs/Prismic/Fragments/Embed.html +60 -59
  20. data/docs/Prismic/Fragments/FileLink.html +58 -57
  21. data/docs/Prismic/Fragments/Fragment.html +49 -48
  22. data/docs/Prismic/Fragments/GeoPoint.html +54 -53
  23. data/docs/Prismic/Fragments/Group.html +65 -63
  24. data/docs/Prismic/Fragments/GroupDocument.html +57 -55
  25. data/docs/Prismic/Fragments/Image/View.html +64 -63
  26. data/docs/Prismic/Fragments/Image/ViewDoesNotExistException.html +44 -43
  27. data/docs/Prismic/Fragments/Image.html +69 -68
  28. data/docs/Prismic/Fragments/ImageLink.html +50 -49
  29. data/docs/Prismic/Fragments/Link.html +53 -52
  30. data/docs/Prismic/Fragments/Multiple.html +58 -57
  31. data/docs/Prismic/Fragments/Number.html +54 -53
  32. data/docs/Prismic/Fragments/Select.html +52 -51
  33. data/docs/Prismic/Fragments/Separator.html +54 -53
  34. data/docs/Prismic/Fragments/Slice.html +58 -57
  35. data/docs/Prismic/Fragments/SliceZone.html +54 -53
  36. data/docs/Prismic/Fragments/StructuredText/Block/Embed.html +52 -51
  37. data/docs/Prismic/Fragments/StructuredText/Block/Heading.html +52 -51
  38. data/docs/Prismic/Fragments/StructuredText/Block/Image.html +66 -65
  39. data/docs/Prismic/Fragments/StructuredText/Block/ListItem.html +52 -51
  40. data/docs/Prismic/Fragments/StructuredText/Block/Paragraph.html +47 -46
  41. data/docs/Prismic/Fragments/StructuredText/Block/Preformatted.html +47 -46
  42. data/docs/Prismic/Fragments/StructuredText/Block/Text.html +68 -64
  43. data/docs/Prismic/Fragments/StructuredText/Block.html +47 -46
  44. data/docs/Prismic/Fragments/StructuredText/BlockGroup.html +54 -53
  45. data/docs/Prismic/Fragments/StructuredText/Span/Em.html +47 -46
  46. data/docs/Prismic/Fragments/StructuredText/Span/Hyperlink.html +53 -52
  47. data/docs/Prismic/Fragments/StructuredText/Span/Label.html +52 -51
  48. data/docs/Prismic/Fragments/StructuredText/Span/Strong.html +47 -46
  49. data/docs/Prismic/Fragments/StructuredText/Span.html +52 -51
  50. data/docs/Prismic/Fragments/StructuredText.html +59 -58
  51. data/docs/Prismic/Fragments/Text.html +54 -53
  52. data/docs/Prismic/Fragments/Timestamp.html +52 -51
  53. data/docs/Prismic/Fragments/WebLink.html +50 -49
  54. data/docs/Prismic/Fragments.html +39 -39
  55. data/docs/Prismic/HtmlSerializer.html +57 -56
  56. data/docs/Prismic/JsonParser.html +145 -143
  57. data/docs/Prismic/LinkResolver.html +73 -72
  58. data/docs/Prismic/LruCache.html +70 -69
  59. data/docs/Prismic/Predicates.html +261 -209
  60. data/docs/Prismic/Ref.html +86 -85
  61. data/docs/Prismic/Response.html +75 -73
  62. data/docs/Prismic/SearchForm/AuthenticationException.html +44 -43
  63. data/docs/Prismic/SearchForm/AuthorizationException.html +44 -43
  64. data/docs/Prismic/SearchForm/FormSearchException.html +44 -43
  65. data/docs/Prismic/SearchForm/NoRefSetException.html +44 -43
  66. data/docs/Prismic/SearchForm/RefNotFoundException.html +44 -43
  67. data/docs/Prismic/SearchForm/UnsupportedFormKind.html +44 -43
  68. data/docs/Prismic/SearchForm.html +97 -96
  69. data/docs/Prismic/Variation.html +57 -56
  70. data/docs/Prismic/WithFragments.html +115 -113
  71. data/docs/Prismic.html +91 -93
  72. data/docs/_index.html +32 -35
  73. data/docs/class_list.html +24 -27
  74. data/docs/css/full_list.css +32 -31
  75. data/docs/css/style.css +244 -91
  76. data/docs/file.README.html +39 -74
  77. data/docs/file_list.html +26 -26
  78. data/docs/frames.html +7 -16
  79. data/docs/index.html +39 -74
  80. data/docs/js/app.js +101 -77
  81. data/docs/js/full_list.js +170 -132
  82. data/docs/method_list.html +1995 -1189
  83. data/docs/top-level-namespace.html +34 -36
  84. data/lib/prismic/api.rb +10 -1
  85. data/lib/prismic/fragments/link.rb +3 -2
  86. data/lib/prismic/json_parsers.rb +14 -0
  87. data/lib/prismic/version.rb +1 -1
  88. data/lib/prismic.rb +47 -5
  89. data/spec/cache_spec.rb +2 -2
  90. data/spec/fragments_spec.rb +8 -1
  91. data/spec/json_parsers_spec.rb +13 -1
  92. data/spec/prismic_spec.rb +14 -7
  93. data/spec/responses_mocks/document.json +13 -0
  94. data/spec/simple_search_spec.rb +9 -0
  95. metadata +2 -2
@@ -1,12 +1,12 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
1
+ <!DOCTYPE html>
2
+ <html>
4
3
  <head>
5
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>
7
7
  File: README
8
8
 
9
- &mdash; Documentation by YARD 0.8.7.4
9
+ &mdash; Documentation by YARD 0.9.8
10
10
 
11
11
  </title>
12
12
 
@@ -15,9 +15,8 @@
15
15
  <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
16
 
17
17
  <script type="text/javascript" charset="utf-8">
18
- hasFrames = window.top.frames.main ? true : false;
18
+ pathId = "README";
19
19
  relpath = '';
20
- framesUrl = "frames.html#!file.README.html";
21
20
  </script>
22
21
 
23
22
 
@@ -28,40 +27,37 @@
28
27
 
29
28
  </head>
30
29
  <body>
31
- <div id="header">
32
- <div id="menu">
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="file_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
33
38
 
34
39
  <a href="_index.html">Index</a> &raquo;
35
40
  <span class="title">File: README</span>
36
41
 
37
-
38
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
39
42
  </div>
40
43
 
41
- <div id="search">
44
+ <div id="search">
42
45
 
43
46
  <a class="full_list_link" id="class_list_link"
44
47
  href="class_list.html">
45
- Class List
46
- </a>
47
-
48
- <a class="full_list_link" id="method_list_link"
49
- href="method_list.html">
50
- Method List
51
- </a>
52
-
53
- <a class="full_list_link" id="file_list_link"
54
- href="file_list.html">
55
- File List
48
+
49
+ <svg width="24" height="24">
50
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
51
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
52
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
53
+ </svg>
56
54
  </a>
57
55
 
58
56
  </div>
59
- <div class="clear"></div>
60
- </div>
61
-
62
- <iframe id="search_frame"></iframe>
57
+ <div class="clear"></div>
58
+ </div>
63
59
 
64
- <div id="content"><div id='filecontents'><h2>Ruby development kit for prismic.io</h2>
60
+ <div id="content"><div id='filecontents'><h2>Ruby development kit for prismic.io</h2>
65
61
 
66
62
  <p><a href="http://badge.fury.io/rb/prismic.io"><img src="https://badge.fury.io/rb/prismic.io.png" alt="Gem Version"></a>
67
63
  <a href="https://travis-ci.org/prismicio/ruby-kit"><img src="https://api.travis-ci.org/prismicio/ruby-kit.png" alt="Build Status"></a>
@@ -81,66 +77,34 @@
81
77
  <pre class="code sh"><code class="sh">gem install prismic.io --pre
82
78
  </code></pre>
83
79
 
84
- <p>then add in your code:
85
- <code>ruby
86
- require &#39;prismic&#39;
87
- </code></p>
80
+ <p>then add in your code:</p>
81
+
82
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>prismic</span><span class='tstring_end'>&#39;</span></span>
83
+ </code></pre>
88
84
 
89
85
  <p>To add the gem as a dependency to your project with <a href="http://bundler.io/">Bundler</a>, you can add this line in your Gemfile:</p>
90
86
 
91
87
  <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>prismic.io</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>require:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>prismic</span><span class='tstring_end'>&#39;</span></span>
92
88
  </code></pre>
93
89
 
94
- <h4>Get started with prismic.io</h4>
95
-
96
- <p>You can find out <a href="https://developers.prismic.io/documentation/UjBaQsuvzdIHvE4D/getting-started">how to get started with prismic.io</a> on our <a href="https://developers.prismic.io/">prismic.io developer&#39;s portal</a>.</p>
97
-
98
- <h4>Get started using the kit</h4>
99
-
100
- <p>Also on our <a href="https://developers.prismic.io/">prismic.io developer&#39;s portal</a>, on top of our full documentation, you will:
101
- * get a thorough introduction of <a href="https://developers.prismic.io/documentation/UjBe8bGIJ3EKtgBZ/api-documentation#kits-and-helpers">how to use prismic.io kits</a>, including this one.
102
- * see <a href="https://developers.prismic.io/technologies/UjBh6MuvzeMJvE4m/ruby">what else is available for Ruby</a>: starter projects, examples, ...</p>
103
-
104
- <h3>Using the kit</h3>
105
-
106
- <h4>Kit&#39;s detailed documentation</h4>
107
-
108
- <p>To get a detailed documentation of the Ruby kit&#39;s variables and methods, please check out the <a href="http://rubydoc.info/github/prismicio/ruby-kit/master/frames">prismic.io Ruby kit&#39;s documentation</a>.</p>
109
-
110
- <h4>Specific Ruby kit syntax</h4>
111
-
112
- <p>Thanks to Ruby&#39;s syntax, this kit contains some mild differences and syntastic sugar over <a href="https://developers.prismic.io/documentation/UjBe8bGIJ3EKtgBZ/api-documentation#kits-and-helpers">the &quot;Kits and helpers&quot; section of our API documentation</a> in general (which you should read first). They are listed here:</p>
90
+ <h4>Get started</h4>
113
91
 
114
92
  <ul>
115
- <li>When calling the API, a faster way to pass the <code>ref</code>: directly as a parameter of the <code>submit</code> method (no need to use the <code>ref</code> method then): <code>api.form(&quot;everything&quot;).submit(@ref)</code>.</li>
116
- <li>Accessing type-dependent fields from a <code>document</code> is done through the <code>[]</code> operator (rather than a <code>get()</code> method). Printing the HTML version of a field therefore looks like <code>document[&quot;title_user_friendly&quot;].as_html(link_resolver(@ref))</code>.</li>
117
- <li>Two of the fields in the <code>DocumentLink</code> object (the one used to write your <code>link_resolver</code> method, for instance) were renamed to fit Ruby&#39;s best practice: <code>doc.type</code> is in fact <code>doc.link_type</code>, and <code>doc.isBroken</code> is in fact <code>doc.broken?</code>.</li>
118
- <li>You don&#39;t need to pass a <code>ctx</code> object in <code>as_html()</code>, you can use the <code>Prismic.link_resolver</code> static method to build a link resolver object that takes the <code>ref</code> into account, like this: <code>@link_resolver = Prismic.link_resolver(@ref) { |doc| ... }</code>. Then you can simply go: <code>fragment.as_html(@link_resolver)</code>. Note: the Rails starter kit provides you with a helper allowing you to pass the ref each time you call the link resolver, like this: <code>fragment.as_html(link_resolver(@ref))</code>.</li>
119
- <li>the <code>Response</code> class is fit to work with the <a href="https://github.com/amatsuda/kaminari">Kaminari</a> gem. So if you have a <code>@response</code> object in your controller, you can display a whole pagination for it in your view like this: <code>&lt;%= paginate @response %&gt;</code> (this works with any Rails 3 or 4 app with the Kaminari gem installed).</li>
93
+ <li><a href="https://prismic.io/docs">developer documentation</a></li>
94
+ <li><a href="https://prismic.io/quickstart">quickstart</a></li>
95
+ <li><a href="http://prismicio.github.io/ruby-kit/">API reference</a></li>
120
96
  </ul>
121
97
 
122
- <p>Knowing all that, here is typical code written with the Ruby kit:</p>
123
-
124
- <ul>
125
- <li>A typical API object instantiation looks like this: <code>Prismic.api(url, opts)</code></li>
126
- <li>A typical querying looks like this: <code>api.form(&#39;everything&#39;).query(&#39;[[:d = at(document.type, &quot;product&quot;)]]&#39;).submit(@ref)</code></li>
127
- <li>A typical fragment manipulation looks like this: <code>doc[&#39;article.image&#39;].get_view(&#39;icon&#39;).url</code></li>
128
- <li>A typical fragment serialization to HTML looks like this: <code>doc[&#39;article.body&#39;].as_html(@link_resolver)</code></li>
129
- </ul>
98
+ <p>The quickstart is not available for Ruby yet, but if you understand Javascript you can easily adapt the code.</p>
130
99
 
131
100
  <h4>Configuring Alternative API Caches</h4>
132
101
 
133
- <p>The default cache stores data in-memory, in the server. You may want to use a different cache, for example to share it between several servers (with memcached or similar). A null cache (does no caching) is also available if you need a predictible behavior for testing or VCR. To use it (or any other compliant cache), simply add <code>api_cache =&gt; Prismic::BasicNullCache.new</code>
134
- to the options passed to <code>Prismic.api</code>.</p>
102
+ <p>The default cache stores data in-memory, in the server. You may want to use a different cache, for example to share it between several servers (with memcached or similar). A null cache (does no caching) is also available if you need a predictible behavior for testing or VCR. To use it (or any other compliant cache), simply add <code>api_cache: Prismic::BasicNullCache.new</code> to the options passed to <code>Prismic.api</code>.</p>
135
103
 
136
104
  <h3>Changelog</h3>
137
105
 
138
106
  <p>Need to see what changed, or to upgrade your kit? We keep our changelog on <a href="https://github.com/prismicio/ruby-kit/releases">this repository&#39;s &quot;Releases&quot; tab</a>.</p>
139
107
 
140
- <h3>Contribute to the kit</h3>
141
-
142
- <p>Contribution is open to all developer levels, read our &quot;<a href="https://developers.prismic.io/documentation/UszOeAEAANUlwFpp/contribute-to-the-official-kits">Contribute to the official kits</a>&quot; documentation to learn more.</p>
143
-
144
108
  <h4>Install the kit locally</h4>
145
109
 
146
110
  <p>Of course, you&#39;re going to need <a href="https://www.ruby-lang.org/en/downloads/">Ruby installed</a> on your computer, as well as <a href="http://rubygems.org/pages/download">RubyGems</a> and <a href="http://bundler.io/">Bundler</a>.</p>
@@ -149,7 +113,7 @@ to the options passed to <code>Prismic.api</code>.</p>
149
113
 
150
114
  <h4>Test</h4>
151
115
 
152
- <p>Please write tests for any bugfix or new feature, by placing your tests in the <a href="spec/">spec/</a> folder, following the <a href="http://rspec.info/">RSpec</a> syntax. Launch the tests by running <code>bundle exec rspec</code></p>
116
+ <p>Please write tests for any bugfix or new feature, by placing your tests in the <a href="spec/">spec/</a> folder, following the <a href="http://rspec.info/">RSpec</a> syntax. Launch the tests by running <code>rspec</code></p>
153
117
 
154
118
  <p>If you find existing code that is not optimally tested and wish to make it better, we really appreciate it; but you should document it on its own branch and its own pull request.</p>
155
119
 
@@ -170,11 +134,12 @@ to the options passed to <code>Prismic.api</code>.</p>
170
134
  <p>Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.</p>
171
135
  </div></div>
172
136
 
173
- <div id="footer">
174
- Generated on Tue Sep 27 10:47:05 2016 by
137
+ <div id="footer">
138
+ Generated on Mon Jan 16 16:05:08 2017 by
175
139
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
176
- 0.8.7.4 (ruby-2.0.0).
140
+ 0.9.8 (ruby-2.3.1).
177
141
  </div>
178
142
 
143
+ </div>
179
144
  </body>
180
145
  </html>
data/docs/file_list.html CHANGED
@@ -1,8 +1,8 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1
+ <!DOCTYPE html>
3
2
  <html>
4
3
  <head>
5
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
5
+ <meta charset="utf-8" />
6
6
 
7
7
  <link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
8
8
 
@@ -19,37 +19,37 @@
19
19
  <base id="base_target" target="_parent" />
20
20
  </head>
21
21
  <body>
22
- <script type="text/javascript" charset="utf-8">
23
- if (window.top.frames.main) {
24
- document.getElementById('base_target').target = 'main';
25
- document.body.className = 'frames';
26
- }
27
- </script>
28
22
  <div id="content">
29
- <h1 id="full_list_header">File List</h1>
30
- <div id="nav">
31
-
32
- <span><a target="_self" href="class_list.html">
33
- Classes
34
- </a></span>
35
-
36
- <span><a target="_self" href="method_list.html">
37
- Methods
38
- </a></span>
39
-
40
- <span><a target="_self" href="file_list.html">
41
- Files
42
- </a></span>
43
-
23
+ <div class="fixed_header">
24
+ <h1 id="full_list_header">File List</h1>
25
+ <div id="full_list_nav">
26
+
27
+ <span><a target="_self" href="class_list.html">
28
+ Classes
29
+ </a></span>
30
+
31
+ <span><a target="_self" href="method_list.html">
32
+ Methods
33
+ </a></span>
34
+
35
+ <span><a target="_self" href="file_list.html">
36
+ Files
37
+ </a></span>
38
+
39
+ </div>
40
+
41
+ <div id="search">Search: <input type="text" /></div>
44
42
  </div>
45
- <div id="search">Search: <input type="text" /></div>
46
43
 
47
44
  <ul id="full_list" class="file">
48
45
 
49
46
 
50
- <li class="r1"><span class="object_link"><a href="index.html" title="README">README</a></a></li>
47
+ <li id="object_README" class="odd">
48
+ <div class="item"><span class="object_link"><a href="index.html" title="README">README</a></span></div>
49
+ </li>
51
50
 
52
51
 
52
+
53
53
  </ul>
54
54
  </div>
55
55
  </body>
data/docs/frames.html CHANGED
@@ -1,26 +1,17 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
3
-
4
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
1
+ <!DOCTYPE html>
2
+ <html>
5
3
  <head>
6
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
7
- <title>Documentation by YARD 0.8.7.4</title>
4
+ <meta charset="utf-8">
5
+ <title>Documentation by YARD 0.9.8</title>
8
6
  </head>
9
7
  <script type="text/javascript" charset="utf-8">
10
- window.onload = function() {
11
8
  var match = unescape(window.location.hash).match(/^#!(.+)/);
12
9
  var name = match ? match[1] : 'index.html';
13
10
  name = name.replace(/^(\w+):\/\//, '').replace(/^\/\//, '');
14
- document.writeln('<frameset cols="20%,*">' +
15
- '<frame name="list" src="class_list.html" />' +
16
- '<frame name="main" src="' + escape(name) + '" />' +
17
- '</frameset>');
18
- }
11
+ window.top.location = name;
19
12
  </script>
20
13
  <noscript>
21
- <frameset cols="20%,*">
22
- <frame name="list" src="class_list.html" />
23
- <frame name="main" src="index.html" />
24
- </frameset>
14
+ <h1>Oops!</h1>
15
+ <h2>YARD requires JavaScript!</h2>
25
16
  </noscript>
26
17
  </html>
data/docs/index.html CHANGED
@@ -1,12 +1,12 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
1
+ <!DOCTYPE html>
2
+ <html>
4
3
  <head>
5
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>
7
7
  File: README
8
8
 
9
- &mdash; Documentation by YARD 0.8.7.4
9
+ &mdash; Documentation by YARD 0.9.8
10
10
 
11
11
  </title>
12
12
 
@@ -15,9 +15,8 @@
15
15
  <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
16
 
17
17
  <script type="text/javascript" charset="utf-8">
18
- hasFrames = window.top.frames.main ? true : false;
18
+ pathId = "README";
19
19
  relpath = '';
20
- framesUrl = "frames.html#!file.README.html";
21
20
  </script>
22
21
 
23
22
 
@@ -28,40 +27,37 @@
28
27
 
29
28
  </head>
30
29
  <body>
31
- <div id="header">
32
- <div id="menu">
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
33
38
 
34
39
  <a href="_index.html">Index</a> &raquo;
35
40
  <span class="title">File: README</span>
36
41
 
37
-
38
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
39
42
  </div>
40
43
 
41
- <div id="search">
44
+ <div id="search">
42
45
 
43
46
  <a class="full_list_link" id="class_list_link"
44
47
  href="class_list.html">
45
- Class List
46
- </a>
47
-
48
- <a class="full_list_link" id="method_list_link"
49
- href="method_list.html">
50
- Method List
51
- </a>
52
-
53
- <a class="full_list_link" id="file_list_link"
54
- href="file_list.html">
55
- File List
48
+
49
+ <svg width="24" height="24">
50
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
51
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
52
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
53
+ </svg>
56
54
  </a>
57
55
 
58
56
  </div>
59
- <div class="clear"></div>
60
- </div>
61
-
62
- <iframe id="search_frame"></iframe>
57
+ <div class="clear"></div>
58
+ </div>
63
59
 
64
- <div id="content"><div id='filecontents'><h2>Ruby development kit for prismic.io</h2>
60
+ <div id="content"><div id='filecontents'><h2>Ruby development kit for prismic.io</h2>
65
61
 
66
62
  <p><a href="http://badge.fury.io/rb/prismic.io"><img src="https://badge.fury.io/rb/prismic.io.png" alt="Gem Version"></a>
67
63
  <a href="https://travis-ci.org/prismicio/ruby-kit"><img src="https://api.travis-ci.org/prismicio/ruby-kit.png" alt="Build Status"></a>
@@ -81,66 +77,34 @@
81
77
  <pre class="code sh"><code class="sh">gem install prismic.io --pre
82
78
  </code></pre>
83
79
 
84
- <p>then add in your code:
85
- <code>ruby
86
- require &#39;prismic&#39;
87
- </code></p>
80
+ <p>then add in your code:</p>
81
+
82
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>prismic</span><span class='tstring_end'>&#39;</span></span>
83
+ </code></pre>
88
84
 
89
85
  <p>To add the gem as a dependency to your project with <a href="http://bundler.io/">Bundler</a>, you can add this line in your Gemfile:</p>
90
86
 
91
87
  <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>prismic.io</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>require:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>prismic</span><span class='tstring_end'>&#39;</span></span>
92
88
  </code></pre>
93
89
 
94
- <h4>Get started with prismic.io</h4>
95
-
96
- <p>You can find out <a href="https://developers.prismic.io/documentation/UjBaQsuvzdIHvE4D/getting-started">how to get started with prismic.io</a> on our <a href="https://developers.prismic.io/">prismic.io developer&#39;s portal</a>.</p>
97
-
98
- <h4>Get started using the kit</h4>
99
-
100
- <p>Also on our <a href="https://developers.prismic.io/">prismic.io developer&#39;s portal</a>, on top of our full documentation, you will:
101
- * get a thorough introduction of <a href="https://developers.prismic.io/documentation/UjBe8bGIJ3EKtgBZ/api-documentation#kits-and-helpers">how to use prismic.io kits</a>, including this one.
102
- * see <a href="https://developers.prismic.io/technologies/UjBh6MuvzeMJvE4m/ruby">what else is available for Ruby</a>: starter projects, examples, ...</p>
103
-
104
- <h3>Using the kit</h3>
105
-
106
- <h4>Kit&#39;s detailed documentation</h4>
107
-
108
- <p>To get a detailed documentation of the Ruby kit&#39;s variables and methods, please check out the <a href="http://rubydoc.info/github/prismicio/ruby-kit/master/frames">prismic.io Ruby kit&#39;s documentation</a>.</p>
109
-
110
- <h4>Specific Ruby kit syntax</h4>
111
-
112
- <p>Thanks to Ruby&#39;s syntax, this kit contains some mild differences and syntastic sugar over <a href="https://developers.prismic.io/documentation/UjBe8bGIJ3EKtgBZ/api-documentation#kits-and-helpers">the &quot;Kits and helpers&quot; section of our API documentation</a> in general (which you should read first). They are listed here:</p>
90
+ <h4>Get started</h4>
113
91
 
114
92
  <ul>
115
- <li>When calling the API, a faster way to pass the <code>ref</code>: directly as a parameter of the <code>submit</code> method (no need to use the <code>ref</code> method then): <code>api.form(&quot;everything&quot;).submit(@ref)</code>.</li>
116
- <li>Accessing type-dependent fields from a <code>document</code> is done through the <code>[]</code> operator (rather than a <code>get()</code> method). Printing the HTML version of a field therefore looks like <code>document[&quot;title_user_friendly&quot;].as_html(link_resolver(@ref))</code>.</li>
117
- <li>Two of the fields in the <code>DocumentLink</code> object (the one used to write your <code>link_resolver</code> method, for instance) were renamed to fit Ruby&#39;s best practice: <code>doc.type</code> is in fact <code>doc.link_type</code>, and <code>doc.isBroken</code> is in fact <code>doc.broken?</code>.</li>
118
- <li>You don&#39;t need to pass a <code>ctx</code> object in <code>as_html()</code>, you can use the <code>Prismic.link_resolver</code> static method to build a link resolver object that takes the <code>ref</code> into account, like this: <code>@link_resolver = Prismic.link_resolver(@ref) { |doc| ... }</code>. Then you can simply go: <code>fragment.as_html(@link_resolver)</code>. Note: the Rails starter kit provides you with a helper allowing you to pass the ref each time you call the link resolver, like this: <code>fragment.as_html(link_resolver(@ref))</code>.</li>
119
- <li>the <code>Response</code> class is fit to work with the <a href="https://github.com/amatsuda/kaminari">Kaminari</a> gem. So if you have a <code>@response</code> object in your controller, you can display a whole pagination for it in your view like this: <code>&lt;%= paginate @response %&gt;</code> (this works with any Rails 3 or 4 app with the Kaminari gem installed).</li>
93
+ <li><a href="https://prismic.io/docs">developer documentation</a></li>
94
+ <li><a href="https://prismic.io/quickstart">quickstart</a></li>
95
+ <li><a href="http://prismicio.github.io/ruby-kit/">API reference</a></li>
120
96
  </ul>
121
97
 
122
- <p>Knowing all that, here is typical code written with the Ruby kit:</p>
123
-
124
- <ul>
125
- <li>A typical API object instantiation looks like this: <code>Prismic.api(url, opts)</code></li>
126
- <li>A typical querying looks like this: <code>api.form(&#39;everything&#39;).query(&#39;[[:d = at(document.type, &quot;product&quot;)]]&#39;).submit(@ref)</code></li>
127
- <li>A typical fragment manipulation looks like this: <code>doc[&#39;article.image&#39;].get_view(&#39;icon&#39;).url</code></li>
128
- <li>A typical fragment serialization to HTML looks like this: <code>doc[&#39;article.body&#39;].as_html(@link_resolver)</code></li>
129
- </ul>
98
+ <p>The quickstart is not available for Ruby yet, but if you understand Javascript you can easily adapt the code.</p>
130
99
 
131
100
  <h4>Configuring Alternative API Caches</h4>
132
101
 
133
- <p>The default cache stores data in-memory, in the server. You may want to use a different cache, for example to share it between several servers (with memcached or similar). A null cache (does no caching) is also available if you need a predictible behavior for testing or VCR. To use it (or any other compliant cache), simply add <code>api_cache =&gt; Prismic::BasicNullCache.new</code>
134
- to the options passed to <code>Prismic.api</code>.</p>
102
+ <p>The default cache stores data in-memory, in the server. You may want to use a different cache, for example to share it between several servers (with memcached or similar). A null cache (does no caching) is also available if you need a predictible behavior for testing or VCR. To use it (or any other compliant cache), simply add <code>api_cache: Prismic::BasicNullCache.new</code> to the options passed to <code>Prismic.api</code>.</p>
135
103
 
136
104
  <h3>Changelog</h3>
137
105
 
138
106
  <p>Need to see what changed, or to upgrade your kit? We keep our changelog on <a href="https://github.com/prismicio/ruby-kit/releases">this repository&#39;s &quot;Releases&quot; tab</a>.</p>
139
107
 
140
- <h3>Contribute to the kit</h3>
141
-
142
- <p>Contribution is open to all developer levels, read our &quot;<a href="https://developers.prismic.io/documentation/UszOeAEAANUlwFpp/contribute-to-the-official-kits">Contribute to the official kits</a>&quot; documentation to learn more.</p>
143
-
144
108
  <h4>Install the kit locally</h4>
145
109
 
146
110
  <p>Of course, you&#39;re going to need <a href="https://www.ruby-lang.org/en/downloads/">Ruby installed</a> on your computer, as well as <a href="http://rubygems.org/pages/download">RubyGems</a> and <a href="http://bundler.io/">Bundler</a>.</p>
@@ -149,7 +113,7 @@ to the options passed to <code>Prismic.api</code>.</p>
149
113
 
150
114
  <h4>Test</h4>
151
115
 
152
- <p>Please write tests for any bugfix or new feature, by placing your tests in the <a href="spec/">spec/</a> folder, following the <a href="http://rspec.info/">RSpec</a> syntax. Launch the tests by running <code>bundle exec rspec</code></p>
116
+ <p>Please write tests for any bugfix or new feature, by placing your tests in the <a href="spec/">spec/</a> folder, following the <a href="http://rspec.info/">RSpec</a> syntax. Launch the tests by running <code>rspec</code></p>
153
117
 
154
118
  <p>If you find existing code that is not optimally tested and wish to make it better, we really appreciate it; but you should document it on its own branch and its own pull request.</p>
155
119
 
@@ -170,11 +134,12 @@ to the options passed to <code>Prismic.api</code>.</p>
170
134
  <p>Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.</p>
171
135
  </div></div>
172
136
 
173
- <div id="footer">
174
- Generated on Tue Sep 27 10:47:05 2016 by
137
+ <div id="footer">
138
+ Generated on Mon Jan 16 16:05:08 2017 by
175
139
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
176
- 0.8.7.4 (ruby-2.0.0).
140
+ 0.9.8 (ruby-2.3.1).
177
141
  </div>
178
142
 
143
+ </div>
179
144
  </body>
180
145
  </html>