mirror of
https://github.com/elicpeter/nyx.git
synced 2026-07-09 20:52:11 +02:00
refactor(dynamic): add recursive dependency resolution for Java, Go, and Ruby receivers, expand corresponding tests
This commit is contained in:
parent
0e8c900078
commit
acec041676
10 changed files with 366 additions and 10 deletions
|
|
@ -0,0 +1,26 @@
|
|||
# Benign control for recursively constructed Ruby dependencies.
|
||||
class ShellRunner
|
||||
def run(command)
|
||||
command.gsub('NYX_PWN_CMDI', '')
|
||||
end
|
||||
end
|
||||
|
||||
class UserRepository
|
||||
def initialize(shell_runner)
|
||||
@shell_runner = shell_runner
|
||||
end
|
||||
|
||||
def find(input)
|
||||
@shell_runner.run(input)
|
||||
end
|
||||
end
|
||||
|
||||
class UserService
|
||||
def initialize(user_repository)
|
||||
@user_repository = user_repository
|
||||
end
|
||||
|
||||
def run(input)
|
||||
@user_repository.find(input)
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
# Class-method fixture with recursively constructed Ruby dependencies.
|
||||
class ShellRunner
|
||||
def run(command)
|
||||
`true #{command}`
|
||||
end
|
||||
end
|
||||
|
||||
class UserRepository
|
||||
def initialize(shell_runner)
|
||||
@shell_runner = shell_runner
|
||||
end
|
||||
|
||||
def find(input)
|
||||
@shell_runner.run(input)
|
||||
end
|
||||
end
|
||||
|
||||
class UserService
|
||||
def initialize(user_repository)
|
||||
@user_repository = user_repository
|
||||
end
|
||||
|
||||
def run(input)
|
||||
@user_repository.find(input)
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue