Sha256: 8f8714120777bbf12438c57c5dc7528b98c9ed6fc8d7c263c9a1f738d82b31cb
Contents?: true
Size: 528 Bytes
Versions: 18
Compression:
Stored size: 528 Bytes
Contents
#!/usr/bin/env ruby require "optparse" require_relative "../lib/code-ruby-parser" require "json" options = {} OptionParser .new do |opts| opts.banner = "Usage: bin/template-parser [options]" opts.on( "-i INPUT", "--input=INPUT", "Input in the code language (String or File)" ) do |input| input = File.read(input) if File.exists?(input) options[:input] = input end end .parse! input = options.fetch(:input, "") puts JSON.pretty_generate(::Template::Parser.parse(input))
Version data entries
18 entries across 18 versions & 2 rubygems