price_waterfall 0.1.0 → 0.1.1

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: 87a787eab8d9a632f44dd4564c07af18d01debcbdc359ac0a9e9db4c0441aba3
4
- data.tar.gz: 52932f5e2835586763498e74487231d993faf39ffe021b5298a207466c1759f1
3
+ metadata.gz: 317beae9cd5516d448e093afa00e35314eb24fdc9c8e4b5682f9d745a261c316
4
+ data.tar.gz: 9f743ee469662b650ecf71dfa1508456dee48b53edb576bb309353ce7280f30f
5
5
  SHA512:
6
- metadata.gz: cb13943e4571fa6c50355c1e75167a684dd4c830c4152f9772590b319aab2b9ecc80bcaaa7a3f24f5b8f3cacf8871bc5d88d27ded107fa543be9e1989ac1a35d
7
- data.tar.gz: 4a48e143aca0fbe66c2159840084baa092c853af01c6a7de4fb5797f4cee15edcc5ea732286fceca22a82690cbcf04086ef82ef9a360fa6a008d9c3f028b56d8
6
+ metadata.gz: 9b7ec91354c6734ea4c96f6f8455539781df37236b2841d69203317a8ec629e7996053d704ceb7b170a513a9506245a559c52affd914e5776be0fac21b1cb99e
7
+ data.tar.gz: c607510743060a3ce8f1c78f613d7fbca5773e43c9c37cdfc0e673059077b3230051fb9a321d364fa97a25e55b807b98ba7d90b42d381d86181d8ff1de261c78
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.1] - 2026-12-02
4
+
5
+ ### Changed
6
+
7
+ - The gem description now covers loading rules as data (JSON, YAML or a database), validation
8
+ and the registry, as well as the DSL.
9
+
3
10
  ## [0.1.0] - 2026-12-01
4
11
 
5
12
  First release.
data/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # PriceWaterfall
2
2
 
3
+ [![Gem Version](https://img.shields.io/gem/v/price_waterfall)](https://rubygems.org/gems/price_waterfall)
4
+ [![CI](https://github.com/PratikBaravkar/price_waterfall/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/PratikBaravkar/price_waterfall/actions/workflows/main.yml)
5
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue)](LICENSE.txt)
6
+
3
7
  A Ruby gem for layered, explainable price calculation in integer cents. **Every price explains itself.**
4
8
 
5
9
  Prices in B2B and e-commerce apps pass through many layers: list price, price lists,
@@ -35,7 +39,7 @@ result.explain
35
39
  - [Results and explain](#results-and-explain): the trace, `to_h` for audit trails
36
40
  - Reference: [Steps](#steps), [Value sources](#value-sources), [Conditions in data](#conditions-in-data),
37
41
  [Time windows](#time-windows)
38
- - [Security](#security) · [Development](#development)
42
+ - [Security](#security) · [Versioning](#versioning) · [Contributing](#contributing)
39
43
 
40
44
  ## Installation
41
45
 
@@ -58,6 +62,9 @@ require "price_waterfall"
58
62
  It has no runtime dependencies and needs Ruby 3.2 or newer (CI tests 3.2, 3.3, 3.4 and 4.0).
59
63
  Rails is not required.
60
64
 
65
+ This README is the guide; the API reference for every public class and method is on
66
+ [rubydoc.info](https://rubydoc.info/gems/price_waterfall).
67
+
61
68
  ## Design rules
62
69
 
63
70
  - Pure Ruby, no runtime dependencies; works with or without Rails.
@@ -572,11 +579,33 @@ their own prices:
572
579
  - **Errors are typed.** Every error is a `PriceWaterfall::Error` naming the step; your own code's
573
580
  exceptions are wrapped in `StepError` with the original as `cause` ([errors](#errors)).
574
581
 
575
- ## Development
582
+ ## Versioning
583
+
584
+ PriceWaterfall follows [Semantic Versioning](https://semver.org). Until 1.0, a minor release
585
+ (0.1 → 0.2) may change the public API; patch releases (0.1.0 → 0.1.1) only fix bugs. Pin the
586
+ minor version (`gem "price_waterfall", "~> 0.1.0"`) and read the
587
+ [changelog](CHANGELOG.md) before upgrading. Every change is listed there.
588
+
589
+ ## Contributing
590
+
591
+ Bug reports and pull requests are welcome on
592
+ [GitHub](https://github.com/PratikBaravkar/price_waterfall/issues). For a new feature or a
593
+ change to existing behaviour, please open an issue first so we can agree on the design.
576
594
 
577
595
  After checking out the repo, run `bin/setup` to install dependencies, then `bundle exec rake`
578
596
  to run the specs and RuboCop. `bin/console` gives an interactive prompt.
579
597
 
598
+ A pull request needs:
599
+
600
+ - **Specs for the change.** `bundle exec rake` fails below 100% line and branch coverage.
601
+ - **A clean RuboCop run**, without disabling cops in `lib/`.
602
+ - **Working README examples.** Every Ruby example in this README runs as a spec
603
+ (`spec/readme_examples_spec.rb`); add `# => value` to show and check a result.
604
+ - **A changelog entry** under `## [Unreleased]` in [CHANGELOG.md](CHANGELOG.md) for anything users
605
+ will notice.
606
+
607
+ CI runs the suite on Ruby 3.2, 3.3, 3.4 and 4.0.
608
+
580
609
  ## License
581
610
 
582
611
  Available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -2,5 +2,5 @@
2
2
 
3
3
  module PriceWaterfall
4
4
  # Gem version, following semantic versioning.
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: price_waterfall
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pratik Baravkar
@@ -10,9 +10,12 @@ cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: Define a pricing waterfall (base price, overrides, percentage and fixed
13
- discounts, volume tiers, rounding) with a small DSL. Every result returns the final
14
- price in integer cents plus a step-by-step trace explaining how it was reached.
15
- Pure Ruby, no runtime dependencies, works with or without Rails.
13
+ discounts, volume tiers, rounding) with a small Ruby DSL, or load the same rules
14
+ as data from JSON, YAML or a database, validated with every problem's path for admin
15
+ forms. Custom step types, value sources and operators are registered in Ruby, so
16
+ stored rules never run code. Every result returns the final price in integer cents
17
+ plus a step-by-step trace explaining how it was reached. Pure Ruby, no runtime dependencies,
18
+ works with or without Rails.
16
19
  email:
17
20
  - baravkarpratik5@gmail.com
18
21
  executables: []