<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>mspec/bin/completeness</filename>
    </added>
    <added>
      <filename>mspec/bin/mkspec</filename>
    </added>
    <added>
      <filename>mspec/bin/name_map.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,191 +1,3 @@
 #!/usr/bin/env ruby
-#
-# Generate a completeness report from MRI classes and modules
-# based on the specs.
 
-require 'optparse'
-require File.dirname(__FILE__) + '/name_map'
-
-module Completeness
-  VERSION = '0.0.1'
-end
-
-get_class_or_module = lambda do |const|
-  constant = const.split('::').inject(nil) { |c,s| c ? c.const_get(s) : Object.const_get(s) }
-  return constant if (constant.is_a?(Module) or constant.is_a?(Class)) and
-    not ['DTracer', 'OptionParser', 'SystemExit'].include?(constant.name)
-end
-
-target = 'shotgun/rubinius'
-base = nil
-constants = []
-except = []
-requires = []
-constant_names = []
-report_failures = false
-use_color = false
-verbose = false
-quiet = false
-
-opts = OptionParser.new(&quot;&quot;, 24, '   ') do |opts|
-  opts.banner = &quot;completeness [options]&quot;
-  opts.separator &quot;&quot;
-
-  opts.on(&quot;-r&quot;, &quot;--require LIBRARY&quot;, String, &quot;Name of library to require&quot;) do |f|
-    requires &lt;&lt; f
-  end
-  opts.on(&quot;-c&quot;, &quot;--constant CONSTANT&quot;, String,
-          &quot;Name of a Class or Module&quot;) do |c|
-    constant_names &lt;&lt; c
-  end
-  opts.on(&quot;-b&quot;, &quot;--base BASE&quot;, String,
-          &quot;Set base directory to BASE&quot;) do |b|
-    base = b
-  end
-  opts.on(&quot;-t&quot;, &quot;--target TARGET&quot;, String,
-          &quot;Implementation to test for completeness: r:ruby|r19:ruby19|x:rbx|j:jruby&quot;) do |t|
-    case t
-    when 'r', 'ruby'
-      target = 'ruby'
-    when 'r19', 'ruby19'
-      target = 'ruby19'
-    when 'x', 'rbx', 'rubinius'
-      target = 'shotgun/rubinius'
-    when 'j', 'jruby'
-      target = 'jruby'
-    else
-      target = t
-    end
-  end
-  opts.on(&quot;-x&quot;, &quot;--exclude STRING|FILE&quot;, String,
-          &quot;Exclude example(s) with descriptions matching STRING or each line of FILE&quot;) do |r|
-    except &lt;&lt; r
-  end
-  opts.on(&quot;-v&quot;, &quot;--version&quot;, &quot;Show version&quot;) do
-    puts &quot;Completeness Reporter #{Completeness::VERSION}&quot;
-    exit
-  end
-  opts.on(&quot;-F&quot;, &quot;--report-failures&quot;, &quot;Report spec failure locations&quot;) do
-    report_failures = true
-  end
-  opts.on(&quot;-o&quot;, &quot;--color&quot;, &quot;Use colors green=NoFailures yellow=WithFailures red=NoExamples&quot;) do
-    use_color = true
-  end
-  opts.on(&quot;-V&quot;, &quot;--verbose&quot;, &quot;Show mspec command being executed&quot;) do
-    verbose = true
-  end
-  opts.on(&quot;-q&quot;, &quot;--quiet&quot;, &quot;Suppress output except for final summary&quot;) do
-    quiet = true
-  end
-  opts.on(&quot;-h&quot;, &quot;--help&quot;, &quot;Show this message&quot;) do
-    puts opts
-    exit
-  end
-
-  opts.parse ARGV
-end
-
-requires.each { |r| require r }
-
-cmd = lambda do |name, c, m|
-  base = 'spec/ruby/1.8/core/' unless base
-  dir = NameMap.get_dir_name(c, base)
-  spec_file = NameMap.get_spec_name(m, c.name)
-
-  mspec_cmd =  %(bin/mspec -t #{target} #{requires.map { |r| &quot;-r#{r}&quot; }.join(&quot; &quot;)} -e '#{name} ' #{except.map { |x| &quot;-x #{x}&quot; }.join(' ')} -f d #{dir}/#{spec_file} 2&gt; /dev/null)
-  puts mspec_cmd if verbose
-  %x{#{mspec_cmd}}
-end
-
-colors = {
-  :clear =&gt; &quot;\033[0m&quot;,
-  :red =&gt; &quot;\033[0;31m&quot;,
-  :green =&gt; &quot;\033[0;32m&quot;,
-  :yellow =&gt; &quot;\033[0;33m&quot;,
-  :blue =&gt; &quot;\033[0;34m&quot;,
-}
-
-print_summary = lambda do |str, name, tab|
-  examples = failures = errors = 0
-  failure_messages = []
-  str.scan(/(\d+) example.*(\d+) failure.*(\d+) error./) do |ex, f, er|
-    examples += ex.to_i
-    failures += f.to_i
-    errors += er.to_i
-  end
-  str.scan(/\n(\d+\)\n)(([^\n]+\n)+)/) do |number, error|
-    failure_messages &lt;&lt; error
-  end
-  summary = if examples &gt; 0
-    &quot;#{examples} examples, #{failures} failures, #{errors} errors&quot;
-  else
-    &quot;No examples found&quot;
-  end
-  unless quiet
-    if use_color
-      color = if examples == 0
-                colors[:red]
-              elsif failures == 0
-                colors[:green]
-              else
-                colors[:yellow]
-              end
-      name = color + name + colors[:clear]
-    end
-    puts &quot;#{name}\n    #{summary}&quot;
-  end
-  tab.add(examples, failures, errors, failure_messages)
-end
-
-constants = constant_names.map { |c| NameMap.get_class_or_module(c) }
-if constants.empty?
-  constants = Object.constants.map { |c| NameMap.get_class_or_module(c) }
-end
-constants.sort! { |a,b| a.to_s &lt;=&gt; b.to_s }
-
-class Tabulator
-  def initialize
-    @methods = @examples = @failures = @errors = @missing = 0
-    @failure_messages = []
-    @start = Time.now
-  end
-
-  def add(examples, failures, errors, failure_messages = [])
-    @methods += 1
-    @examples += examples
-    @failures += failures
-    @errors += errors
-    @failure_messages.push *failure_messages
-    @missing += 1 if examples == 0
-  end
-
-  def summarize(list_failures=false)
-    puts &quot;\nFinished in #{Time.now - @start} seconds\n\n&quot;
-    puts &quot;#{@methods} methods, #{@examples} examples, #{@failures} failures, #{@errors} errors, #{@missing} methods with no examples&quot;
-    if list_failures &amp;&amp; @failure_messages.size &gt; 0
-      puts &quot;\nFailed specs:\n\n&quot;
-      @failure_messages.each_with_index do |message, number|
-        puts &quot;#{number+1})\n#{message}\n\n&quot;
-      end
-    end
-  end
-
-end
-
-tabulator = Tabulator.new
-
-constants.compact.each do |c|
-  (c.methods(false) + c.singleton_methods).uniq.sort.each do |m|
-    name = &quot;#{c}.#{m}&quot;
-    print_summary.call(cmd[name, c, m], name, tabulator)
-  end
-
-  (c.public_instance_methods(false) +
-      c.private_instance_methods(false) +
-      c.protected_instance_methods(false)).sort.each do |m|
-    name = &quot;#{c}\##{m}&quot;
-    print_summary.call(cmd[name, c, m], name, tabulator)
-  end
-end
-
-tabulator.summarize(!quiet &amp;&amp; report_failures)
+exec 'mspec/bin/completeness', *ARGV</diff>
      <filename>bin/completeness</filename>
    </modified>
    <modified>
      <diff>@@ -1,130 +1,3 @@
-#! /usr/bin/env ruby
-#
-# mkspec - utility to create spec stubs
-
-require 'optparse'
-require File.dirname(__FILE__) + '/name_map'
-
-class MkSpec
-  VERSION = '0.0.1'
-
-  def self.process_args(argv)
-    modules = []
-    base = nil
-
-    opts = OptionParser.new do |opts|
-      opts.version = VERSION
-      opts.banner = &quot;mkspec [options]&quot;
-      opts.separator &quot;&quot;
-
-      opts.on(&quot;-c&quot;, &quot;--constant CONSTANT&quot;,
-              &quot;Class or Module to generate spec stubs for&quot;) do |name|
-        constant = NameMap.get_class_or_module(name)
-
-        if constant.nil? then
-          raise OptionParser::InvalidArgument, &quot;#{name} is not a constant&quot;
-        end
-
-        modules &lt;&lt; constant
-      end
-
-      opts.on(&quot;-b&quot;, &quot;--base BASE&quot;,
-              &quot;Directory to generate specs into&quot;) do |directory|
-        base = File.expand_path directory
-      end
-
-      opts.on(&quot;-r&quot;, &quot;--require LIBRARY&quot;,
-              &quot;A library to require&quot;) do |file|
-        begin
-          require file
-        rescue LoadError
-          raise OptionParser::InvalidArgument, &quot;#{file} could not be required&quot;
-        end
-      end
-
-      opts.parse argv
-    end
-
-    if modules.empty? then
-      Object.constants.map { |const| NameMap.get_class_or_module(const) }
-    end
-
-    modules = modules.compact
-
-    return base, modules
-  rescue OptionParser::ParseError =&gt; e
-    puts opts
-    puts
-    puts e
-    exit 1
-  end
-
-  def self.run(argv = ARGV)
-    base, modules = process_args argv
-
-    mkspec = new base
-    mkspec.generate base, modules
-  end
-
-  def initialize(base)
-    @base = base
-  end
-
-  def create_file(dir, name, mod, meth)
-    file = File.join dir, name
-
-    unless File.exist? file then
-      /\A#{Regexp.escape @base}\/?(.*)/ =~ dir
-
-      parent_dirs = '../' * ($1.split('/').length + 1)
-
-      File.open file, 'w' do |f|
-        f.puts &quot;require File.dirname(__FILE__) + '/#{parent_dirs}spec_helper'&quot;
-        f.puts
-        f.puts &quot;describe '#{mod}##{meth}' do&quot;
-        f.puts &quot;  it 'should spec something' do&quot;
-        f.puts &quot;    raise 'not yet'&quot;
-        f.puts &quot;  end&quot;
-        f.puts &quot;end&quot;
-      end
-
-      puts file
-    end
-  end
-
-  def generate(dir, modules)
-    modules.each do |mod|
-      subdir = NameMap.get_dir_name mod, dir
-      if File.exist? subdir then
-        unless File.directory? subdir then
-          puts &quot;A file named #{subdir} already exists and is not a directory.&quot;
-          exit 1
-        end
-      else
-        Dir.mkdir subdir
-      end
-
-      methods = [
-        mod.methods(false),
-        mod.public_instance_methods(false),
-        mod.private_instance_methods(false),
-        mod.protected_instance_methods(false),
-      ].flatten.uniq.sort
-
-      methods.each do |method|
-        name = NameMap.get_spec_name method, mod.name
-        create_file subdir, name, mod, method unless File.exist? name
-      end
-
-      sub_mods = mod.constants.sort.map do |constant_name|
-        NameMap.get_class_or_module &quot;#{mod}::#{constant_name}&quot;
-      end.compact
-
-      generate subdir, sub_mods
-    end
-  end
-
-end
-
-MkSpec.run if __FILE__ == $0
+#!/usr/bin/env ruby
 
+exec 'mspec/bin/mkspec', *ARGV</diff>
      <filename>bin/mkspec</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>bin/name_map.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>67d3869e9b3fef6d47727206d02814da410e02fc</id>
    </parent>
  </parents>
  <author>
    <name>Brian Ford</name>
    <email>bford@engineyard.com</email>
  </author>
  <url>http://github.com/evanphx/rubinius/commit/4ad3b46a2ef8327f54667c904759605063481987</url>
  <id>4ad3b46a2ef8327f54667c904759605063481987</id>
  <committed-date>2008-04-07T12:20:25-07:00</committed-date>
  <authored-date>2008-04-04T12:12:57-07:00</authored-date>
  <message>Moved bin/mkspec, completeness to mspec/bin.</message>
  <tree>9bd655f75516234b95e5f4c0b25f961653b7fc00</tree>
  <committer>
    <name>Brian Ford</name>
    <email>bford@engineyard.com</email>
  </committer>
</commit>
