Skip to content

Releases: prismicio-community/ruby-kit

1.0.0.rc7

14 May 20:06
Compare
Choose a tag to compare
1.0.0.rc7 Pre-release
Pre-release

Bugfix

  • The current ref was not stored in the cache key (so two queries on two different refs could return the same result).

1.0.0.rc6

11 Apr 19:11
Compare
Choose a tag to compare
1.0.0.rc6 Pre-release
Pre-release

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::Api constructor takes an extra optional cache parameter, which takes an object to use as the cache. The kit also comes with a new Prismic::Cache class, and a DefaultCache object 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 false as the value of the cache parameter when you initialize your Prismic::Api object.
    • How to make my own cache? --> extend Prismic::Cache with 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 the cache parameter of your Prismic::Api instantiation.

Bugfix

  • Embed blocks in a structured text fragment were oddly unmarshalled as a Prismic::Fragments::StructuredText::Block::Image object which contained a Prismic::Fragments::Embed object. They are now unmarshalled directly as a Prismic::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

04 Mar 10:46
Compare
Choose a tag to compare
1.0.0.rc5 Pre-release
Pre-release

Fix

  • Fix Prismic.oauth_initiate_url when the access_token is provided directly (not in an Hash) (eb9511a)

1.0.0.rc4

03 Mar 22:08
Compare
Choose a tag to compare
1.0.0.rc4 Pre-release
Pre-release

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_url and Prismic::API#oauth_check_token are now deprecated. Please use Prismic.oauth_initiate_url and Prismic.oauth_check_token instead

1.0.0.rc3

20 Feb 20:28
Compare
Choose a tag to compare
1.0.0.rc3 Pre-release
Pre-release

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] with i an integer
  • @documents[i].length or @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

12 Feb 00:40
Compare
Choose a tag to compare
1.0.0.rc2 Pre-release
Pre-release

Fixes

  • Links's url methods now have a consistent interface (link_resolver is no more mandatory when it's optional—as in WebLink), better error message (when link_resolver is mandatory and missing) and are now documented
  • HTML serialization of spans (through the as_html method) 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

03 Feb 10:32
Compare
Choose a tag to compare
1.0.0.rc1 Pre-release
Pre-release

Potentially breaking changes for advanced users

  • If you've been monkey-patching or overriding the Prismic::Fragments::MediaLink class: it doesn't exist anymore, and is now replaced by Prismic::Fragments::FileLink or Prismic::Fragments::ImageLink, depending on the kind of link.

New features

  • Support for Link.image and Link.file kinds of links, with new Prismic::Fragments::FileLink and Prismic::Fragments::ImageLink classes.
  • Prismic::Fragments::Group class now includes Enumerable, which means you can use each, map, select, etc. on Group objects. Same with Prismic::Fragments::Group::FragmentMapping objects (used internally by the Group class).
  • Prismic::Fragments::Group class now have a length method, aliased as size. Same with Prismic::Fragments::Group::FragmentMapping objects (used internally by the Group class).
  • The url method only existed for the Prismic::Fragments::WebLink class, now it is directly in the Prismic::Fragments::Link class, extended by all links classes: Prismic::Fragments::WebLink, Prismic::Fragments::DocumentLink, etc...

Syntactic sugar

  • Since you can now call url on any kind of link (see right above), this allows to do this in Rails, regardless of the kind of link the link object is: <%= link_to "Click here", link.url, :whatever_attribute => "whatever value" %>.

1.0.0.preview.8

03 Feb 19:10
Compare
Choose a tag to compare
1.0.0.preview.8 Pre-release
Pre-release

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_form is now Prismic::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

03 Feb 19:11
Compare
Choose a tag to compare
1.0.0.preview.7 Pre-release
Pre-release

Potentially breaking changes for basic users

  • Boldness in Prismic::Fragments::StructuredText#as_html was represented as <b> tags, now as <strong> tags.

New features

  • You had to call Prismic::Link_resolver#link_to on a Prismic::Fragments::DocumentLink object, but sometimes, you actually have the full Prismic::Document; you can now call it on both types of objects.
  • You had to call api.master_ref to get the master ref; now you can call it api.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::SearchForm only had the query method to set the q parameter of the API call. Now those methods are dynamically created from the RESTful form found in the /api document, 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

03 Feb 19:12
Compare
Choose a tag to compare
1.0.0.preview.6 Pre-release
Pre-release

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'].