Releases: prismicio-community/ruby-kit
1.0.0.rc7
1.0.0.rc6
This release introduces a caching mechanism, but contains a minor bug; please upgrade to 1.0.0.rc7 instead.
New feature
- Basic and overridable caching system: the
Prismic::Apiconstructor takes an extra optionalcacheparameter, which takes an object to use as the cache. The kit also comes with a newPrismic::Cacheclass, and aDefaultCacheobject of that class, that is being used out-of-the-box.- How to enable the basic out-of-the-box cache? --> It is already enabled. If you're using an earlier version of the kit, just upgrade to this one, and the cache will be up and running.
- How to disable the cache? --> pass
falseas the value of thecacheparameter when you initialize yourPrismic::Apiobject. - How to make my own cache? --> extend
Prismic::Cachewith your own class, change all the methods you need to change (probably most of them, but there aren't that many), instantiate an object of that class, and pass it as thecacheparameter of yourPrismic::Apiinstantiation.
Bugfix
- Embed blocks in a structured text fragment were oddly unmarshalled as a
Prismic::Fragments::StructuredText::Block::Imageobject which contained aPrismic::Fragments::Embedobject. They are now unmarshalled directly as aPrismic::Fragments::Embed. Note: if you hadn't overridden it, the HTML serialization of structured text fragments (even those containing embeds) already worked and is unchanged.
1.0.0.rc5
1.0.0.rc4
Fix
- Support OAuth signin for private repositories (a39b8f0 in #32)
- The OAuth's token checking now uses the provided HTTPClient (fd21413 in #32)
Potentially breaking changes
Prismic::API#oauth_initiate_urlandPrismic::API#oauth_check_tokenare now deprecated. Please usePrismic.oauth_initiate_urlandPrismic.oauth_check_tokeninstead
1.0.0.rc3
New feature
- Pagination specifics are now exposed. This means now you still get your results paginated 20 by 20, but for each API call you also get the total number of pages, the total amount of results, the page number you're on, etc... which makes it trivial for you to build a pagination.
Potentially breaking changes
The object returned by submit calls (let's call it @documents) is no longer an Array, but an Enumerable. This is so that it can now also expose the new pagination specifics (@documents.total_results_size, @documents.total_pages, etc)
If you were doing those things with this object, it will still work (we reimplemented them):
@documents[i]withian integer@documents[i].lengthor@documents[i].size(which return the same thing)@documents[i].each,@documents[i].map,@documents[i].join, ... anything in the Enumerable mixin
However, if you were using Array-specific methods that are not part of Enumerable (@documents.empty?, @documents.rotate, ...), you will need to change it into: @documents.results.empty?, @documents.results.rotate, ...
If you are using an MVC framework such as Rails, note that the call to submit should be executed in your controller, but the use of the returned variable (which you may have to fix) may happen in your view.
1.0.0.rc2
Fixes
- Links's
urlmethods now have a consistent interface (link_resolveris no more mandatory when it's optional—as in WebLink), better error message (whenlink_resolveris mandatory and missing) and are now documented - HTML serialization of spans (through the
as_htmlmethod) produced output that forgot to close spans, like this:<p><strong>Lorem ipsum</p>. Now fixed, produces<p><strong>Lorem ipsum</strong></p>.
1.0.0.rc1
Potentially breaking changes for advanced users
- If you've been monkey-patching or overriding the
Prismic::Fragments::MediaLinkclass: it doesn't exist anymore, and is now replaced byPrismic::Fragments::FileLinkorPrismic::Fragments::ImageLink, depending on the kind of link.
New features
- Support for
Link.imageandLink.filekinds of links, with newPrismic::Fragments::FileLinkandPrismic::Fragments::ImageLinkclasses. Prismic::Fragments::Groupclass now includesEnumerable, which means you can useeach,map,select, etc. onGroupobjects. Same withPrismic::Fragments::Group::FragmentMappingobjects (used internally by theGroupclass).Prismic::Fragments::Groupclass now have alengthmethod, aliased assize. Same withPrismic::Fragments::Group::FragmentMappingobjects (used internally by theGroupclass).- The
urlmethod only existed for thePrismic::Fragments::WebLinkclass, now it is directly in thePrismic::Fragments::Linkclass, extended by all links classes:Prismic::Fragments::WebLink,Prismic::Fragments::DocumentLink, etc...
Syntactic sugar
- Since you can now call
urlon any kind of link (see right above), this allows to do this in Rails, regardless of the kind of link thelinkobject is:<%= link_to "Click here", link.url, :whatever_attribute => "whatever value" %>.
1.0.0.preview.8
New features
- Support for group fragments.
- Support for unknown fragments (instead of crashing, ignores the fragment with a warning advising to update the kit).
Syntactic sugar
Prismic::API#create_search_formis nowPrismic::API#form(the former issues a deprecation warning, and will be removed in a later release); the online cross-tech doc was adapted to reflect that possibility.
1.0.0.preview.7
Potentially breaking changes for basic users
- Boldness in
Prismic::Fragments::StructuredText#as_htmlwas represented as<b>tags, now as<strong>tags.
New features
- You had to call
Prismic::Link_resolver#link_toon aPrismic::Fragments::DocumentLinkobject, but sometimes, you actually have the fullPrismic::Document; you can now call it on both types of objects. - You had to call
api.master_refto get the master ref; now you can call itapi.master, just like in the other dev kits; both methods do the same thing. - New method:
Prismic::Fragments::StructuredText#as_text, renders zero formatting, and ignores images and embeds. Prismic::SearchFormonly had thequerymethod to set theqparameter of the API call. Now those methods are dynamically created from the RESTful form found in the/apidocument, so it's now possible to use those methods too:orderings,page,pageSize, as well as all the future non-yet-existing ones.
1.0.0.preview.6
Potentially breaking changes for basic users
- From an image, you had to call the view with its index, like this
image_object[0]; now they're stored in a Hash, you have to call them with their proper name:image_object['large'].