philiprehberger-priority_queue 0.1.4 → 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: 5a54ca7fd26ab265c4c752eb0be728e2a494d08edf896ccf782a0c8a97981990
4
- data.tar.gz: ac6060efb25b0bdd7e5d792f818f791012657d2df3d9adec03a647de9144640c
3
+ metadata.gz: 7527c4ccc3db4ec7cd3f63e45ad84f7f1fa4724436f099cb7f68269dd0f21510
4
+ data.tar.gz: 395a2885bc1fc84d675bd6bba4387dddaaff5bd2979745c62f5c9ecec8441299
5
5
  SHA512:
6
- metadata.gz: cbf27f268448d60ddbf0eea8fe1cdd382fc0f359552d80ca28e0fd107fb419a9121c3a2caedfeb91b1537800add286311cba34fedbb3a79dafd98a36713f11ba
7
- data.tar.gz: 235d0f7b820482740244ec0c27d4a3efbb8d2116cdbf860884714506b2c1d9e09d53f6b4db12d030cd2d4790133d69a83166a81823eea4548b74063881df8784
6
+ metadata.gz: f85b7772d196465f5e3569f67347a6e98d204e31c2d1c9207da474a270820aad208f36acd04b60bfcdbbe4052d445769a39d48f588eacf24a025802413c00438
7
+ data.tar.gz: 4169e41b5cfcbd1070f0bd360e57ca3898b04896b7db4356bf64bbdaa01969695f88f5114d7f1ed121fdce89d2e13ec3313e0c59c85d8b128dad997cd47cbaca
data/CHANGELOG.md CHANGED
@@ -6,7 +6,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this gem adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
8
  ## [Unreleased]
9
- n## [0.1.4] - 2026-03-22
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
+
16
+ ## [0.1.5] - 2026-03-23
17
+
18
+ ### Fixed
19
+ - Standardize README to match template (installation order, code fences, license section, one-liner format)
20
+ - Update gemspec summary to match README description
21
+
22
+ ## [0.1.4] - 2026-03-22
10
23
 
11
24
  ### Changed
12
25
  - Fix README badges to match template (Tests, Gem Version, License)
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  [![Gem Version](https://badge.fury.io/rb/philiprehberger-priority_queue.svg)](https://rubygems.org/gems/philiprehberger-priority_queue)
5
5
  [![License](https://img.shields.io/github/license/philiprehberger/rb-priority-queue)](LICENSE)
6
6
 
7
- Binary heap priority queue with min/max modes and custom comparators. Features O(log n) push/pop, priority updates, merge operations, and FIFO tie-breaking for equal priorities.
7
+ Binary heap priority queue with min/max modes, custom comparators, and priority updates
8
8
 
9
9
  ## Requirements
10
10
 
@@ -12,14 +12,16 @@ Binary heap priority queue with min/max modes and custom comparators. Features O
12
12
 
13
13
  ## Installation
14
14
 
15
- ```sh
16
- gem install philiprehberger-priority_queue
15
+ Add to your Gemfile:
16
+
17
+ ```ruby
18
+ gem "philiprehberger-priority_queue"
17
19
  ```
18
20
 
19
- Or add to your Gemfile:
21
+ Or install directly:
20
22
 
21
- ```ruby
22
- gem 'philiprehberger-priority_queue'
23
+ ```bash
24
+ gem install philiprehberger-priority_queue
23
25
  ```
24
26
 
25
27
  ## Usage
@@ -72,49 +74,23 @@ queue.clear # removes all items
72
74
 
73
75
  ## API
74
76
 
75
- ### `Queue.new(mode: :min, &comparator)`
76
-
77
- Creates a new priority queue. Mode can be `:min` (default) or `:max`. An optional block provides a custom comparator.
78
-
79
- ### `#push(item, priority:)` / `#<<`
80
-
81
- Adds an item with the given priority. Returns self. The `<<` operator accepts a hash: `queue << { item: 'x', priority: 1 }`.
82
-
83
- ### `#pop`
84
-
85
- Removes and returns the highest-priority item. Returns `nil` if empty.
86
-
87
- ### `#peek`
88
-
89
- Returns the highest-priority item without removing it. Returns `nil` if empty.
90
-
91
- ### `#size` / `#empty?`
92
-
93
- Returns the number of items or whether the queue is empty.
94
-
95
- ### `#change_priority(item, new_priority)`
96
-
97
- Updates the priority of an existing item and re-heapifies. Raises `ArgumentError` if the item is not found.
98
-
99
- ### `#to_a`
100
-
101
- Returns all items sorted by priority.
102
-
103
- ### `#include?(item)`
104
-
105
- Returns `true` if the item is in the queue.
106
-
107
- ### `#clear`
108
-
109
- Removes all items from the queue.
110
-
111
- ### `#merge(other)`
112
-
113
- 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 |
114
90
 
115
91
  ## Development
116
92
 
117
- ```sh
93
+ ```bash
118
94
  bundle install
119
95
  bundle exec rspec
120
96
  bundle exec rubocop
@@ -122,4 +98,4 @@ bundle exec rubocop
122
98
 
123
99
  ## License
124
100
 
125
- MIT License. See [LICENSE](LICENSE) for details.
101
+ MIT
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Philiprehberger
4
4
  module PriorityQueue
5
- VERSION = '0.1.4'
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.4
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,
@@ -51,5 +51,6 @@ requirements: []
51
51
  rubygems_version: 3.5.22
52
52
  signing_key:
53
53
  specification_version: 4
54
- summary: Binary heap priority queue with min/max modes and custom comparators
54
+ summary: Binary heap priority queue with min/max modes, custom comparators, and priority
55
+ updates
55
56
  test_files: []