title: how can i prevent a script from running while I'm launching the server?
body: <p>I have a script that queries a third party API when the script is called from within my sinatra application, but I do not want it to run when I am launching my Thin server. Is there a way to prevent my code from running until I call it directly? for instance, can I run a check to see if my server is running from within ruby/sinatra to prevent my code from running?</p>
  
  <pre><code># the following code is inside a class and gets initialized when my server launch script is executed
  
  authToken = ENV['EVERNOTE_AUTH_TOKEN']
  evernoteHost = "www.evernote.com"
  userStoreUrl = "https://#{evernoteHost}/edam/user"
  
  userStoreTransport = Thrift::HTTPClientTransport.new(userStoreUrl)
  userStoreProtocol = Thrift::BinaryProtocol.new(userStoreTransport)
  userStore = Evernote::EDAM::UserStore::UserStore::Client.new(userStoreProtocol)
  # this line of code executes on server start
  noteStoreUrl = userStore.getNoteStoreUrl(authToken)
  </code></pre>
  
  <p>It appears that ruby does a syntax check when running each file, and my API is being called against my will on the last line, i want to write an if statement that makes it un-callable unless my server is already running</p>