philiprehberger-priority_queue 0.1.5 → 0.1.6

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: 7527c4ccc3db4ec7cd3f63e45ad84f7f1fa4724436f099cb7f68269dd0f21510
4
+ data.tar.gz: 395a2885bc1fc84d675bd6bba4387dddaaff5bd2979745c62f5c9ecec8441299
5
5
  SHA512:
6
- metadata.gz: dcc26ff306632c787749bbee30127076cda0c3c915ea00c8f862ffd1cf3671332c5b8f1e6d25c415ccf78083d8c4b4983ada21d3a7c519a0dbaf358b7999030e
7
- data.tar.gz: 6a96813563fd436773fee5ef8b2483cc926dd525e10958f07f055ddfc11342e08c1e171c736f3e6161abe69bef35f5fc7c048ef96a94ab2daf11622f80042a79
6
+ metadata.gz: f85b7772d196465f5e3569f67347a6e98d204e31c2d1c9207da474a270820aad208f36acd04b60bfcdbbe4052d445769a39d48f588eacf24a025802413c00438
7
+ data.tar.gz: 4169e41b5cfcbd1070f0bd360e57ca3898b04896b7db4356bf64bbdaa01969695f88f5114d7f1ed121fdce89d2e13ec3313e0c59c85d8b128dad997cd47cbaca
data/CHANGELOG.md CHANGED
@@ -7,6 +7,12 @@ 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.6] - 2026-03-24
11
+
12
+ ### Fixed
13
+ - Standardize README API section to table format
14
+ - Fix Installation section quote style to double quotes
15
+
10
16
  ## [0.1.5] - 2026-03-23
11
17
 
12
18
  ### 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:
@@ -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.6'
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.6
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-24 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,