Sha256: aff7b227ad883741bbf93fe8b5e6527351704f48dfc72361fde1a6c4e63f9e5d

Contents?: true

Size: 911 Bytes

Versions: 2

Compression:

Stored size: 911 Bytes

Contents

#!/usr/bin/env ruby

require 'rubygems'
require 'optparse'

STDOUT.sync = true

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::Database.connect

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ledger_web-1.4.6 bin/ledger_web
ledger_web-1.4.4 bin/ledger_web