Method: Hourglass::Runner#initialize

Defined in:
lib/hourglass/runner.rb

#initialize(argv = ARGV) ⇒ Runner

Returns a new instance of Runner.



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/hourglass/runner.rb', line 132

def initialize(argv = ARGV)
  options = {}
  OptionParser.new do |opts|
    opts.banner = "Usage: #{$0} [options]"

    opts.on("-s", "--server-only", "Only run the web server") do |s|
      options['server_only'] = s
    end
  end.parse(argv)

  Database.migrate!
  if start_server
    if options['server_only']
      @web_thread.join
    else
      start_browser
    end
  end
  Activity.stop_current_activities
end