Sha256: 93231cf1823fd42d58aac6a799e8cafb30de8ee3715c620c2c315b56e7c0ea64

Contents?: true

Size: 862 Bytes

Versions: 1

Compression:

Stored size: 862 Bytes

Contents

#!/usr/bin/env ruby

require 'rubygems'
require 'optparse'

begin
  require 'ledger_web'
rescue LoadError => e
  path = File.expand_path '../../lib', __FILE__
  $:.unshift(path) if File.directory?(path) && !$:.include?(path)
  require 'ledger_web'
end

OptionParser.new do |opts|
  opts.banner = "Usage: ledger_web [options]"

  opts.on("-p", "--port PORT", Integer, "Port to expose the web interface") do |p|
    LedgerWeb::Config.instance.set :port, p.to_i
  end

  opts.on("-f", "--ledger-file FILE", String, "Ledger file to watch and load") do |f|
    LedgerWeb::Config.instance.set :ledger_file, f
  end

  opts.on("-d", "--database-url URL", String, "Database URL to load into") do |d|
    LedgerWeb::Config.instance.set :database_url, d
  end
end.parse!

LedgerWeb::Watcher.run!
LedgerWeb::Application.run!(:port => LedgerWeb::Config.instance.get(:port))

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ledger_web-1.4.3 bin/ledger_web