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

Version Path
template-ruby-parser-0.1.8 bin/template-parser
code-ruby-parser-0.1.8 bin/template-parser
template-ruby-parser-0.1.7 bin/template-parser
code-ruby-parser-0.1.7 bin/template-parser
template-ruby-parser-0.1.6 bin/template-parser
code-ruby-parser-0.1.6 bin/template-parser
template-ruby-parser-0.1.5 bin/template-parser
code-ruby-parser-0.1.5 bin/template-parser
template-ruby-parser-0.1.4 bin/template-parser
code-ruby-parser-0.1.4 bin/template-parser
template-ruby-parser-0.1.3 bin/template-parser
code-ruby-parser-0.1.3 bin/template-parser
template-ruby-parser-0.1.2 bin/template-parser
code-ruby-parser-0.1.2 bin/template-parser
template-ruby-parser-0.1.1 bin/template-parser
code-ruby-parser-0.1.1 bin/template-parser
template-ruby-parser-0.1.0 bin/template-parser
code-ruby-parser-0.1.0 bin/template-parser