| name | ruby-style |
|---|---|
| description | Use when editing Ruby in lib/ or spec/ and you need layout, naming, and idioms consistent with this gem. |
- Adding new files under
lib/contentstack/orspec/ - Refactoring while keeping style aligned with existing code
- Choosing where to place helpers (e.g.
lib/util.rbvs. domain classes)
lib/contentstack.rb: top-level module, YARD overview, delegates tocontentstack_utilsfor render helpers.lib/contentstack/*.rb: one main concept per file (client,api,query, etc.).lib/util.rb: refinements / utilities consumed viausing Utilitywhere already established—follow existing patterns before introducing new global monkey patches.spec/*_spec.rb: mirror behavior under test; shared setup belongs inspec/spec_helper.rbonly when it is truly global (WebMock, SimpleCov, default stubs).
- Prefer explicit validation in
Contentstack::Client#initializewithContentstack::Errorfor invalid configuration. - Use
ActiveSupportpatterns (e.g.present?) where already used inContentstack::APIand client code—stay consistent within a file. - Keep public method names stable; breaking renames require a major version strategy and README / CHANGELOG updates.
- Match existing spellings in public APIs (e.g.
retryDelay,retryLimit) for backward compatibility even if Ruby style guides suggest snake_case for new APIs—when adding new options, prefer snake_case unless extending an existing options hash that is documented with camelCase keys.
skills/contentstack-ruby-sdk/SKILL.md— public API boundariesskills/testing/SKILL.md— spec patternsCHANGELOG.md— record user-visible behavior changes