BernardK

BernardK

Programming Ruby 3.2 (5th Edition): B4.0 many places, require "name" or require name

@noelrappin

Many places have require “name”, other require name. If you want to have the same style everywhere, the following pages are concerned :

+++++ NOT page 117, last paragraph, When you require BigDecimal, which is OK because require is in the normal font

+++++ page 253, first line after the green Info :

Now the gem is ready to be used, which means that any Ruby program can require rspec and
                                                                -----> ^^^^^^^^^^^^^

+++++ page 256, last paragraph, first and second to last line :

Alternately, inside your code, before you use any gems, you can require bundler/setup, which
                                                         -----> ^^^^^^^^^^^^^^^^^^^^^
...
exec code that also has a require bundler/setup that’s fine, the management work will only be
                   -----> ^^^^^^^^^^^^^^^^^^^^^

+++++ page 257, fourth paragraph from bottom, two first lines :

Be default, when you engage Bundler via Bundler.require or require bundler/setup each gem will
                                                    -----> ^^^^^^^^^^^^^^^^^^^^^
be autoloaded under the name of the gem. In other words, gem rspec implies require rspec.
                                                                    -----> ^^^^^^^^^^^^^

+++++ page 261, second paragraph, two times with mistake (bundle instead of bundler) :

`require': cannot load such file -- bundle/setup (LoadError)
Did you mean?  bundler/setup
`require': cannot load such file -- bundle (LoadError)
Did you mean?  bundler

Shoul be : … rather than require “bundler/setup”, you just require
“bundler”

+++++ page 292, first paragraph, lines 2-3 :

There is the jj method, which you need to require json to have access to, and which creates
                                   -----> ^^^^^^^^^^^^
pretty-printed JSON. It also has y, which comes when you require yaml and produces the
                                                  -----> ^^^^^^^^^^^^

+++++ page 293, second paragraph, lines 1 + 3 :

Alternately, you can use require debug/open in the background process, which allows you to
                  -----> ^^^^^^^^^^^^^^^^^^
the first line; if you want the program to run normally, use require debug/open_nonstop. How
                                                      -----> ^^^^^^^^^^^^^^^^^^^^^^^^^^

+++++ page 296, in Pry, fourth paragraph, lines 2-3 :

that with the same code we used for the debugger earlier, just replacing require debug with
                                                                  -----> ^^^^^^^^^^^^^
require pry and the binding.break call with binding.pry, we get this:
^^^^^^^^^^^ <-----

+++++ page 497, paragraph 3, line 3, already mentioned in a previous post
+++++ page 507, in BigDecimal, fourth paragraph from bottom, first line, as mentioned in the previous post

+++++ page 509, second to last paragraph, line 3 :

The formatter module, which gets mixed in with require random/formatter, gives you a set of
                                        -----> ^^^^^^^^^^^^^^^^^^^^^^^^

+++++ page 510, second paragraph after code, first line :

With the line require random/formatter, you get a number of useful methods mixed in to Random.
       -----> ^^^^^^^^^^^^^^^^^^^^^^^^

+++++ page 567, in FileUtils, second paragraph, first line :

To use these methods, you need to require fileutils. All the methods here are defined as module
                           -----> ^^^^^^^^^^^^^^^^^

+++++ page 639, last paragraph, lines 1-2 :

When using JRuby, you can import any Java library in your Java class path. If you add require
java to your file
^^^^ <----- "java"

First Post!

noelrappin

noelrappin

Author of Modern Front-End Development for Rails

This is a great catch and I very much appreciate it

Popular Pragmatic Bookshelf topics Top

jesse050717
Title: Web Development with Clojure, Third Edition, pg 116 Hi - I just started chapter 5 and I am stuck on page 116 while trying to star...
New
sdmoralesma
Title: Web Development with Clojure, Third Edition - migrations/create not working: p159 When I execute the command: user=&gt; (create-...
New
herminiotorres
Hi @Margaret , On page VII the book tells us the example and snippets will be all using Elixir version 1.11 But on page 3 almost the en...
New
jskubick
I think I might have found a problem involving SwitchCompat, thumbTint, and trackTint. As entered, the SwitchCompat changes color to hol...
New
brunogirin
When I run the coverage example to report on missing lines, I get: pytest --cov=cards --report=term-missing ch7 ERROR: usage: pytest [op...
New
brunogirin
When trying to run tox in parallel as explained on page 151, I got the following error: tox: error: argument -p/–parallel: expected one...
New
brunogirin
When running tox for the first time, I got the following error: ERROR: InterpreterNotFound: python3.10 I realised that I was running ...
New
creminology
Skimming ahead, much of the following is explained in Chapter 3, but new readers (like me!) will hit a roadblock in Chapter 2 with their ...
New
andreheijstek
After running /bin/setup, the first error was: The foreman' command exists in these Ruby versions: That was easy to fix: gem install fore...
New
New

Other popular topics Top

AstonJ
If it’s a mechanical keyboard, which switches do you have? Would you recommend it? Why? What will your next keyboard be? Pics always w...
New
DevotionGeo
I know that -t flag is used along with -i flag for getting an interactive shell. But I cannot digest what the man page for docker run com...
New
AstonJ
In case anyone else is wondering why Ruby 3 doesn’t show when you do asdf list-all ruby :man_facepalming: do this first: asdf plugin-upd...
New
PragmaticBookshelf
“A Mystical Experience” Hero’s Journey with Paolo Perrotta @nusco Ever wonder how authoring books compares to writing articles?...
New
New
gagan7995
API 4 Path: /user/following/ Method: GET Description: Returns the list of all names of people whom the user follows Response [ { ...
New
AstonJ
Biggest jackpot ever apparently! :upside_down_face: I don’t (usually) gamble/play the lottery, but working on a program to predict the...
New
mafinar
This is going to be a long an frequently posted thread. While talking to a friend of mine who has taken data structure and algorithm cou...
New
DevotionGeo
I have always used antique keyboards like Cherry MX 1800 or Cherry MX 8100 and almost always have modified the switches in some way, like...
New
PragmaticBookshelf
A Ruby-Centric Chat with Noel Rappin @noelrappin Once you start noodling around with Ruby you quickly figure out, as Noel Rappi...
New

Sub Categories: