Sha256: eaa0710699d86e92699f3d8003ba2cbac77118e925b833e380100208c0b34bc5

Contents?: true

Size: 1.62 KB

Versions: 3

Compression:

Stored size: 1.62 KB

Contents

# $stdout, $stderr = # File or String in Memory (any cleanup measures?)
#require 'RubyGems'

module SixUpdaterWeb
  DEFAULT_PORT = 16333
  DEFAULT_IP = '127.0.0.1'

  OPEN_BROWSER = true

  SIX_HOST = if ARGV.to_s[/--bindi?n?g?=([0-9\.]*)/]
    $1
  else
    ARGV << "--binding=#{DEFAULT_IP}"
    DEFAULT_IP
  end

  SIX_PORT = if ARGV.to_s[/--port=([0-9]*)/]
    $1
  else
    ARGV << "--port=#{DEFAULT_PORT}"
    DEFAULT_PORT
  end

  module_function
  def prepare_data_path
    # Arrange appdata!
    lf = File.join(DATA_PATH, "logs")
    FileUtils.mkdir_p(lf) unless File.directory?(lf)
    df = File.join(DATA_PATH, "db")
    FileUtils.mkdir_p(df) unless File.directory?(df)
    db = File.join(DATA_PATH, "db", "production.sqlite3")

    unless File.exists?(db)
      puts "Database Missing, creating and loading default schema and system data..."
      File.open(db, 'w') {|f| }
      Dir.chdir(File.dirname(__FILE__)) do
        system "ruby -rubygems \"_rake.rb\" db:schema:load sync:system"
      end
      #FileUtils.cp(File.join(BASE_PATH, "db", "production.sqlite3"), db)
    end
  end
end

require 'common'

puts ""
SixUpdaterWeb.print_info
puts "This window needs to remain running during GUI operations"
puts ""

#if defined?(SixUpdaterWeb::OLDLOCATION)
SixUpdaterWeb.prepare_data_path
#end

puts "Checking for required Database migrations..."
Dir.chdir(File.dirname(__FILE__)) do
  system "ruby -rubygems \"_rake.rb\" db:migrate" #  goldberg:migrate
end

# Check for required data updates?

puts ""
puts "Starting the web client..."

# Kick off Rails
load 'script/server'	

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
six-updater-web-0.13.5 lib/init.rb
six-updater-web-0.13.4 lib/init.rb
six-updater-web-0.13.3 lib/init.rb