readout 0.2.0 → 0.2.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: 3b916687af6e5b720d58adf3f4e842405529340f447510c9929fe40c77130590
4
- data.tar.gz: d97935c3995909c5b8d149cf488d2ffb3f4e4b85833023360e7e5b1945ba453c
3
+ metadata.gz: 65a550bbaa11d7ea07cbb2cf8cc6dceaf611354dedea94bb99740d27afc55569
4
+ data.tar.gz: '00995800efa634f0da429569f2084dba7d5be9aee74bd0c78860847833552902'
5
5
  SHA512:
6
- metadata.gz: b25addb3ea16c1e68f29ac9f3d8b615be4f6e38045c1664faec5d6749bee9eadbdf6c7e673d5cf0fa87d3ec870549b648d8a490475a25b1bfb1192405c5289cb
7
- data.tar.gz: e80886070d7cb964153592a5a22febd5e7638205ada15f0a851cbccd37a05cfc80b3e78e52d63ee711b945cfdadcf60190a532d14ce91c0aa08a2289b6a9b2f0
6
+ metadata.gz: 67ba649e19014d3d7668b1d34ec1e3be501f5425cc3fb4d874621a86045a583328f067c8e9f274dddf6936893a44c3c39116b2fe1d6eb4993fb2c0a36a2299c6
7
+ data.tar.gz: '074875441dc2070fe0fc6193250c6bd1447e64c3181925104a934556a9f4ba3ba554e874652cb72329c57adf4cdcf9a5d5a6efc60e33b2c205e169c24a7782d8'
data/CHANGELOG.md CHANGED
@@ -6,6 +6,12 @@ All notable changes to this project are documented here, following
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.2.1] - 2026-09-26
10
+
11
+ ### Changed
12
+ - readout's info, install and develop agents are now written by the_local's
13
+ authoring task instead of by hand.
14
+
9
15
  ## [0.2.0] - 2026-09-25
10
16
 
11
17
  ### Added
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Readout
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
@@ -35,11 +35,19 @@ Use this local whenever code needs a named, explained metric value.
35
35
  returns a `Readout::Result`; a lambda works:
36
36
 
37
37
  ```ruby
38
- source = ->(inputs) { Readout::Result.new(value: 0.42, shape: :scalar, as_of: Time.now, exact: true) }
38
+ source = ->(inputs) do
39
+ Readout::Result.new(
40
+ value: inputs[:won].fdiv(inputs[:qualified]),
41
+ shape: :scalar,
42
+ as_of: Time.now,
43
+ exact: true
44
+ )
45
+ end
39
46
  ```
40
47
 
41
48
  Stat does not check what the source returns, so the source must build the
42
- `Readout::Result` itself.
49
+ `Readout::Result` itself. readout accepts any object for `shape`, `as_of` and
50
+ `exact`, so ask the developer which values the project uses for `shape`.
43
51
  2. Ask the developer where the number comes from, and put that lookup inside the
44
52
  source. The source is the only place that knows where the number comes from.
45
53
  3. Build the Stat with its description and the source:
@@ -34,7 +34,9 @@ develop local.
34
34
  ## Conventions
35
35
 
36
36
  - A **Stat** is one metric: a key plus its title, definition, calculation, unit
37
- and timeframe, and the source it reads from.
37
+ and timeframe, and the source it reads from. Only the key is required.
38
+ - Reading a Stat hands its inputs to the source unchanged and returns whatever
39
+ the source returns. readout itself computes nothing.
38
40
  - The **definition** says what the metric captures, and the **calculation** says
39
41
  how its value is computed, both in plain English.
40
42
  - A **source** is any object that responds to `call(inputs)` and returns a Result.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: readout-install
3
- description: Use to hook readout into a project — adding the gem to the Gemfile and loading it in plain Ruby.
3
+ description: Use to hook readout into a project — adding the gem to the Gemfile and loading it with require.
4
4
  tools: Bash, Read, Edit
5
5
  scope: self-describing metrics — defining a Stat, reading it through a pluggable source, and the normalized Result it returns
6
6
  ---
@@ -16,22 +16,27 @@ Add it to any project that defines or displays metrics.
16
16
  ## Interface
17
17
 
18
18
  - `gem "readout"` — the Gemfile line that adds readout to the bundle.
19
- - `require "readout"` — loads readout in code that is not auto-required by Bundler.
19
+ - `require "readout"` — loads readout in code that Bundler does not auto-require.
20
20
 
21
21
  ## How to use it
22
22
 
23
23
  1. Ask the developer how to source the gem. Use `gem "readout"` for the published
24
24
  gem, or `gem "readout", github: "tylercschneider/readout"` for the repository.
25
- Add the chosen line to the host's `Gemfile`.
26
- 2. Run `bundle install`.
27
- 3. In a Rails app, `Bundler.require` loads readout, so stop here. Anywhere else, add
28
- `require "readout"` at the top of the file that first uses it.
29
- 4. Confirm it loads: `bundle exec ruby -e 'require "readout"; puts Readout::VERSION'`
25
+ 2. If the host is itself a gem, ask the developer whether readout is a runtime
26
+ dependency of it. If it is, add `spec.add_dependency "readout"` to the host's
27
+ gemspec, and if step 1 chose the repository, also add that line to the host's
28
+ `Gemfile`. If it is not, or the host is an app, add the line from step 1 to the
29
+ host's `Gemfile`.
30
+ 3. Run `bundle install`.
31
+ 4. In a Rails app, `Bundler.require` loads readout, so skip this step. Anywhere
32
+ else, add `require "readout"` at the top of the file that first uses it.
33
+ 5. Confirm it loads: `bundle exec ruby -e 'require "readout"; puts Readout::VERSION'`
30
34
  prints a version.
31
35
 
32
36
  ## Conventions
33
37
 
34
38
  - readout needs Ruby 3.2 or newer.
35
39
  - It adds no generators, initializers, migrations or configuration files, so
36
- setup edits the `Gemfile` and nothing else.
40
+ setup edits the `Gemfile` or gemspec and nothing else.
41
+ - After a readout upgrade, run `bundle update readout` and repeat step 5.
37
42
  - Defining and reading metrics is the develop local's job.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: readout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - tylercschneider