ruby_api_pack_core 0.1.0

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.
data/CLAUDE.md ADDED
@@ -0,0 +1,105 @@
1
+ # CLAUDE.md - Ruby API Pack Core
2
+
3
+ ## Project Identity
4
+
5
+ **Gem:** `ruby_api_pack_core`
6
+ **Owner:** PHCDevworks
7
+ **Primary implementation agent:** Claude Code
8
+
9
+ This repository is a Ruby gem providing the shared HTTP client foundation used
10
+ by every `ruby_api_pack_*` gem (ActiveCampaign, Cloudways, WordPress, and any
11
+ future vendor pack). It owns the connection wrapper's HTTParty/Oj plumbing,
12
+ the response-shape validator, and the `configure`/`configuration` singleton
13
+ pattern, so each vendor-specific gem only implements its own authentication
14
+ headers, `Configuration` fields, and resource endpoint classes. This file is
15
+ the implementation guide for Claude Code. Read `AGENTS.md` first for shared
16
+ agent boundaries.
17
+
18
+ This gem has no vendor-specific knowledge of any kind — no API tokens, no
19
+ endpoint paths, no resource classes. If a change requires knowing which
20
+ third-party API is being called, it belongs in the consuming
21
+ `ruby_api_pack_*` gem, not here.
22
+
23
+ ## Commit Policy
24
+
25
+ Claude Code does not create commits in this repository unless explicitly asked.
26
+ Prepare changes, run validation, and leave commit, tag, push, and release
27
+ authority to the human maintainer.
28
+
29
+ ## Development Workflow
30
+
31
+ ```bash
32
+ bundle install
33
+ bundle exec rspec
34
+ bundle exec rubocop
35
+ gem build ruby_api_pack_core.gemspec
36
+ ```
37
+
38
+ ## Ruby Gem Contract
39
+
40
+ The public behavior surface is:
41
+
42
+ - `lib/ruby_api_pack_core.rb`
43
+ - `lib/ruby_api_pack_core/configurable.rb`
44
+ - `lib/ruby_api_pack_core/connection/base.rb`
45
+ - `lib/ruby_api_pack_core/handlers/response_validator.rb`
46
+ - `README.md`
47
+
48
+ Connection, validator, configurable, and response behavior changes require
49
+ matching specs and a changelog entry, because every downstream
50
+ `ruby_api_pack_*` gem inherits this behavior directly.
51
+
52
+ ## Implementation Rules
53
+
54
+ 1. Keep this gem free of vendor-specific knowledge — no API tokens, endpoint
55
+ paths, resource classes, or third-party response shapes.
56
+ 2. `RubyApiPackCore::Connection::Base` is a template-method base class.
57
+ Subclasses in consuming gems must only override `#auth_headers`; do not add
58
+ vendor-specific public methods to `Base` itself.
59
+ 3. Preserve the public method names on `Connection::Base`
60
+ (`api_get`/`api_post`/`api_put`/`api_delete`) and
61
+ `Handlers::ResponseValidator` (`validate_response`) unless the change is
62
+ intentionally breaking — every `ruby_api_pack_*` gem depends on this
63
+ surface staying stable.
64
+ 4. Any breaking change here requires a coordinated migration plan across
65
+ `ruby_api_pack_active_campaign`, `ruby_api_pack_cloudways`, and
66
+ `ruby_api_pack_wordpress` before or alongside the release — do not publish
67
+ a breaking `ruby_api_pack_core` version without updating consumers.
68
+ 5. Avoid broad refactors unless they directly support the requested change.
69
+ 6. Do not expose credentials, tokens, or vendor response bodies in logs,
70
+ fixtures, docs, or test output — this gem's specs use synthetic fixtures
71
+ only, never real API traffic.
72
+
73
+ ## Testing Expectations
74
+
75
+ - `Connection::Base` changes need GET, POST, PUT, DELETE, parsing, and
76
+ failure specs, exercised against a dummy subclass (see
77
+ `spec/ruby_api_pack_core/connection/base_spec.rb`).
78
+ - `Handlers::ResponseValidator` changes need specs for every `expected_type`
79
+ branch plus the Rails/non-Rails logging paths.
80
+ - `Configurable` changes need specs covering memoization and multiple
81
+ `configure` calls.
82
+ - Security-sensitive changes should include both success and failure coverage.
83
+
84
+ ## Documentation Expectations
85
+
86
+ Update:
87
+
88
+ - `README.md` for public installation, usage, or contract changes.
89
+ - `CHANGELOG.md` for every behavior-impacting change.
90
+ - `SECURITY.md` when security reporting or guidance changes.
91
+ - AI docs when agent workflows or authority boundaries change.
92
+ - The consuming gems' own `CLAUDE.md`/`README.md` if this gem's contract
93
+ changes in a way that affects how they subclass or extend it.
94
+
95
+ ## Release Procedure
96
+
97
+ 1. Update `lib/ruby_api_pack_core/version.rb`.
98
+ 2. Move changelog notes from `[Unreleased]` into a dated version section.
99
+ 3. Run `bundle exec rspec`.
100
+ 4. Run `bundle exec rubocop`.
101
+ 5. Confirm `ruby_api_pack_active_campaign`, `ruby_api_pack_cloudways`, and
102
+ `ruby_api_pack_wordpress` still pass their own validation gates against the
103
+ new version before publishing, if the change is anything other than
104
+ additive.
105
+ 6. Build and publish only when the maintainer explicitly approves.
data/CODEX.md ADDED
@@ -0,0 +1,66 @@
1
+ # CODEX.md - Ruby API Pack Core
2
+
3
+ ## Role
4
+
5
+ Codex owns documentation standardization, release readiness, repo hygiene,
6
+ production stabilization, and configuration consistency for this Ruby gem.
7
+ Claude Code leads implementation changes. Human maintainers own final commit,
8
+ merge, tag, publish, and release decisions.
9
+
10
+ ## Default Workflow
11
+
12
+ 1. Inspect the current working tree and preserve unrelated local changes.
13
+ 2. Read the relevant source, specs, and docs before editing.
14
+ 3. Make focused changes using existing Ruby and RSpec patterns.
15
+ 4. Update README, changelog, and AI docs when public guidance changes.
16
+ 5. Run `bundle exec rspec` and `bundle exec rubocop` when feasible.
17
+ 6. Build with `gem build ruby_api_pack_core.gemspec` when packaging or release
18
+ metadata changed.
19
+ 7. Report any validation that could not be run.
20
+
21
+ ## Documentation Scope
22
+
23
+ Codex may update:
24
+
25
+ - `README.md`
26
+ - `CONTRIBUTING.md`
27
+ - `SECURITY.md`
28
+ - `CODE_OF_CONDUCT.md`
29
+ - `CHANGELOG.md`
30
+ - `ROADMAP.md`
31
+ - `TODO.md`
32
+ - `AGENTS.md`, `CLAUDE.md`, `CODEX.md`, `COPILOT.md`, `JULES.md`
33
+ - `.github/` templates and assistant instructions
34
+ - `.codex/` workspace notes
35
+
36
+ ## Review Scope
37
+
38
+ When reviewing changes, Codex checks:
39
+
40
+ 1. `Connection::Base`, `Handlers::ResponseValidator`, and `Configurable`
41
+ behavior drift.
42
+ 2. Missing RSpec coverage for connection, validator, or configurable changes.
43
+ 3. Vendor-specific knowledge (API tokens, endpoint paths, resource classes)
44
+ accidentally introduced into this gem.
45
+ 4. Inconsistent response parsing or error behavior.
46
+ 5. README or changelog drift from the public behavior surface.
47
+ 6. CI and release workflow mismatch with documented commands.
48
+ 7. Breaking changes that were not flagged as requiring coordination with
49
+ `ruby_api_pack_active_campaign`, `ruby_api_pack_cloudways`, and
50
+ `ruby_api_pack_wordpress`.
51
+
52
+ ## Validation Commands
53
+
54
+ ```bash
55
+ bundle exec rspec
56
+ bundle exec rubocop
57
+ gem build ruby_api_pack_core.gemspec
58
+ ```
59
+
60
+ ## Hard Limits
61
+
62
+ - Do not publish the gem unless explicitly asked.
63
+ - Do not create commits, tags, or releases unless explicitly asked.
64
+ - Do not overwrite unrelated local changes.
65
+ - Do not add vendor-specific knowledge, real credentials, or sensitive
66
+ payloads to documentation or tests.
@@ -0,0 +1,132 @@
1
+ # Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the overall
26
+ community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official email address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ development@phcdevworks.com.
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
+
124
+ For answers to common questions about this code of conduct, see the FAQ at
125
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
+ [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
+ [Mozilla CoC]: https://github.com/mozilla/diversity
131
+ [FAQ]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,111 @@
1
+ # Contributing to Ruby API Pack Core
2
+
3
+ Thanks for helping improve `ruby_api_pack_core`. This gem is maintained by
4
+ PHCDevworks as the shared HTTP client foundation for every `ruby_api_pack_*`
5
+ gem — it has no vendor-specific knowledge of its own.
6
+
7
+ ## Development Setup
8
+
9
+ 1. Clone the repository.
10
+ 2. Install dependencies with `bundle install`.
11
+ 3. Run `bundle exec rspec`.
12
+ 4. Run `bundle exec rubocop`.
13
+ 5. Build the gem with `gem build ruby_api_pack_core.gemspec` when preparing a
14
+ release or changing packaging metadata.
15
+
16
+ ## Project Structure
17
+
18
+ - `lib/ruby_api_pack_core.rb`: public gem entry point
19
+ - `lib/ruby_api_pack_core/configurable.rb`: shared `configure`/`configuration`
20
+ singleton mixin
21
+ - `lib/ruby_api_pack_core/connection/base.rb`: shared HTTParty/Oj connection
22
+ template class
23
+ - `lib/ruby_api_pack_core/handlers/response_validator.rb`: shared
24
+ response-shape validator
25
+ - `lib/ruby_api_pack_core/version.rb`: gem version
26
+ - `spec/`: RSpec coverage for the connection base class, validator, and
27
+ configurable mixin, tested against synthetic dummy classes
28
+
29
+ ## Contribution Guidelines
30
+
31
+ ### Connection, validator, and configurable changes
32
+
33
+ 1. Keep public method names stable
34
+ (`api_get`/`api_post`/`api_put`/`api_delete`, `validate_response`,
35
+ `configure`/`configuration`) unless the change is intentionally breaking.
36
+ 2. Add or update focused specs for any behavior change, exercised against a
37
+ dummy subclass or dummy module — never against a real vendor API.
38
+ 3. Keep this gem free of vendor-specific knowledge. If a change requires
39
+ knowing which third-party API is being called, it belongs in a consuming
40
+ `ruby_api_pack_*` gem instead.
41
+ 4. Any breaking change here must be coordinated with
42
+ `ruby_api_pack_active_campaign`, `ruby_api_pack_cloudways`, and
43
+ `ruby_api_pack_wordpress` before or alongside release.
44
+
45
+ ### Code and tooling
46
+
47
+ - Follow the repo's RuboCop configuration.
48
+ - Prefer small, pattern-aligned changes.
49
+ - Keep comments brief and only add them when they explain a non-obvious reason.
50
+ - Preserve unrelated local changes.
51
+ - Do not create commits, tags, releases, or publish gems unless explicitly
52
+ asked by a maintainer.
53
+
54
+ ## Behavior-Impacting Change Checklist
55
+
56
+ Use this checklist when touching any public behavior surface:
57
+
58
+ - `lib/ruby_api_pack_core.rb`
59
+ - `lib/ruby_api_pack_core/configurable.rb`
60
+ - `lib/ruby_api_pack_core/connection/base.rb`
61
+ - `lib/ruby_api_pack_core/handlers/response_validator.rb`
62
+ - `README.md`
63
+
64
+ Before merge:
65
+
66
+ 1. Update or add focused specs.
67
+ 2. Run `bundle exec rspec`.
68
+ 3. Run `bundle exec rubocop`.
69
+ 4. Build with `gem build ruby_api_pack_core.gemspec` when packaging metadata
70
+ changed.
71
+ 5. Update `README.md` if installation, usage, or contract guidance changed.
72
+ 6. Update `CHANGELOG.md` under `[Unreleased]`.
73
+ 7. Classify the change as additive, behavior change, breaking, or docs/config
74
+ only in the pull request.
75
+ 8. If the change is breaking, note the required follow-up in the three
76
+ consuming gems.
77
+
78
+ ## Pull Request Checklist
79
+
80
+ 1. Keep the change focused.
81
+ 2. Fill out every section of `.github/pull_request_template.md`.
82
+ 3. Link an issue or write `N/A`.
83
+ 4. Include a concise summary and reviewer notes.
84
+ 5. Leave blocked checklist items unchecked with a short note.
85
+
86
+ ## Release Hygiene
87
+
88
+ For maintainers, a release should keep these records aligned:
89
+
90
+ 1. Update `lib/ruby_api_pack_core/version.rb`.
91
+ 2. Move relevant `CHANGELOG.md` `[Unreleased]` notes into a dated version entry.
92
+ 3. Run `bundle exec rspec`.
93
+ 4. Run `bundle exec rubocop`.
94
+ 5. Build the gem from the matching source state.
95
+ 6. Confirm the three consuming gems still pass their own validation gates
96
+ against the new version, if the change is anything other than additive.
97
+ 7. Publish release notes from the matching changelog entry.
98
+
99
+ ## Questions
100
+
101
+ Open an issue if you need direction before making a larger change.
102
+
103
+ ## Code of Conduct
104
+
105
+ By participating in this project, you agree to follow the
106
+ [Code of Conduct](CODE_OF_CONDUCT.md).
107
+
108
+ ## License
109
+
110
+ By contributing, you agree that your contributions will be licensed under the
111
+ MIT License.
data/COPILOT.md ADDED
@@ -0,0 +1,30 @@
1
+ # COPILOT.md - Ruby API Pack Core
2
+
3
+ ## Role
4
+
5
+ GitHub Copilot is a support assistant for local development in this repository.
6
+ It may help with Ruby, RSpec, documentation, and small refactors, but it does
7
+ not own architecture, release decisions, or final handoff authority.
8
+
9
+ ## Repository Conventions
10
+
11
+ - Keep HTTParty/Oj plumbing centralized in `Connection::Base`.
12
+ - Keep this gem free of vendor-specific knowledge (API tokens, endpoint paths,
13
+ resource classes) — that belongs in the consuming `ruby_api_pack_*` gems.
14
+ - Add focused RSpec coverage for behavior changes.
15
+ - Keep README and changelog aligned with public usage.
16
+ - Do not create commits unless explicitly asked.
17
+
18
+ ## Validation
19
+
20
+ Run these before handing off non-trivial changes:
21
+
22
+ ```bash
23
+ bundle exec rspec
24
+ bundle exec rubocop
25
+ ```
26
+
27
+ ## Security
28
+
29
+ Never suggest adding real API tokens, credentials, or vendor response bodies
30
+ to source control. This gem's specs use synthetic fixtures only.
data/JULES.md ADDED
@@ -0,0 +1,34 @@
1
+ # JULES.md - Ruby API Pack Core
2
+
3
+ ## Role
4
+
5
+ Google Jules may perform bounded automated maintenance in this repository.
6
+ Jules should keep work small, mechanical, and easy to review.
7
+
8
+ ## Appropriate Work
9
+
10
+ - Dependency update follow-ups
11
+ - Small documentation corrections
12
+ - CI or configuration cleanup
13
+ - Narrow test maintenance
14
+ - Formatting updates aligned with RuboCop
15
+
16
+ ## Not Appropriate
17
+
18
+ - Changes to `Connection::Base`, `Handlers::ResponseValidator`, or
19
+ `Configurable` public method signatures
20
+ - Public API redesigns
21
+ - Release publishing
22
+ - Large refactors
23
+ - Security-sensitive behavior changes without human review
24
+
25
+ ## Validation
26
+
27
+ Before handoff, run:
28
+
29
+ ```bash
30
+ bundle exec rspec
31
+ bundle exec rubocop
32
+ ```
33
+
34
+ If validation cannot run, report why.
data/MIT-LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Copyright Bradley J Potts
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.