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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/readout/version.rb +1 -1
- data/the_local/agents/readout-develop.md +10 -2
- data/the_local/agents/readout-info.md +3 -1
- data/the_local/agents/readout-install.md +13 -8
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 65a550bbaa11d7ea07cbb2cf8cc6dceaf611354dedea94bb99740d27afc55569
|
|
4
|
+
data.tar.gz: '00995800efa634f0da429569f2084dba7d5be9aee74bd0c78860847833552902'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
data/lib/readout/version.rb
CHANGED
|
@@ -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)
|
|
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
|
|
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
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
`
|
|
29
|
-
|
|
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.
|