Sha256: 8c32393a3cf7f8809ffcaa4b947199f5d85c40fb11808b6b0fffb0b23a1148db

Contents?: true

Size: 687 Bytes

Versions: 5

Compression:

Stored size: 687 Bytes

Contents

#!/usr/bin/env ruby
require "optparse"
require_relative "lib/zettacode"

options = {}
OptionParser.new do |opts|
  opts.banner = "Usage: zettacode [--parse FILENAME]"

  opts.on("-p", "--parse", "Parse FILENAME") do |p|
    options[:parse] = p
  end
  opts.on("-s", "--scrap", "Scrap RosettaCode URLs") do |s|
    options[:scrap] = s
  end
  opts.on("-v", "--version", "Show version") do |v|
    options[:version] = v
  end
end.parse!

if options[:parse]
  Zettacode::Parse.call(ARGV.first || "NODATA")
elsif options[:scrap]
  scrap = Zettacode::Scrap.new("config/scrap.yaml")
  scrap.load_settings
  scrap.find_langs
elsif options[:version]
  puts "zettacode #{Zettacode::VERSION}"
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
zettacode-0.1.7 zettacode
zettacode-0.1.6 zettacode
zettacode-0.1.5 zettacode
zettacode-0.1.4 zettacode
zettacode-0.1.3 zettacode