Skip to content

Add draw support for loading external DSL path files - #27

Closed
kalashnikovisme wants to merge 3 commits into
mainfrom
codex/implement-draw-method-in-someclient
Closed

Add draw support for loading external DSL path files#27
kalashnikovisme wants to merge 3 commits into
mainfrom
codex/implement-draw-method-in-someclient

Conversation

@kalashnikovisme

Copy link
Copy Markdown
Member

Motivation

  • Allow reusable path trees to be authored in separate Ruby DSL files and loaded into a client with a simple draw 'relative/path' call so nested path/response/root_method declarations can be kept in external files.

Description

  • Added draw(file_name) to Purple::Client which resolves file_name relative to the caller file, auto-appends .rb when missing, and evaluates the file in the client class context via instance_eval.
  • The draw helper raises clear LoadError messages when the caller file cannot be detected or when the target DSL file does not exist.
  • Added a unit-spec fixture file spec/purple/support/drawn_client/v1.rb which declares a v1/warehouses path and response schema.
  • Added DrawnClient and a new RSpec case in spec/purple/client_spec.rb which uses draw 'support/drawn_client/v1' and asserts the generated warehouses root method invokes the correct URL and returns the parsed response.

Testing

  • Attempted bundle exec rspec spec/purple/client_spec.rb, but it could not run because the rspec executable/gems were not available in this environment.
  • Attempted bundle install, but the install was blocked by a network 403 Forbidden from rubygems.org in this environment.
  • Performed syntax checks with ruby -c lib/purple/client.rb, ruby -c spec/purple/client_spec.rb, and ruby -c spec/purple/support/drawn_client/v1.rb, and all returned Syntax OK.

Codex Task

@kalashnikovisme
kalashnikovisme deleted the codex/implement-draw-method-in-someclient branch February 18, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant