Skip to content

Commit

Permalink
Rename Command.from_argv to .parse
Browse files Browse the repository at this point in the history
  • Loading branch information
apexatoll committed Sep 19, 2023
1 parent 91de0d4 commit deebf12
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/kangaru/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def initialize(controller:, action:, arguments:)
@arguments = arguments
end

def self.from_argv(tokens)
def self.parse(tokens)
controller = InputParsers::ControllerParser.parse(tokens)
action = InputParsers::ActionParser.parse(tokens)
arguments = InputParsers::ArgumentParser.parse(tokens)
Expand Down
2 changes: 1 addition & 1 deletion sig/kangaru/command.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ module Kangaru
arguments: Hash[Symbol, untyped]
) -> void

def self.from_argv: (Array[String]) -> Command
def self.parse: (Array[String]) -> Command
end
end
4 changes: 2 additions & 2 deletions spec/kangaru/command_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
end
end

describe ".from_argv" do
subject(:command) { described_class.from_argv(tokens) }
describe ".parse" do
subject(:command) { described_class.parse(tokens) }

let(:tokens) { %w[foo bar baz] }

Expand Down

0 comments on commit deebf12

Please sign in to comment.