Sha256: 5e0a2a69a030f639ab09db9dbe3280d57452985785fcb0e2c77c8f7782dbe584

Contents?: true

Size: 828 Bytes

Versions: 1

Compression:

Stored size: 828 Bytes

Contents

#!/usr/bin/env ruby
require 'optparse'

require 'red_matter'

options = {
  filename: File.expand_path('./Redfile')
}

FILENAME = File.expand_path('./Redfile')
parser = OptionParser.new do |opts|
  opts.banner = "Usage: #{File.basename __FILE__} [options]"

  opts.separator ''
  opts.separator 'Available options:'

  opts.on('-f', '--file [FILE]', 'Use given file instead of Redfile') do |f|
    options[:filename] = File.expand_path(f)
  end

  opts.on('-v', '--verbose', 'Run verbosely') do
    options[:verbose] = true
  end

  opts.on_tail('-h', '--help', 'Show this message') do
    puts opts
    exit
  end

  opts.on_tail('-v', '--version', 'Print version') do
    puts RedMatter::VERSION
    exit
  end
end
parser.parse!

cl = RedMatter::Loader.new
cl.verbose = true

dat = File.read(options[:filename])

cl.load(dat)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
red_matter-0.1.0 exe/redmatter