paper_trail_diff 0.6.0 → 0.7.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 +49 -0
- data/README.md +92 -11
- data/lib/paper_trail_diff/activity_root_steps.rb +17 -7
- data/lib/paper_trail_diff/analysis_batch.rb +11 -7
- data/lib/paper_trail_diff/batched_root_versions.rb +21 -6
- data/lib/paper_trail_diff/live_endpoint_provider.rb +21 -2
- data/lib/paper_trail_diff/paper_trail_adapter.rb +63 -23
- data/lib/paper_trail_diff/root_version_plan.rb +16 -3
- data/lib/paper_trail_diff/root_version_selection.rb +43 -14
- data/lib/paper_trail_diff/step.rb +14 -5
- data/lib/paper_trail_diff/time_activity_timeline_builder.rb +86 -26
- data/lib/paper_trail_diff/time_version_range.rb +6 -3
- data/lib/paper_trail_diff/timeline_builder.rb +17 -8
- data/lib/paper_trail_diff/timeline_range.rb +6 -3
- data/lib/paper_trail_diff/timeline_snapshot_provider.rb +20 -4
- data/lib/paper_trail_diff/version.rb +1 -1
- data/lib/paper_trail_diff.rb +20 -12
- data/sig/generated/paper_trail_diff/activity_root_steps.rbs +7 -2
- data/sig/generated/paper_trail_diff/analysis_batch.rbs +6 -4
- data/sig/generated/paper_trail_diff/batched_root_versions.rbs +11 -4
- data/sig/generated/paper_trail_diff/live_endpoint_provider.rbs +9 -0
- data/sig/generated/paper_trail_diff/paper_trail_adapter.rbs +26 -10
- data/sig/generated/paper_trail_diff/root_version_plan.rbs +12 -2
- data/sig/generated/paper_trail_diff/root_version_selection.rbs +16 -2
- data/sig/generated/paper_trail_diff/step.rbs +5 -2
- data/sig/generated/paper_trail_diff/time_activity_timeline_builder.rbs +33 -12
- data/sig/generated/paper_trail_diff/time_version_range.rbs +4 -2
- data/sig/generated/paper_trail_diff/timeline_builder.rbs +5 -2
- data/sig/generated/paper_trail_diff/timeline_range.rbs +4 -2
- data/sig/generated/paper_trail_diff/timeline_snapshot_provider.rbs +11 -2
- data/sig/generated/paper_trail_diff.rbs +8 -8
- metadata +4 -4
|
@@ -10,13 +10,22 @@ module PaperTrailDiff
|
|
|
10
10
|
# : (tree: AssociationTree, traversal: AssociationTraversal, reload: bool) -> void
|
|
11
11
|
def initialize: (tree: AssociationTree, traversal: AssociationTraversal, reload: bool) -> void
|
|
12
12
|
|
|
13
|
+
# Loads each endpoint at most once for the life of this provider, which is
|
|
14
|
+
# one public call. A batch that resolves every root up front and then asks
|
|
15
|
+
# again for one of them costs nothing the second time, and every root in the
|
|
16
|
+
# result reflects the same instant rather than whenever its turn came.
|
|
13
17
|
# : (Array[untyped]) -> Hash[identity, untyped]
|
|
14
18
|
def call: (Array[untyped]) -> Hash[identity, untyped]
|
|
15
19
|
|
|
16
20
|
private
|
|
17
21
|
|
|
22
|
+
@loaded: Hash[identity, untyped]
|
|
23
|
+
|
|
18
24
|
@loader: untyped
|
|
19
25
|
|
|
26
|
+
# : (Array[untyped]) -> Hash[identity, untyped]
|
|
27
|
+
def known: (Array[untyped]) -> Hash[identity, untyped]
|
|
28
|
+
|
|
20
29
|
# : (Array[untyped]) -> Hash[Symbol, untyped]
|
|
21
30
|
def payload: (Array[untyped]) -> Hash[Symbol, untyped]
|
|
22
31
|
end
|
|
@@ -6,6 +6,9 @@ module PaperTrailDiff
|
|
|
6
6
|
# the only place allowed to know about both PaperTrail and the pure engine.
|
|
7
7
|
# Reconstruction logic lives in the collaborators it wires together.
|
|
8
8
|
class PaperTrailAdapter
|
|
9
|
+
# The only thing a wall-clock window can close on besides a later version.
|
|
10
|
+
CLOSE_ON_CURRENT: ::Symbol
|
|
11
|
+
|
|
9
12
|
# : (associations: Array[String | Symbol], ignore: ignore_option, ?reload_live_endpoints: bool) -> void
|
|
10
13
|
def initialize: (associations: Array[String | Symbol], ignore: ignore_option, ?reload_live_endpoints: bool) -> void
|
|
11
14
|
|
|
@@ -16,18 +19,18 @@ module PaperTrailDiff
|
|
|
16
19
|
# : (Array[comparison_input]) -> comparison_results
|
|
17
20
|
def compare_many: (Array[comparison_input]) -> comparison_results
|
|
18
21
|
|
|
19
|
-
# : (untyped, from: untyped, to: untyped, within: untyped, ?version_scope: untyped) -> Array[Step]
|
|
20
|
-
def timeline: (untyped, from: untyped, to: untyped, within: untyped, ?version_scope: untyped) -> Array[Step]
|
|
22
|
+
# : (untyped, from: untyped, to: untyped, within: untyped, ?version_scope: untyped, ?close_on: Symbol?) -> Array[Step]
|
|
23
|
+
def timeline: (untyped, from: untyped, to: untyped, within: untyped, ?version_scope: untyped, ?close_on: Symbol?) -> Array[Step]
|
|
21
24
|
|
|
22
|
-
# : (untyped, from: untyped, to: untyped, within: untyped, ?version_scope: untyped) -> Array[ActivityStep]
|
|
23
|
-
def activity_timeline: (untyped, from: untyped, to: untyped, within: untyped, ?version_scope: untyped) -> Array[ActivityStep]
|
|
25
|
+
# : (untyped, from: untyped, to: untyped, within: untyped, ?version_scope: untyped, ?close_on: Symbol?) -> Array[ActivityStep]
|
|
26
|
+
def activity_timeline: (untyped, from: untyped, to: untyped, within: untyped, ?version_scope: untyped, ?close_on: Symbol?) -> Array[ActivityStep]
|
|
24
27
|
|
|
25
|
-
# : (untyped, from: untyped, to: untyped, within: untyped, ?activity: bool, ?version_scope: untyped) -> Analysis
|
|
26
|
-
def analyze: (untyped, from: untyped, to: untyped, within: untyped, ?activity: bool, ?version_scope: untyped) -> Analysis
|
|
28
|
+
# : (untyped, from: untyped, to: untyped, within: untyped, ?activity: bool, ?version_scope: untyped, ?close_on: Symbol?) -> Analysis
|
|
29
|
+
def analyze: (untyped, from: untyped, to: untyped, within: untyped, ?activity: bool, ?version_scope: untyped, ?close_on: Symbol?) -> Analysis
|
|
27
30
|
|
|
28
31
|
# Analyzes many roots over one shared range, preparing their history once.
|
|
29
|
-
# : (Array[untyped], within: untyped, ?activity: bool, ?version_scope: untyped) -> Hash[identity, Analysis]
|
|
30
|
-
def analyze_many: (Array[untyped], within: untyped, ?activity: bool, ?version_scope: untyped) -> Hash[identity, Analysis]
|
|
32
|
+
# : (Array[untyped], within: untyped, ?activity: bool, ?version_scope: untyped, ?close_on: Symbol?) -> Hash[identity, Analysis]
|
|
33
|
+
def analyze_many: (Array[untyped], within: untyped, ?activity: bool, ?version_scope: untyped, ?close_on: Symbol?) -> Hash[identity, Analysis]
|
|
31
34
|
|
|
32
35
|
private
|
|
33
36
|
|
|
@@ -53,6 +56,19 @@ module PaperTrailDiff
|
|
|
53
56
|
|
|
54
57
|
@traversal_preparer: TraversalPreparer
|
|
55
58
|
|
|
59
|
+
# : (untyped, from: untyped, to: untyped, within: untyped, version_scope: untyped, live_endpoint: untyped) -> Analysis
|
|
60
|
+
def analyze_activity: (untyped, from: untyped, to: untyped, within: untyped, version_scope: untyped, live_endpoint: untyped) -> Analysis
|
|
61
|
+
|
|
62
|
+
# `close_on:` names what ends a wall-clock window, so it is meaningless for a
|
|
63
|
+
# range whose endpoints the caller already gave explicitly.
|
|
64
|
+
# : (Symbol?, untyped) -> bool
|
|
65
|
+
def close_on_current?: (Symbol?, untyped) -> bool
|
|
66
|
+
|
|
67
|
+
# A destroyed root has no current state to close on, and its own destroy
|
|
68
|
+
# version already terminates the history.
|
|
69
|
+
# : (untyped, Symbol?, untyped) -> untyped
|
|
70
|
+
def live_endpoint_for: (untyped, Symbol?, untyped) -> untyped
|
|
71
|
+
|
|
56
72
|
# : () -> void
|
|
57
73
|
def build_snapshotters: () -> void
|
|
58
74
|
|
|
@@ -65,8 +81,8 @@ module PaperTrailDiff
|
|
|
65
81
|
# : () -> ActivitySnapshotProvider
|
|
66
82
|
def build_activity_snapshotter: () -> ActivitySnapshotProvider
|
|
67
83
|
|
|
68
|
-
# : (untyped, from: untyped, to: untyped, within: untyped, ?version_scope: untyped) -> ActivityTimelineBuilder
|
|
69
|
-
def activity_builder: (untyped, from: untyped, to: untyped, within: untyped, ?version_scope: untyped) -> ActivityTimelineBuilder
|
|
84
|
+
# : (untyped, from: untyped, to: untyped, within: untyped, ?version_scope: untyped, ?live_endpoint: untyped) -> ActivityTimelineBuilder
|
|
85
|
+
def activity_builder: (untyped, from: untyped, to: untyped, within: untyped, ?version_scope: untyped, ?live_endpoint: untyped) -> ActivityTimelineBuilder
|
|
70
86
|
|
|
71
87
|
# : (untyped) -> void
|
|
72
88
|
def reject_live_habtm_activity!: (untyped) -> void
|
|
@@ -23,6 +23,11 @@ module PaperTrailDiff
|
|
|
23
23
|
|
|
24
24
|
attr_reader context_version: untyped
|
|
25
25
|
|
|
26
|
+
# The live record a window closes on when no later version can reveal its
|
|
27
|
+
# final mutation. It is a boundary, never a version, so it stays out of
|
|
28
|
+
# `versions` and out of anything that reconstructs from version history.
|
|
29
|
+
attr_reader closing_record: untyped
|
|
30
|
+
|
|
26
31
|
# The root versions this plan reports as mutations, which excludes any
|
|
27
32
|
# version present only to reveal what the last of them produced.
|
|
28
33
|
attr_reader mutations: Array[untyped]
|
|
@@ -34,12 +39,17 @@ module PaperTrailDiff
|
|
|
34
39
|
# : () -> RootVersionPlan
|
|
35
40
|
def self.empty: () -> RootVersionPlan
|
|
36
41
|
|
|
37
|
-
# : (versions: Array[untyped], steps: Array[[untyped, untyped]], ?context_version: untyped, ?reconstruction_versions: Array[untyped]?, ?mutations: Array[untyped]?) -> void
|
|
38
|
-
def initialize: (versions: Array[untyped], steps: Array[[ untyped, untyped ]], ?context_version: untyped, ?reconstruction_versions: Array[untyped]?, ?mutations: Array[untyped]?) -> void
|
|
42
|
+
# : (versions: Array[untyped], steps: Array[[untyped, untyped]], ?context_version: untyped, ?reconstruction_versions: Array[untyped]?, ?mutations: Array[untyped]?, ?closing_record: untyped) -> void
|
|
43
|
+
def initialize: (versions: Array[untyped], steps: Array[[ untyped, untyped ]], ?context_version: untyped, ?reconstruction_versions: Array[untyped]?, ?mutations: Array[untyped]?, ?closing_record: untyped) -> void
|
|
39
44
|
|
|
40
45
|
# : () -> bool
|
|
41
46
|
def empty?: () -> bool
|
|
42
47
|
|
|
48
|
+
# What the range's final state is read from, which is the live record when
|
|
49
|
+
# the window closes on current state and the last version otherwise.
|
|
50
|
+
# : () -> untyped
|
|
51
|
+
def final_endpoint: () -> untyped
|
|
52
|
+
|
|
43
53
|
# : (untyped) -> bool
|
|
44
54
|
def mutation?: (untyped) -> bool
|
|
45
55
|
|
|
@@ -10,10 +10,13 @@ module PaperTrailDiff
|
|
|
10
10
|
# Both the single-record and the batched selectors resolve this here, because
|
|
11
11
|
# the rule is subtle enough that two copies of it would drift apart.
|
|
12
12
|
class RootVersionSelection
|
|
13
|
+
# An error is a specification, so it names the way out as well as the wall.
|
|
14
|
+
# A window ending at the present can never gain a later version, which makes
|
|
15
|
+
# "write a checkpoint afterwards" impossible advice on its own.
|
|
13
16
|
INCOMPLETE: ::String
|
|
14
17
|
|
|
15
|
-
# : (in_range: Array[untyped], selected: Array[untyped], after_range: untyped, windowed: bool, ?context_required: bool, ?filtered: bool) -> void
|
|
16
|
-
def initialize: (in_range: Array[untyped], selected: Array[untyped], after_range: untyped, windowed: bool, ?context_required: bool, ?filtered: bool) -> void
|
|
18
|
+
# : (in_range: Array[untyped], selected: Array[untyped], after_range: untyped, windowed: bool, ?context_required: bool, ?filtered: bool, ?live_endpoint: untyped) -> void
|
|
19
|
+
def initialize: (in_range: Array[untyped], selected: Array[untyped], after_range: untyped, windowed: bool, ?context_required: bool, ?filtered: bool, ?live_endpoint: untyped) -> void
|
|
17
20
|
|
|
18
21
|
# : () -> RootVersionPlan
|
|
19
22
|
def call: () -> RootVersionPlan
|
|
@@ -28,10 +31,18 @@ module PaperTrailDiff
|
|
|
28
31
|
|
|
29
32
|
@in_range: Array[untyped]
|
|
30
33
|
|
|
34
|
+
@live_endpoint: untyped
|
|
35
|
+
|
|
31
36
|
@selected: Array[untyped]
|
|
32
37
|
|
|
33
38
|
@windowed: bool
|
|
34
39
|
|
|
40
|
+
# A window reaching past the last recorded version has only the live record
|
|
41
|
+
# left to show what its final mutation produced. That record is a closing
|
|
42
|
+
# boundary rather than a selected mutation, so it never joins `versions`.
|
|
43
|
+
# : (untyped) -> RootVersionPlan
|
|
44
|
+
def contiguous_plan: (untyped) -> RootVersionPlan
|
|
45
|
+
|
|
35
46
|
# An activity view still needs a root to reconstruct from even when no root
|
|
36
47
|
# version falls inside the window, because descendants may have moved.
|
|
37
48
|
# : () -> RootVersionPlan
|
|
@@ -44,6 +55,9 @@ module PaperTrailDiff
|
|
|
44
55
|
# : (untyped) -> RootVersionPlan
|
|
45
56
|
def filtered_plan: (untyped) -> RootVersionPlan
|
|
46
57
|
|
|
58
|
+
# : (Array[[untyped, untyped]], untyped) -> RootVersionPlan
|
|
59
|
+
def filtered_plan_for: (Array[[ untyped, untyped ]], untyped) -> RootVersionPlan
|
|
60
|
+
|
|
47
61
|
# Nothing can follow a destroy, so it never pairs into a step. It is still a
|
|
48
62
|
# selected mutation, and the activity view closes on the absence it leaves,
|
|
49
63
|
# so it has to stay a boundary or a filtered report loses the deletion
|
|
@@ -13,8 +13,11 @@ module PaperTrailDiff
|
|
|
13
13
|
|
|
14
14
|
attr_reader diff: Diff
|
|
15
15
|
|
|
16
|
-
#
|
|
17
|
-
|
|
16
|
+
# `to_version` is nil for the one step that closes on current state, which a
|
|
17
|
+
# window reaching past the last recorded version has to do. Read
|
|
18
|
+
# `to_boundary` instead when a caller may have opted into that.
|
|
19
|
+
# : (from_version: untyped, to_version: untyped, diff: Diff, ?captured_at: untyped) -> void
|
|
20
|
+
def initialize: (from_version: untyped, to_version: untyped, diff: Diff, ?captured_at: untyped) -> void
|
|
18
21
|
|
|
19
22
|
# : () -> bool
|
|
20
23
|
def empty?: () -> bool
|
|
@@ -22,8 +22,19 @@ module PaperTrailDiff
|
|
|
22
22
|
|
|
23
23
|
@tree: AssociationTree
|
|
24
24
|
|
|
25
|
-
# : () -> [ActivityHistory, RootVersionPlan, ActivityStep
|
|
26
|
-
def history_and_versions: () -> [ ActivityHistory, RootVersionPlan, ActivityStep
|
|
25
|
+
# : () -> [ActivityHistory, RootVersionPlan, ActivityStep?, RecordSnapshot?, untyped]
|
|
26
|
+
def history_and_versions: () -> [ ActivityHistory, RootVersionPlan, ActivityStep?, RecordSnapshot?, untyped ]
|
|
27
|
+
|
|
28
|
+
# : (RootVersionPlan, untyped) -> [ActivityHistory, RootVersionPlan, ActivityStep?, RecordSnapshot?, untyped]
|
|
29
|
+
def history_for: (RootVersionPlan, untyped) -> [ ActivityHistory, RootVersionPlan, ActivityStep?, RecordSnapshot?, untyped ]
|
|
30
|
+
|
|
31
|
+
# One live read serves both the closing activity step and the endpoint the
|
|
32
|
+
# analysis reports, which would otherwise reconstruct the graph twice.
|
|
33
|
+
# : (RootVersionPlan) -> RecordSnapshot?
|
|
34
|
+
def current_snapshot: (RootVersionPlan) -> RecordSnapshot?
|
|
35
|
+
|
|
36
|
+
# : (Array[untyped], untyped) -> Array[ActivityEvent]
|
|
37
|
+
def events_through: (Array[untyped], untyped) -> Array[ActivityEvent]
|
|
27
38
|
|
|
28
39
|
# : (Array[untyped], Array[ActivityEvent]) -> ActivityHistory
|
|
29
40
|
def build_history: (Array[untyped], Array[ActivityEvent]) -> ActivityHistory
|
|
@@ -39,22 +50,32 @@ module PaperTrailDiff
|
|
|
39
50
|
# : (Array[ActivityEvent], RootVersionPlan) -> Array[ActivityEvent]
|
|
40
51
|
def selected_events: (Array[ActivityEvent], RootVersionPlan) -> Array[ActivityEvent]
|
|
41
52
|
|
|
42
|
-
#
|
|
43
|
-
#
|
|
44
|
-
#
|
|
45
|
-
|
|
53
|
+
# A window either closes on the absence its final destruction leaves, or on
|
|
54
|
+
# current state when it reaches past everything recorded. Both are boundaries
|
|
55
|
+
# no version can supply.
|
|
56
|
+
# : (ActivityHistory, ActivityEvent?, RootVersionPlan, untyped, RecordSnapshot?) -> ActivityStep?
|
|
57
|
+
def closing_step: (ActivityHistory, ActivityEvent?, RootVersionPlan, untyped, RecordSnapshot?) -> ActivityStep?
|
|
58
|
+
|
|
59
|
+
# : (ActivityHistory, ActivityEvent) -> ActivityStep
|
|
60
|
+
def destroyed_step: (ActivityHistory, ActivityEvent) -> ActivityStep
|
|
61
|
+
|
|
62
|
+
# The last boundary reached is where current state is compared from, which
|
|
63
|
+
# is the final event rather than the final root version once descendants
|
|
64
|
+
# have moved since it.
|
|
65
|
+
# : (ActivityHistory, untyped, untyped, RecordSnapshot?) -> ActivityStep?
|
|
66
|
+
def current_step: (ActivityHistory, untyped, untyped, RecordSnapshot?) -> ActivityStep?
|
|
46
67
|
|
|
47
68
|
# : (ActivityEvent?) -> bool
|
|
48
69
|
def terminal_destroy?: (ActivityEvent?) -> bool
|
|
49
70
|
|
|
50
|
-
# : (Array[untyped]) -> void
|
|
51
|
-
def prepare_history: (Array[untyped]) -> void
|
|
71
|
+
# : (Array[untyped], ?end_at: untyped) -> void
|
|
72
|
+
def prepare_history: (Array[untyped], ?end_at: untyped) -> void
|
|
52
73
|
|
|
53
|
-
# : (Array[untyped]) -> Array[ActivityEvent]
|
|
54
|
-
def collect_events: (Array[untyped]) -> Array[ActivityEvent]
|
|
74
|
+
# : (Array[untyped], ?range_end: untyped) -> Array[ActivityEvent]
|
|
75
|
+
def collect_events: (Array[untyped], ?range_end: untyped) -> Array[ActivityEvent]
|
|
55
76
|
|
|
56
|
-
# : (Array[ActivityEvent], Array[ActivityEvent]) -> bool
|
|
57
|
-
def time_events?: (Array[ActivityEvent], Array[ActivityEvent]) -> bool
|
|
77
|
+
# : (Array[ActivityEvent], Array[ActivityEvent], RootVersionPlan) -> bool
|
|
78
|
+
def time_events?: (Array[ActivityEvent], Array[ActivityEvent], RootVersionPlan) -> bool
|
|
58
79
|
|
|
59
80
|
# : (ActivityEvent, Array[ActivityEvent]) -> bool
|
|
60
81
|
def later_event?: (ActivityEvent, Array[ActivityEvent]) -> bool
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
module PaperTrailDiff
|
|
4
4
|
# Selects in-range root versions plus one later reconstruction boundary.
|
|
5
5
|
class TimeVersionRange
|
|
6
|
-
# : (untyped, time_range: TimeRange, ?version_scope: untyped) -> void
|
|
7
|
-
def initialize: (untyped, time_range: TimeRange, ?version_scope: untyped) -> void
|
|
6
|
+
# : (untyped, time_range: TimeRange, ?version_scope: untyped, ?live_endpoint: untyped) -> void
|
|
7
|
+
def initialize: (untyped, time_range: TimeRange, ?version_scope: untyped, ?live_endpoint: untyped) -> void
|
|
8
8
|
|
|
9
9
|
# : (?context_required: bool) -> Array[untyped]
|
|
10
10
|
def select: (?context_required: bool) -> Array[untyped]
|
|
@@ -14,6 +14,8 @@ module PaperTrailDiff
|
|
|
14
14
|
|
|
15
15
|
private
|
|
16
16
|
|
|
17
|
+
@live_endpoint: untyped
|
|
18
|
+
|
|
17
19
|
@record: untyped
|
|
18
20
|
|
|
19
21
|
@time_range: TimeRange
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
module PaperTrailDiff
|
|
4
4
|
# Selects and compares a chronological slice of a record's version history.
|
|
5
5
|
class TimelineBuilder
|
|
6
|
-
# : (untyped, from: untyped, to: untyped, snapshotter: untyped, ?within: untyped, ?versions: Array[untyped]?, ?version_scope: untyped, ?plan: RootVersionPlan?) -> void
|
|
7
|
-
def initialize: (untyped, from: untyped, to: untyped, snapshotter: untyped, ?within: untyped, ?versions: Array[untyped]?, ?version_scope: untyped, ?plan: RootVersionPlan?) -> void
|
|
6
|
+
# : (untyped, from: untyped, to: untyped, snapshotter: untyped, ?within: untyped, ?versions: Array[untyped]?, ?version_scope: untyped, ?plan: RootVersionPlan?, ?live_endpoint: untyped) -> void
|
|
7
|
+
def initialize: (untyped, from: untyped, to: untyped, snapshotter: untyped, ?within: untyped, ?versions: Array[untyped]?, ?version_scope: untyped, ?plan: RootVersionPlan?, ?live_endpoint: untyped) -> void
|
|
8
8
|
|
|
9
9
|
# : () -> Array[Step]
|
|
10
10
|
def build: () -> Array[Step]
|
|
@@ -23,6 +23,9 @@ module PaperTrailDiff
|
|
|
23
23
|
# : (RootVersionPlan) -> [Array[Step], RecordSnapshot?, RecordSnapshot?]
|
|
24
24
|
def compare_history: (RootVersionPlan) -> [ Array[Step], RecordSnapshot?, RecordSnapshot? ]
|
|
25
25
|
|
|
26
|
+
# : (RootVersionPlan) -> Array[Step]
|
|
27
|
+
def build_steps: (RootVersionPlan) -> Array[Step]
|
|
28
|
+
|
|
26
29
|
# : () -> [Array[Step], nil, nil]
|
|
27
30
|
def empty_history: () -> [ Array[Step], nil, nil ]
|
|
28
31
|
|
|
@@ -11,8 +11,8 @@ module PaperTrailDiff
|
|
|
11
11
|
|
|
12
12
|
attr_reader time_range: TimeRange?
|
|
13
13
|
|
|
14
|
-
# : (untyped, from: untyped, to: untyped, within: untyped, ?versions: Array[untyped]?, ?version_scope: untyped, ?plan: RootVersionPlan?) -> void
|
|
15
|
-
def initialize: (untyped, from: untyped, to: untyped, within: untyped, ?versions: Array[untyped]?, ?version_scope: untyped, ?plan: RootVersionPlan?) -> void
|
|
14
|
+
# : (untyped, from: untyped, to: untyped, within: untyped, ?versions: Array[untyped]?, ?version_scope: untyped, ?plan: RootVersionPlan?, ?live_endpoint: untyped) -> void
|
|
15
|
+
def initialize: (untyped, from: untyped, to: untyped, within: untyped, ?versions: Array[untyped]?, ?version_scope: untyped, ?plan: RootVersionPlan?, ?live_endpoint: untyped) -> void
|
|
16
16
|
|
|
17
17
|
# A record with no versions has no first or last boundary to resolve, which
|
|
18
18
|
# is an empty history rather than a bad request.
|
|
@@ -42,6 +42,8 @@ module PaperTrailDiff
|
|
|
42
42
|
|
|
43
43
|
@from: untyped
|
|
44
44
|
|
|
45
|
+
@live_endpoint: untyped
|
|
46
|
+
|
|
45
47
|
@plan: RootVersionPlan?
|
|
46
48
|
|
|
47
49
|
@record: untyped
|
|
@@ -3,15 +3,24 @@
|
|
|
3
3
|
module PaperTrailDiff
|
|
4
4
|
# Gives TimelineBuilder one-argument access to a range-prepared snapshot store.
|
|
5
5
|
class TimelineSnapshotProvider
|
|
6
|
-
# : (HistoricalSnapshotStore) -> void
|
|
7
|
-
def initialize: (HistoricalSnapshotStore) -> void
|
|
6
|
+
# : (HistoricalSnapshotStore, ?live_snapshotter: untyped) -> void
|
|
7
|
+
def initialize: (HistoricalSnapshotStore, ?live_snapshotter: untyped) -> void
|
|
8
8
|
|
|
9
9
|
# : (untyped, Array[untyped]) -> void
|
|
10
10
|
def prepare: (untyped, Array[untyped]) -> void
|
|
11
11
|
|
|
12
|
+
# A window closing on current state ends at the live record rather than at a
|
|
13
|
+
# version, which is the one endpoint no version history can reconstruct.
|
|
12
14
|
# : (untyped) -> RecordSnapshot?
|
|
13
15
|
def call: (untyped) -> RecordSnapshot?
|
|
14
16
|
|
|
17
|
+
private
|
|
18
|
+
|
|
19
|
+
# : (untyped) -> RecordSnapshot?
|
|
20
|
+
def live_snapshot: (untyped) -> RecordSnapshot?
|
|
21
|
+
|
|
22
|
+
@live_snapshotter: untyped
|
|
23
|
+
|
|
15
24
|
@store: HistoricalSnapshotStore
|
|
16
25
|
end
|
|
17
26
|
end
|
|
@@ -17,24 +17,24 @@ module PaperTrailDiff
|
|
|
17
17
|
def self.compare_many: (Array[comparison_input], ?associations: Array[String | Symbol], ?ignore: ignore_option, ?reload_live_endpoints: bool) -> comparison_results
|
|
18
18
|
|
|
19
19
|
# Compares every adjacent reconstructed state in an inclusive version range.
|
|
20
|
-
# : (untyped, ?from: untyped, ?to: untyped, ?within: untyped, ?associations: Array[String | Symbol], ?ignore: ignore_option, ?version_scope: untyped) -> Array[Step]
|
|
21
|
-
def self.timeline: (untyped, ?from: untyped, ?to: untyped, ?within: untyped, ?associations: Array[String | Symbol], ?ignore: ignore_option, ?version_scope: untyped) -> Array[Step]
|
|
20
|
+
# : (untyped, ?from: untyped, ?to: untyped, ?within: untyped, ?associations: Array[String | Symbol], ?ignore: ignore_option, ?version_scope: untyped, ?close_on: Symbol?) -> Array[Step]
|
|
21
|
+
def self.timeline: (untyped, ?from: untyped, ?to: untyped, ?within: untyped, ?associations: Array[String | Symbol], ?ignore: ignore_option, ?version_scope: untyped, ?close_on: Symbol?) -> Array[Step]
|
|
22
22
|
|
|
23
23
|
# Compares adjacent root and selected-descendant activity boundaries.
|
|
24
24
|
# `reload_live_endpoints:` applies only when `to:` is a current record; the
|
|
25
25
|
# other range forms never read live state.
|
|
26
|
-
# : (untyped, ?from: untyped, ?to: untyped, ?within: untyped, ?associations: Array[String | Symbol], ?ignore: ignore_option, ?reload_live_endpoints: bool, ?version_scope: untyped) -> Array[ActivityStep]
|
|
27
|
-
def self.activity_timeline: (untyped, ?from: untyped, ?to: untyped, ?within: untyped, ?associations: Array[String | Symbol], ?ignore: ignore_option, ?reload_live_endpoints: bool, ?version_scope: untyped) -> Array[ActivityStep]
|
|
26
|
+
# : (untyped, ?from: untyped, ?to: untyped, ?within: untyped, ?associations: Array[String | Symbol], ?ignore: ignore_option, ?reload_live_endpoints: bool, ?version_scope: untyped, ?close_on: Symbol?) -> Array[ActivityStep]
|
|
27
|
+
def self.activity_timeline: (untyped, ?from: untyped, ?to: untyped, ?within: untyped, ?associations: Array[String | Symbol], ?ignore: ignore_option, ?reload_live_endpoints: bool, ?version_scope: untyped, ?close_on: Symbol?) -> Array[ActivityStep]
|
|
28
28
|
|
|
29
29
|
# Builds an endpoint diff and root-checkpoint timeline while normalizing each version once.
|
|
30
|
-
# : (untyped, ?from: untyped, ?to: untyped, ?within: untyped, ?associations: Array[String | Symbol], ?ignore: ignore_option, ?activity: bool, ?version_scope: untyped) -> Analysis
|
|
31
|
-
def self.analyze: (untyped, ?from: untyped, ?to: untyped, ?within: untyped, ?associations: Array[String | Symbol], ?ignore: ignore_option, ?activity: bool, ?version_scope: untyped) -> Analysis
|
|
30
|
+
# : (untyped, ?from: untyped, ?to: untyped, ?within: untyped, ?associations: Array[String | Symbol], ?ignore: ignore_option, ?activity: bool, ?version_scope: untyped, ?close_on: Symbol?) -> Analysis
|
|
31
|
+
def self.analyze: (untyped, ?from: untyped, ?to: untyped, ?within: untyped, ?associations: Array[String | Symbol], ?ignore: ignore_option, ?activity: bool, ?version_scope: untyped, ?close_on: Symbol?) -> Analysis
|
|
32
32
|
|
|
33
33
|
# Analyzes many roots over one shared time window, preparing their selected
|
|
34
34
|
# history once for the batch instead of once per record. Roots with no
|
|
35
35
|
# versions in the window return an empty `Analysis`.
|
|
36
|
-
# : (Array[untyped], ?within: untyped, ?associations: Array[String | Symbol], ?ignore: ignore_option, ?activity: bool, ?version_scope: untyped) -> Hash[identity, Analysis]
|
|
37
|
-
def self.analyze_many: (Array[untyped], ?within: untyped, ?associations: Array[String | Symbol], ?ignore: ignore_option, ?activity: bool, ?version_scope: untyped) -> Hash[identity, Analysis]
|
|
36
|
+
# : (Array[untyped], ?within: untyped, ?associations: Array[String | Symbol], ?ignore: ignore_option, ?activity: bool, ?version_scope: untyped, ?close_on: Symbol?) -> Hash[identity, Analysis]
|
|
37
|
+
def self.analyze_many: (Array[untyped], ?within: untyped, ?associations: Array[String | Symbol], ?ignore: ignore_option, ?activity: bool, ?version_scope: untyped, ?close_on: Symbol?) -> Hash[identity, Analysis]
|
|
38
38
|
|
|
39
39
|
# Returns the association macros this release can normalize.
|
|
40
40
|
# : () -> Array[Symbol]
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: paper_trail_diff
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alex Williams
|
|
@@ -200,11 +200,11 @@ licenses:
|
|
|
200
200
|
metadata:
|
|
201
201
|
allowed_push_host: https://rubygems.org
|
|
202
202
|
bug_tracker_uri: https://github.com/aheathwilliams/paper_trail_diff/issues
|
|
203
|
-
changelog_uri: https://github.com/aheathwilliams/paper_trail_diff/blob/v0.
|
|
204
|
-
documentation_uri: https://github.com/aheathwilliams/paper_trail_diff/blob/v0.
|
|
203
|
+
changelog_uri: https://github.com/aheathwilliams/paper_trail_diff/blob/v0.7.1/CHANGELOG.md
|
|
204
|
+
documentation_uri: https://github.com/aheathwilliams/paper_trail_diff/blob/v0.7.1/README.md
|
|
205
205
|
homepage_uri: https://github.com/aheathwilliams/paper_trail_diff
|
|
206
206
|
rubygems_mfa_required: 'true'
|
|
207
|
-
source_code_uri: https://github.com/aheathwilliams/paper_trail_diff/tree/v0.
|
|
207
|
+
source_code_uri: https://github.com/aheathwilliams/paper_trail_diff/tree/v0.7.1
|
|
208
208
|
rdoc_options: []
|
|
209
209
|
require_paths:
|
|
210
210
|
- lib
|