Sha256: ffbd5fd3a26ab8d144ade18765af96e09f89b383a35e13a6da63fd0bec90199e

Contents?: true

Size: 893 Bytes

Versions: 13

Compression:

Stored size: 893 Bytes

Contents

#!/usr/bin/env ruby

require 'markdown_helper'

# Confirm that we're in a git project.
MarkdownHelper.git_clone_dir_path

# Each command foo has a corresponding Ruby executable _foo.
def command_keywords
  dir_path = File.dirname(__FILE__)
  dirs = Dir.entries(dir_path)
  command_file_names = dirs.select{ |x| x.start_with?('_')}
  command_file_names.collect {|x| x.sub(/^_/, '')}
end


def usage
  puts <<-EOT
  Usage: markdown_helper command [options] [args]

  where

    * Command is one of #{command_keywords.inspect}.

  EOT
  exit
end

command_keyword = ARGV[0]
unless command_keywords.include?(command_keyword)
  usage
end

bindir = File.dirname(__FILE__)
bin_file_path = File.absolute_path(File.join(
                    bindir,
                    '_' + command_keyword,
))
command = "ruby #{bin_file_path} #{ARGV.join(' ')}"
system(command)

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
markdown_helper-2.5.4 bin/markdown_helper
markdown_helper-2.5.3 bin/markdown_helper
markdown_helper-2.5.2 bin/markdown_helper
markdown_helper-2.5.1 bin/markdown_helper
markdown_helper-2.5.0 bin/markdown_helper
markdown_helper-2.4.0 bin/markdown_helper
markdown_helper-2.3.0 bin/markdown_helper
markdown_helper-2.2.0 bin/markdown_helper
markdown_helper-2.1.0 bin/markdown_helper
markdown_helper-2.0.0 bin/markdown_helper
markdown_helper-1.9.9 bin/markdown_helper
markdown_helper-1.9.5 bin/markdown_helper
markdown_helper-1.9.0 bin/markdown_helper