Sha256: d5e37413ce94d2c56154b164b3d812cf2b8d10f6f601986fb2c438bf3fa4fb95
Contents?: true
Size: 978 Bytes
Versions: 6
Compression:
Stored size: 978 Bytes
Contents
#!/usr/bin/env ruby require 'optparse' require 'markdown_helper' options = {:pristine => false} # Save opts for use below. opts = nil parser = OptionParser.new do |_opts| opts = _opts _opts.banner = "Usage: markdown_helper run_irb [options] template_file_path markdown_file_path" _opts.on('--pristine', 'No comments added') do |_| options[:pristine] = true end _opts.on('--help', 'Display help') do usage(_opts) end end def usage(opts) puts '' puts opts puts <<-EOT where * template_file_path is the path to an existing file. * markdown_file_path is the path to a file to be created. Typically: * Both file types are .md. * The template file contains code blocks to be run in irb. EOT exit end parser.parse! _, template_file_path, markdown_file_path = ARGV usage(opts) unless ARGV.size == 3 MarkdownHelper.new(options).run_irb(template_file_path, markdown_file_path)
Version data entries
6 entries across 6 versions & 1 rubygems