Avoid printing after running a command in the console

I open a very large YAML file. It takes time. But after its discovery, it prints all its contents - and this requires many times more time.

So, how can I avoid the print result in the Ruby console:

data = YAML.load_file( ... ) # some 1GB data file. 
+6
source share
2 answers

I assume you are doing this in the console. I usually only add ";: ok" if I don't want to see the result.

 data = YAML.load_file( ... ) ; :ok 
+12
source

In Pry, you can suppress output by simply adding a semicolon:

 pry(main)> data = YAML.load_file( ... ); pry(main)> 

Suppression of output is explained in the wiki here

+10
source

Source: https://habr.com/ru/post/896967/


All Articles