Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

290
Views
How to silence `Shell` (ruby stdlib) `notify` feature?
require 'shell'
sh = Shell.new
sh.verbose = false
sh.debug = false
print sh.system('date')

Expected output

Wed Nov 10 13:08:09 EST 2021

Observed output

shell(#<Th:0x00007fd016064058 run>): /bin/date
Wed Nov 10 13:08:09 EST 2021

The unwanted line comes from Shell::CommandProcessor#notify

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

After some investigation there seems to be a confusing design flaw (or feature?) in Shell. Initally it seems you should be able to mutate verbose and debug on an instance of Shell, but it turns out the root notify method itself lives in the class, not the instance.

Hence instance level settings will only have limited effect, as the class method Shell.notify will be unaware of instance settings.

Solution - use class-level settings instead:

Shell.verbose = false
Shell.debug   = false

Output will now be only:

Wed Nov 10 13:08:09 EST 2021
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!