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