module Githuh
Constants
- BANNER
- BINARY
- VERSION
Attributes
in_test[RW]
launcher[RW]
Public Class Methods
configure_kernel_behavior!(help: false)
click to toggle source
# File lib/githuh.rb, line 34 def configure_kernel_behavior!(help: false) Kernel.module_eval do alias original_exit exit alias original_puts puts alias original_warn warn end Kernel.module_eval do def puts(*args) ::Githuh.stdout.puts(*args) end def warn(*args) ::Githuh.stderr.puts(*args) end end if in_test Kernel.module_eval do def exit(code) ::Githuh.stderr.puts("RSpec: intercepted exit code: #{code}") end end elsif help Kernel.module_eval do def exit(_code) # for help, override default exit code with 0 original_exit(0) end end else Kernel.module_eval do def exit(code) original_exit(code) end end end Dry::CLI end
exit(code)
click to toggle source
# File lib/githuh.rb, line 53 def exit(code) ::Githuh.stderr.puts("RSpec: intercepted exit code: #{code}") end
puts(*args)
click to toggle source
# File lib/githuh.rb, line 42 def puts(*args) ::Githuh.stdout.puts(*args) end
restore_kernel_behavior!()
click to toggle source
# File lib/githuh.rb, line 75 def restore_kernel_behavior! Kernel.module_eval do alias exit original_exit alias puts original_puts alias warn original_warn alias exit original_exit end end
warn(*args)
click to toggle source
# File lib/githuh.rb, line 46 def warn(*args) ::Githuh.stderr.puts(*args) end