Sha256: c4ec6723a162760da1fb919869c85535c1bf6506e4a67e3039af70ab7a19b766

Contents?: true

Size: 887 Bytes

Versions: 7

Compression:

Stored size: 887 Bytes

Contents

#!/usr/bin/env ruby
require 'optparse'
DEFAULT_PORT = 3000
DEFAULT_HOST = "127.0.0.1"
require File.dirname(__FILE__) + '/../lib/staticmatic'

$options = {:host=>DEFAULT_HOST,:port=>DEFAULT_PORT}

optparse = OptionParser.new do |opt|
  opt.banner = "Usage: #{$0} <build|setup|preview> [OPTIONS]"
  opt.separator ""
  opt.on "-p", "--port [PORT]", "Select the server port, defaults to #{DEFAULT_PORT}" do |port|
    $options[:port] = port
  end
  opt.on "-h", "--host [HOST]", "Select the server host, defaults to #{DEFAULT_HOST}" do |host|
    $options[:host] = host
  end
  opt.on_tail "-h", "--help", "Display this help message" do
    puts opt
    exit
  end
end
optparse.parse!

command = ARGV[0]
directory = ARGV[1]

if !command || !directory
  puts "Usage: #{$0} <build|setup|preview> <directory>"
  exit
end

staticmatic = StaticMatic::Base.new(directory)
staticmatic.run(command)

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
staticmatic-0.7.1 bin/staticmatic
staticmatic-0.7.0 bin/staticmatic
staticmatic-0.3.0 bin/staticmatic
staticmatic-0.8.1 bin/staticmatic
staticmatic-0.8.6 bin/staticmatic
staticmatic-0.8.4 bin/staticmatic
staticmatic-0.8.5 bin/staticmatic