require 'google/search'
is correct for your gem
The return value of false
means that Ruby found your gem library file google/search.rb
but has already parsed and loaded it. It would return true
only if the library had not already been loaded.
Reference: http://www.ruby-doc.org/core-2.1.1/Kernel.html#method-i-require
It is possible that the require has found a conflicting file - anything in the gem search path matching google/search.rb
could in theory be loaded, the gem name itself is not relevant other than .../gemname/lib
gets added to the search path. It is this potential for gems to claim file names from each other which drives conventions such as naming your main library file identically to the gem, but as long as one derives reasonably directly and/or uniquely from the other, it should be fine to use different names.
For a gem called google-search
, the advice on Rubygems says users should expect to use the require as you want it, so you are following normal Ruby convention here.