Skip to content

rename provider to tool#1

Merged
motdotla merged 4 commits intomainfrom
tool
Feb 26, 2026
Merged

rename provider to tool#1
motdotla merged 4 commits intomainfrom
tool

Conversation

@motdotla
Copy link
Contributor

No description provided.

Copy link

@charliecreates charliecreates bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rename is implemented cleanly and includes backward compatibility, but the aliasing approach in lib/vestauth.rb could be made more explicit/maintainable (and ideally deprecate provider if the intent is migration). One spec description is slightly inconsistent with the new naming and could be clarified to keep tests serving as accurate documentation.

Summary of changes

What changed

  • Updated the README usage example to call Vestauth.tool.verify(...) instead of Vestauth.provider.verify(...).
  • In lib/vestauth.rb, renamed the public accessor from self.provider to self.tool (returning Provider).
  • Added a backward-compatible alias so Vestauth.provider continues to work via alias provider tool.
  • Updated specs to:
    • Assert Vestauth.tool returns Vestauth::Provider.
    • Use Vestauth.tool.verify(...) in verification-related examples.

Relevant files:

  • README.md
  • lib/vestauth.rb
  • spec/vestauth_spec.rb

Comment on lines 11 to 18
def self.tool
Provider
end

class << self
alias provider tool
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alias provider tool keeps backward compatibility, but the current placement (class << self block separated from the def self.tool) is a bit indirect and can be confusing to maintain. Since this is a module with singleton methods, you can define the alias directly on the singleton class in a tighter, more idiomatic way, and ideally add a short deprecation note so callers know to migrate.

Also, if this is intended as a rename rather than a permanent dual API, consider emitting a deprecation warning from provider to drive adoption (while keeping it non-breaking).

Suggestion

Consider restructuring to make the relationship explicit and optionally deprecate the old name:

module Vestauth
  def self.tool
    Provider
  end

  class << self
    def provider
      warn "Vestauth.provider is deprecated; use Vestauth.tool" if $VERBOSE
      tool
    end
  end
end

This keeps compatibility while encouraging migration. Reply with "@CharlieHelps yes please" if you'd like me to add a commit with this suggestion.

@charliecreates charliecreates bot removed the request for review from CharlieHelps February 26, 2026 01:36
@motdotla motdotla merged commit 25a71fa into main Feb 26, 2026
2 checks passed
@motdotla motdotla deleted the tool branch February 26, 2026 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant