philiprehberger-priority_queue 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7f342e86d70008478c28ee2b630fbd5332375444b75e95cd4fdf50067f411be4
4
- data.tar.gz: 8078c13c51a0a9d793bc5163c52ee7727251571767402a8bf059cc9bdeea29da
3
+ metadata.gz: b6c6189abf62a5cd7a03eec4626b908cfb8fbfd954e8183dbb5ebe43f421105f
4
+ data.tar.gz: 8af43691f143f9c673f56fed46d90486d9e0616ca938939bd99e5e62262b0bb9
5
5
  SHA512:
6
- metadata.gz: dcc26ff306632c787749bbee30127076cda0c3c915ea00c8f862ffd1cf3671332c5b8f1e6d25c415ccf78083d8c4b4983ada21d3a7c519a0dbaf358b7999030e
7
- data.tar.gz: 6a96813563fd436773fee5ef8b2483cc926dd525e10958f07f055ddfc11342e08c1e171c736f3e6161abe69bef35f5fc7c048ef96a94ab2daf11622f80042a79
6
+ metadata.gz: fbb8db631237032ac270c43fe2c5a1f9e9c33a906a4e2c60def195451ade5d930196ffdaf44cd3342d21228a870c98d493ff31764fe0f7587e488b74a82003e7
7
+ data.tar.gz: 12603ff8ef9d42bbac4fb3f364dab1b6edda0904962752e5ada257a022ec060f801d27175a7954c0849a2bd7499d78d9899d2a578bd6b1019ad26a32761a95cc
data/CHANGELOG.md CHANGED
@@ -7,6 +7,17 @@ and this gem adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.1.7] - 2026-03-24
11
+
12
+ ### Fixed
13
+ - Standardize README code examples to use double-quote require statements
14
+
15
+ ## [0.1.6] - 2026-03-24
16
+
17
+ ### Fixed
18
+ - Standardize README API section to table format
19
+ - Fix Installation section quote style to double quotes
20
+
10
21
  ## [0.1.5] - 2026-03-23
11
22
 
12
23
  ### Fixed
data/README.md CHANGED
@@ -15,7 +15,7 @@ Binary heap priority queue with min/max modes, custom comparators, and priority
15
15
  Add to your Gemfile:
16
16
 
17
17
  ```ruby
18
- gem 'philiprehberger-priority_queue'
18
+ gem "philiprehberger-priority_queue"
19
19
  ```
20
20
 
21
21
  Or install directly:
@@ -27,7 +27,7 @@ gem install philiprehberger-priority_queue
27
27
  ## Usage
28
28
 
29
29
  ```ruby
30
- require 'philiprehberger/priority_queue'
30
+ require "philiprehberger/priority_queue"
31
31
 
32
32
  # Min-heap (default) - lowest priority first
33
33
  queue = Philiprehberger::PriorityQueue::Queue.new
@@ -74,45 +74,19 @@ queue.clear # removes all items
74
74
 
75
75
  ## API
76
76
 
77
- ### `Queue.new(mode: :min, &comparator)`
78
-
79
- Creates a new priority queue. Mode can be `:min` (default) or `:max`. An optional block provides a custom comparator.
80
-
81
- ### `#push(item, priority:)` / `#<<`
82
-
83
- Adds an item with the given priority. Returns self. The `<<` operator accepts a hash: `queue << { item: 'x', priority: 1 }`.
84
-
85
- ### `#pop`
86
-
87
- Removes and returns the highest-priority item. Returns `nil` if empty.
88
-
89
- ### `#peek`
90
-
91
- Returns the highest-priority item without removing it. Returns `nil` if empty.
92
-
93
- ### `#size` / `#empty?`
94
-
95
- Returns the number of items or whether the queue is empty.
96
-
97
- ### `#change_priority(item, new_priority)`
98
-
99
- Updates the priority of an existing item and re-heapifies. Raises `ArgumentError` if the item is not found.
100
-
101
- ### `#to_a`
102
-
103
- Returns all items sorted by priority.
104
-
105
- ### `#include?(item)`
106
-
107
- Returns `true` if the item is in the queue.
108
-
109
- ### `#clear`
110
-
111
- Removes all items from the queue.
112
-
113
- ### `#merge(other)`
114
-
115
- Returns a new queue containing items from both queues. Does not modify the originals.
77
+ | Method | Description |
78
+ |--------|-------------|
79
+ | `Queue.new(mode: :min, &comparator)` | Create a priority queue; mode can be `:min` or `:max`; optional custom comparator block |
80
+ | `#push(item, priority:)` | Add an item with the given priority |
81
+ | `#pop` | Remove and return the highest-priority item |
82
+ | `#peek` | Return the highest-priority item without removing it |
83
+ | `#size` | Return the number of items in the queue |
84
+ | `#empty?` | Return `true` if the queue has no items |
85
+ | `#change_priority(item, new_priority)` | Update the priority of an existing item and re-heapify |
86
+ | `#to_a` | Return all items sorted by priority |
87
+ | `#include?(item)` | Return `true` if the item is in the queue |
88
+ | `#clear` | Remove all items from the queue |
89
+ | `#merge(other)` | Return a new queue containing items from both queues |
116
90
 
117
91
  ## Development
118
92
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Philiprehberger
4
4
  module PriorityQueue
5
- VERSION = '0.1.5'
5
+ VERSION = '0.1.7'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: philiprehberger-priority_queue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - philiprehberger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-03-23 00:00:00.000000000 Z
11
+ date: 2026-03-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A binary heap-based priority queue supporting min-heap, max-heap, and
14
14
  custom comparator modes. Features O(log n) push/pop, priority changes, merge operations,