title: How can I add a method to the global scope in Ruby?
body: <p>Sinatra defines a number of methods which appear to live in the current scope, i.e. not within a class declaration. These are defined in the Sinatra gem. </p>
  
  <p>I'd like to be able to write a gem which will create a function which I can call from the global scope, e.g</p>
  
  <pre><code>add_blog(:my_blog)
  </code></pre>
  
  <p>This would then call the function my_blog in the global scope.</p>
  
  <p>Obviously I could monkeypatch the Object class in the gem with the add_blog function, but this seems like overkill as it would extend every object.</p>