ecoportal-api-v2 3.3.2 → 3.3.4
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 +18 -3
- data/lib/ecoportal/api/common/content/double_model/attributable/nesting/cascaded_callback.rb +1 -1
- data/lib/ecoportal/api/v2_version.rb +1 -1
- metadata +1 -13
- data/.gitignore +0 -23
- data/.markdownlint.json +0 -4
- data/.rspec +0 -3
- data/.rubocop.yml +0 -101
- data/.ruby-version +0 -1
- data/.yardopts +0 -10
- data/CLAUDE.md +0 -82
- data/Gemfile +0 -6
- data/Rakefile +0 -36
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/ecoportal-api-v2.gemspec +0 -40
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c89de46bf0ec5496e672a071c0c402f5b7c4c4e227b01639e48c46affa0d9bf8
|
|
4
|
+
data.tar.gz: dbf0124f2f65d2701aefe6ed338a873a759577e206b20021d88475237799a594
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a0216dc9983b1889b8d512e1b5b3c2868a28907b4b00b3a22f2f72482bf0cf174586627e287d93e18776af64853047148de47349c5f86440afbf75b3cb0bdc9f
|
|
7
|
+
data.tar.gz: 220919e3926f1d9cd1b06d93828ef5e1485f699eb5aa7caa882b9b6b4210e7ed8b87495c88497c7a725ef290a91b7debd6f590d93f3e6ce73512d5399ef565cd
|
data/CHANGELOG.md
CHANGED
|
@@ -2,14 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## [3.3.
|
|
5
|
+
## [3.3.4] - 2026-08-13
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Fixed
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
- Packaging-only republish with the allowlisted gemspec. `3.3.3` shipped internal repository
|
|
10
|
+
content (`.ai-assistance/` tooling and notes, `.claude/settings.json`) to rubygems.org via the
|
|
11
|
+
old denylist `spec.files`. `3.3.4` is the identical `lib/` code packaged clean; `3.3.3` will
|
|
12
|
+
be yanked.
|
|
13
|
+
|
|
14
|
+
## [3.3.3] - 2026-07-05
|
|
10
15
|
|
|
11
16
|
### Fixed
|
|
12
17
|
|
|
18
|
+
- **`_cascaded_attributes_trace` — Ruby 3.x block-param order (TypeError crash).** In
|
|
19
|
+
`DoubleModel::Attributable::Nesting::CascadedCallback`, `_cascaded_attributes.each.with_object(out_trace)`
|
|
20
|
+
yields `(element, memo)`, but the block read them swapped (`|out, (attribute, obj_k)|`), so
|
|
21
|
+
`(attribute, obj_k)` destructured the **accumulator hash** and `attribute` became the trace `Hash` →
|
|
22
|
+
`send(<hash>)` raised `"… is not a symbol nor a string" (TypeError)` on **any** cascaded operation
|
|
23
|
+
(e.g. `Diffable#as_update` / `DiffService`) over a model with nested attributes. Latent because
|
|
24
|
+
Ruby 2.x tolerated the arg order; fatal under Ruby 3.x (crashed the live act-gov TOOCS integration
|
|
25
|
+
via the `ecoportal-api-graphql` consumer). Swapped to `|(attribute, obj_k), out|` (commit `6a2b1b5`).
|
|
26
|
+
**Regression spec added** (`spec/…/double_model_spec.rb`).
|
|
27
|
+
|
|
13
28
|
## [3.3.2] - 2026-06-05
|
|
14
29
|
|
|
15
30
|
### Added
|
data/lib/ecoportal/api/common/content/double_model/attributable/nesting/cascaded_callback.rb
CHANGED
|
@@ -178,7 +178,7 @@ module Ecoportal::API::Common::Content::DoubleModel::Attributable::Nesting
|
|
|
178
178
|
nested_attrs: _cascaded_attributes.keys,
|
|
179
179
|
attributes: {}
|
|
180
180
|
}.merge(trace || {}).tap do |out_trace|
|
|
181
|
-
_cascaded_attributes.each.with_object(out_trace) do |
|
|
181
|
+
_cascaded_attributes.each.with_object(out_trace) do |(attribute, obj_k), out|
|
|
182
182
|
next unless (obj = send(attribute))
|
|
183
183
|
|
|
184
184
|
obj_k_path = key_path.dup.push(obj_k)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ecoportal-api-v2
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.3.
|
|
4
|
+
version: 3.3.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Oscar Segura
|
|
@@ -171,21 +171,9 @@ executables: []
|
|
|
171
171
|
extensions: []
|
|
172
172
|
extra_rdoc_files: []
|
|
173
173
|
files:
|
|
174
|
-
- ".gitignore"
|
|
175
|
-
- ".markdownlint.json"
|
|
176
|
-
- ".rspec"
|
|
177
|
-
- ".rubocop.yml"
|
|
178
|
-
- ".ruby-version"
|
|
179
|
-
- ".yardopts"
|
|
180
174
|
- CHANGELOG.md
|
|
181
|
-
- CLAUDE.md
|
|
182
|
-
- Gemfile
|
|
183
175
|
- LICENSE
|
|
184
176
|
- README.md
|
|
185
|
-
- Rakefile
|
|
186
|
-
- bin/console
|
|
187
|
-
- bin/setup
|
|
188
|
-
- ecoportal-api-v2.gemspec
|
|
189
177
|
- lib/ecoportal/api-v2.rb
|
|
190
178
|
- lib/ecoportal/api/common.v2.rb
|
|
191
179
|
- lib/ecoportal/api/common/concerns.rb
|
data/.gitignore
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# it's a gem, ignore the lockfile
|
|
2
|
-
Gemfile.lock
|
|
3
|
-
|
|
4
|
-
# build artifacts
|
|
5
|
-
*.gem
|
|
6
|
-
/.bundle/
|
|
7
|
-
/vendor/bundle
|
|
8
|
-
/spec/reports/
|
|
9
|
-
/tmp/
|
|
10
|
-
/pkg/
|
|
11
|
-
|
|
12
|
-
/.vscode
|
|
13
|
-
.solargraph.yml
|
|
14
|
-
|
|
15
|
-
# docs
|
|
16
|
-
/.yardoc
|
|
17
|
-
/_yardoc/
|
|
18
|
-
/coverage/
|
|
19
|
-
/doc/
|
|
20
|
-
|
|
21
|
-
# rspec failure tracking
|
|
22
|
-
.rspec_status
|
|
23
|
-
scratch.rb
|
data/.markdownlint.json
DELETED
data/.rspec
DELETED
data/.rubocop.yml
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
AllCops:
|
|
2
|
-
TargetRubyVersion: 3.2
|
|
3
|
-
Exclude:
|
|
4
|
-
- 'config/routes.rb'
|
|
5
|
-
NewCops: enable
|
|
6
|
-
|
|
7
|
-
Metrics/ClassLength:
|
|
8
|
-
Max: 500
|
|
9
|
-
Metrics/ModuleLength:
|
|
10
|
-
Max: 300
|
|
11
|
-
Metrics/MethodLength:
|
|
12
|
-
Max: 50
|
|
13
|
-
Metrics/AbcSize:
|
|
14
|
-
Max: 30
|
|
15
|
-
Metrics/ParameterLists:
|
|
16
|
-
Max: 5
|
|
17
|
-
CountKeywordArgs: false
|
|
18
|
-
Metrics/BlockLength:
|
|
19
|
-
CountAsOne: ['array', 'heredoc', 'method_call']
|
|
20
|
-
Max: 50
|
|
21
|
-
Metrics/CyclomaticComplexity:
|
|
22
|
-
Max: 30
|
|
23
|
-
Metrics/PerceivedComplexity:
|
|
24
|
-
Max: 30
|
|
25
|
-
|
|
26
|
-
Style/AccessorGrouping:
|
|
27
|
-
Enabled: false
|
|
28
|
-
Style/ConditionalAssignment:
|
|
29
|
-
Enabled: false
|
|
30
|
-
Style/BlockDelimiters:
|
|
31
|
-
BracesRequiredMethods: ['log']
|
|
32
|
-
Style/HashSyntax:
|
|
33
|
-
EnforcedShorthandSyntax: either
|
|
34
|
-
EnforcedStyle: no_mixed_keys
|
|
35
|
-
Style/ArgumentsForwarding:
|
|
36
|
-
UseAnonymousForwarding: false
|
|
37
|
-
Style/ClassAndModuleChildren:
|
|
38
|
-
Enabled: false
|
|
39
|
-
Style/FrozenStringLiteralComment:
|
|
40
|
-
Enabled: false
|
|
41
|
-
Style/StringLiterals:
|
|
42
|
-
Enabled: false
|
|
43
|
-
Style/StringLiteralsInInterpolation:
|
|
44
|
-
Enabled: false
|
|
45
|
-
Style/Documentation:
|
|
46
|
-
Enabled: false
|
|
47
|
-
Style/CommentedKeyword:
|
|
48
|
-
Enabled: false
|
|
49
|
-
Style/MultilineBlockChain:
|
|
50
|
-
Enabled: false
|
|
51
|
-
Style/AndOr:
|
|
52
|
-
Enabled: false
|
|
53
|
-
Style/Alias:
|
|
54
|
-
EnforcedStyle: prefer_alias_method
|
|
55
|
-
Style/FetchEnvVar:
|
|
56
|
-
Enabled: false
|
|
57
|
-
Style/RegexpLiteral:
|
|
58
|
-
EnforcedStyle: mixed
|
|
59
|
-
AllowInnerSlashes: true
|
|
60
|
-
|
|
61
|
-
Layout/HashAlignment:
|
|
62
|
-
EnforcedColonStyle: table
|
|
63
|
-
EnforcedHashRocketStyle: table
|
|
64
|
-
Layout/LeadingCommentSpace:
|
|
65
|
-
Enabled: false
|
|
66
|
-
AllowGemfileRubyComment: true
|
|
67
|
-
Layout/ParameterAlignment:
|
|
68
|
-
Enabled: false
|
|
69
|
-
Layout/MultilineMethodDefinitionBraceLayout:
|
|
70
|
-
EnforcedStyle: symmetrical
|
|
71
|
-
Layout/LineLength:
|
|
72
|
-
Enabled: true
|
|
73
|
-
Layout/SpaceInsideHashLiteralBraces:
|
|
74
|
-
Enabled: false
|
|
75
|
-
Layout/SpaceInsideBlockBraces:
|
|
76
|
-
Enabled: false
|
|
77
|
-
Layout/SpaceAroundOperators:
|
|
78
|
-
Enabled: false
|
|
79
|
-
Layout/ExtraSpacing:
|
|
80
|
-
AllowForAlignment: true
|
|
81
|
-
AllowBeforeTrailingComments: true
|
|
82
|
-
Layout/AccessModifierIndentation:
|
|
83
|
-
EnforcedStyle: indent
|
|
84
|
-
Layout/DotPosition:
|
|
85
|
-
EnforcedStyle: trailing
|
|
86
|
-
Layout/MultilineMethodCallIndentation:
|
|
87
|
-
EnforcedStyle: indented
|
|
88
|
-
Layout/FirstHashElementIndentation:
|
|
89
|
-
Enabled: false
|
|
90
|
-
Layout/EmptyLineAfterGuardClause:
|
|
91
|
-
Enabled: false
|
|
92
|
-
|
|
93
|
-
Naming/VariableNumber:
|
|
94
|
-
EnforcedStyle: snake_case
|
|
95
|
-
CheckSymbols: false
|
|
96
|
-
Naming/MethodParameterName:
|
|
97
|
-
AllowedNames: ['x', 'y', 'i', 'j', 'id', 'io']
|
|
98
|
-
Naming/RescuedExceptionsVariableName:
|
|
99
|
-
Enabled: false
|
|
100
|
-
Naming/BlockForwarding:
|
|
101
|
-
Enabled: false
|
data/.ruby-version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
3.2.2
|
data/.yardopts
DELETED
data/CLAUDE.md
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
# CLAUDE.md — ecoportal-api-v2
|
|
2
|
-
|
|
3
|
-
AI agent instructions for this repository.
|
|
4
|
-
|
|
5
|
-
**Cross-cutting architecture context lives in `ecoportal-api-graphql` — see its `CLAUDE.md` and `.claude/` folder for the full dependency map, project history, and shared skills.**
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Repository Role
|
|
10
|
-
|
|
11
|
-
`ecoportal-api-v2` is the **REST API v2 gem**, extending `ecoportal-api` with a rich content model layer (pages, registers, people, S3 file handling). It provides the `Ecoportal::API::V2` and `Ecoportal::API::Common::Content` namespaces.
|
|
12
|
-
|
|
13
|
-
**Position in chain:**
|
|
14
|
-
```
|
|
15
|
-
ecoportal-api
|
|
16
|
-
↓
|
|
17
|
-
ecoportal-api-v2 ← THIS REPO
|
|
18
|
-
↓
|
|
19
|
-
ecoportal-api-graphql
|
|
20
|
-
↓
|
|
21
|
-
eco-helpers
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
**Remote:** https://gitlab.ecoportal.co.nz/oscar/ecoportal-api-v2.git
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
## Key Folder Layout
|
|
29
|
-
|
|
30
|
-
```
|
|
31
|
-
lib/ecoportal/api/
|
|
32
|
-
common/
|
|
33
|
-
concerns/ Benchmarkable, Threadable mixins
|
|
34
|
-
content/ Core model infrastructure (see below)
|
|
35
|
-
v2/
|
|
36
|
-
page/ Page model — sections, stages, components, forces, permissions
|
|
37
|
-
page/component/ All field types (text, number, date, selection, files, geo, etc.)
|
|
38
|
-
pages/ Pages collection, stage results, tasks
|
|
39
|
-
registers/ Register models — search results, stage/page results
|
|
40
|
-
people/ V2 people endpoint
|
|
41
|
-
s3/ S3 file upload/download infrastructure
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### `Common::Content` — the model engine
|
|
45
|
-
|
|
46
|
-
The most complex part of this gem. Key classes:
|
|
47
|
-
|
|
48
|
-
- `DoubleModel` — two-layer model (a "live" doc and a "patch" doc) with attribute DSL, diffing, nesting, and change tracking. Almost all V2 models inherit from this.
|
|
49
|
-
- `CollectionModel` — ordered collection with upsert/delete/mutation support.
|
|
50
|
-
- `ClassHelpers` — `class_resolver` macro for injectable class references (pattern shared with `ecoportal-api-graphql`).
|
|
51
|
-
- `DocHelpers`, `ModelHelpers`, `IncluderHelpers` — utility mixins for model construction.
|
|
52
|
-
|
|
53
|
-
---
|
|
54
|
-
|
|
55
|
-
## Namespace
|
|
56
|
-
|
|
57
|
-
- `Ecoportal::API::V2` — v2 REST resources
|
|
58
|
-
- `Ecoportal::API::Common::Content` — shared model infrastructure (consumed downstream)
|
|
59
|
-
- `Ecoportal::API::Common::Concerns` — threading and benchmarking mixins
|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
## Key Concerns
|
|
64
|
-
|
|
65
|
-
- `DoubleModel` is the foundational abstraction — understand it before modifying any V2 model.
|
|
66
|
-
- `Common::Content::ClassHelpers` mirrors the `ClassHelpers` in `ecoportal-api-graphql` — changes to one may need mirroring in the other.
|
|
67
|
-
- S3 upload is async with polling (`s3/files/poll.rb`) — timing-sensitive code.
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
## Backwards Compatibility
|
|
72
|
-
|
|
73
|
-
`eco-helpers` and `ecoportal-api-graphql` both depend on this gem. Changes to `Common::Content::*` or `V2::Page::*` interfaces must be checked against usage in both downstream gems before committing.
|
|
74
|
-
|
|
75
|
-
---
|
|
76
|
-
|
|
77
|
-
## Running Tests
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
bundle install
|
|
81
|
-
bundle exec rspec
|
|
82
|
-
```
|
data/Gemfile
DELETED
data/Rakefile
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
require "bundler/gem_tasks"
|
|
2
|
-
require "rspec/core/rake_task"
|
|
3
|
-
require 'rubocop/rake_task'
|
|
4
|
-
require "yard"
|
|
5
|
-
require "redcarpet"
|
|
6
|
-
|
|
7
|
-
desc "run the specs"
|
|
8
|
-
RSpec::Core::RakeTask.new(:spec)
|
|
9
|
-
|
|
10
|
-
desc "run rspec showing backtrace"
|
|
11
|
-
RSpec::Core::RakeTask.new(:spec_trace) do |task|
|
|
12
|
-
task.rspec_opts = ['--backtrace']
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
desc "run rspec stopping on first fail, and show backtrace"
|
|
16
|
-
RSpec::Core::RakeTask.new(:spec_fast) do |task|
|
|
17
|
-
task.rspec_opts = ['--fail-fast', '--backtrace']
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
desc "run rubocop diaplying cop names"
|
|
21
|
-
RuboCop::RakeTask.new(:rubocop) do |t|
|
|
22
|
-
t.options = ['--display-cop-names']
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
# default task name is yard
|
|
26
|
-
desc "Yard: generate all the documentation"
|
|
27
|
-
YARD::Rake::YardocTask.new(:doc) do |t|
|
|
28
|
-
#t.files = ['lib/**/*.rb']
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
desc "default task: runs rubocop and rspec"
|
|
32
|
-
task :default do
|
|
33
|
-
Rake::Task[:rubocop].invoke
|
|
34
|
-
ensure
|
|
35
|
-
Rake::Task[:spec].invoke
|
|
36
|
-
end
|
data/bin/console
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
|
|
3
|
-
require "bundler/setup"
|
|
4
|
-
require "ecoportal/api-v2"
|
|
5
|
-
|
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
|
8
|
-
|
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
10
|
-
# require "pry"
|
|
11
|
-
# Pry.start
|
|
12
|
-
|
|
13
|
-
require "pry"
|
|
14
|
-
Pry.start(__FILE__)
|
data/bin/setup
DELETED
data/ecoportal-api-v2.gemspec
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# rubocop:disable Gemspec/DevelopmentDependencies
|
|
2
|
-
lib = File.expand_path('lib', __dir__)
|
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
-
|
|
5
|
-
require 'ecoportal/api/v2_version'
|
|
6
|
-
|
|
7
|
-
Gem::Specification.new do |spec|
|
|
8
|
-
spec.name = 'ecoportal-api-v2'
|
|
9
|
-
spec.version = Ecoportal::API::GEM2_VERSION
|
|
10
|
-
spec.authors = ['Oscar Segura']
|
|
11
|
-
spec.email = ['oscar@ecoportal.co.nz']
|
|
12
|
-
|
|
13
|
-
spec.summary = "A collection of helpers for interacting with the ecoPortal MS's V2 API"
|
|
14
|
-
spec.homepage = "https://www.ecoportal.com"
|
|
15
|
-
spec.licenses = %w[MIT]
|
|
16
|
-
|
|
17
|
-
spec.metadata['rubygems_mfa_required'] = 'true'
|
|
18
|
-
|
|
19
|
-
spec.required_ruby_version = '>= 3.2.2'
|
|
20
|
-
|
|
21
|
-
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
22
|
-
f.match(%r{^(test|spec|features)/})
|
|
23
|
-
end
|
|
24
|
-
spec.bindir = 'exe'
|
|
25
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
26
|
-
spec.require_paths = ['lib']
|
|
27
|
-
|
|
28
|
-
spec.add_development_dependency 'pry', '~> 0.14'
|
|
29
|
-
spec.add_development_dependency 'rake', '>= 13.0.3', '< 14'
|
|
30
|
-
spec.add_development_dependency 'redcarpet', '>= 3.6.0', '< 4'
|
|
31
|
-
spec.add_development_dependency 'rspec', '>= 3.12.0', '< 4'
|
|
32
|
-
spec.add_development_dependency 'rubocop', '~> 1'
|
|
33
|
-
spec.add_development_dependency 'rubocop-rake', '~> 0'
|
|
34
|
-
spec.add_development_dependency 'yard', '~> 0.9'
|
|
35
|
-
|
|
36
|
-
spec.add_dependency 'ecoportal-api', '~> 0.10', '>= 0.10.16'
|
|
37
|
-
spec.add_dependency 'mime-types', '~> 3.5', '>= 3.5.2'
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
# rubocop:enable Gemspec/DevelopmentDependencies
|