Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: prismicio-community/ruby-kit
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: FrameworkComputer/prismic-ruby-kit
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 13 commits
  • 8 files changed
  • 3 contributors

Commits on Jun 13, 2023

  1. chore: run Ruby specs on GitHub actions

    ensures that on PR and push there's a test suite running to verify changes are passing
    brettchalupa authored Jun 13, 2023
    Configuration menu
    Copy the full SHA
    41c439e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5db5c2a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8824e5f View commit details
    Browse the repository at this point in the history
  4. chore(deps): update rspec dev-dep

    gets on latest ver to support modern rubies
    brettchalupa committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    c47d8f2 View commit details
    Browse the repository at this point in the history
  5. Merge pull request #1 from FrameworkComputer/gh-actions-ci

    chore: run Ruby specs on GitHub actions
    brettchalupa authored Jun 13, 2023
    Configuration menu
    Copy the full SHA
    3cb35f3 View commit details
    Browse the repository at this point in the history
  6. fix: ref without label raises NoMethodError

    Bug scenario from @faresd:
    
    > If you create a Release without a description, which is possible by
    > Publishing a document and choosing "Publish at a specific date and
    > time", the ref returned by Prismic's API will have a null label and the
    > Prismic client will fail to parse the entire response.
    
    Because of how the hash construction works, it needs a value for the
    key. This makes it fall back to the id of the ref which should always be
    present in the scenario where the label is null/nil.
    
    fixes #116
    
    More details:
    
    - https://community.prismic.io/t/release-without-description-causes-error-in-prismic-ruby-client/7514/4
    brettchalupa committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    4cf741b View commit details
    Browse the repository at this point in the history
  7. refactor lib/prismic/api.rb #parse_api_response

    Co-authored-by: Alistair Holt <hello@alistairholt.co.uk>
    brettchalupa and alistairholt committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    fbb16c1 View commit details
    Browse the repository at this point in the history
  8. fix: null label fallback (release w/o name)

    this undoes the suggestion in
    d54dfec
    since it's fundamentally different behavior. `fetch` only fallsback to
    the second param if the key is missing. but there is a `label` key in
    our hash, so it returns `nil`, persisting the `nil.downcase` call. This
    makes it so the value properly falls back when `nil`.
    
    It also doesn't downcase the id since that may actually be case
    sensitive.
    
    I tested this fix against a codebase reproing the issue and all appears
    well.
    brettchalupa committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    22ad116 View commit details
    Browse the repository at this point in the history
  9. Merge pull request #2 from FrameworkComputer/release-without-descript…

    …ion-fix-2
    
    fix: null label fallback (release w/o name)
    brettchalupa authored Jun 13, 2023
    Configuration menu
    Copy the full SHA
    109de71 View commit details
    Browse the repository at this point in the history

Commits on Jul 23, 2026

  1. Merge remote-tracking branch 'upstream/master'

    # Conflicts:
    #	Gemfile.lock
    filippoliverani committed Jul 23, 2026
    Configuration menu
    Copy the full SHA
    3015cbf View commit details
    Browse the repository at this point in the history
  2. Remove hashery dependency

    Drops the hashery runtime dependency, which was pulled in solely for
    its LRUHash. Ruby's built-in Hash has preserved insertion order since
    1.9, so the LRU cache can be implemented directly on top of it: reads
    and writes reinsert the entry at the tail, and eviction removes the
    head. Removing hashery shrinks the gem's dependency surface with no
    change in caching behaviour.
    filippoliverani committed Jul 23, 2026
    Configuration menu
    Copy the full SHA
    479d809 View commit details
    Browse the repository at this point in the history
  3. Fix memory allocation issues in StructuredText

    StructuredText::Block::Text#as_html walked the text one character at a
    time, escaping each character and concatenating it with +=, so every
    character produced a fresh intermediate String and every position hit
    the span hashes again. On large rich-text documents this dominated
    allocations and GC time.
    
    It now walks span boundaries instead of characters, appending whole
    text segments into a single mutable buffer, and hoists the HTML-escape
    table and pattern into frozen constants. The generated HTML is
    identical. The LRU eviction is also switched to Hash#shift to avoid
    allocating a full keys array on every insert.
    filippoliverani committed Jul 23, 2026
    Configuration menu
    Copy the full SHA
    1ddf27c View commit details
    Browse the repository at this point in the history
  4. Define span_parser once instead of on every parse

    Extracts span_parser out of structured_text_parser so it is defined a
    single time at load. It was declared as a nested `def self.span_parser`,
    so every StructuredText fragment parsed redefined the singleton method
    on the JsonParser module, invalidating Ruby's global method cache on
    each call and churning method-object bookkeeping.
    
    Behavior is unchanged: same body, still public, still delegating to the
    sibling link_parser.
    filippoliverani committed Jul 23, 2026
    Configuration menu
    Copy the full SHA
    f613fd1 View commit details
    Browse the repository at this point in the history
Loading