diff --git a/tool/asm_parse.rb b/tool/asm_parse.rb index e39580c..32882be 100644 --- a/tool/asm_parse.rb +++ b/tool/asm_parse.rb @@ -1,3 +1,5 @@ +# YARV tool to parse assembly output. + stat = {} while line = ARGF.gets diff --git a/tool/change_maker.rb b/tool/change_maker.rb index f7b7650..395bd34 100755 --- a/tool/change_maker.rb +++ b/tool/change_maker.rb @@ -1,5 +1,8 @@ #! ./miniruby +# Used by "make change" to generate a list of files for a Changelog entry. +# Run it via "make change" in the Ruby root directory. + $:.unshift(File.expand_path("../../lib", __FILE__)) require File.expand_path("../vcs", __FILE__) diff --git a/tool/downloader.rb b/tool/downloader.rb index 74ff309..aa5490f 100644 --- a/tool/downloader.rb +++ b/tool/downloader.rb @@ -1,3 +1,6 @@ +# Used by configure and make to download or update mirrored Ruby and GCC +# files. This will use HTTPS if possible, falling back to HTTP. + require 'open-uri' begin require 'net/https' diff --git a/tool/enc-unicode.rb b/tool/enc-unicode.rb index bebd47f..a8075a3 100755 --- a/tool/enc-unicode.rb +++ b/tool/enc-unicode.rb @@ -1,6 +1,6 @@ #!/usr/bin/env ruby -# Creates the data structures needed by Onigurma to map Unicode codepoints to +# Creates the data structures needed by Oniguruma to map Unicode codepoints to # property names and POSIX character classes # # To use this, get UnicodeData.txt, Scripts.txt, PropList.txt, diff --git a/tool/eval.rb b/tool/eval.rb index 18e645a..981f727 100644 --- a/tool/eval.rb +++ b/tool/eval.rb @@ -1,3 +1,4 @@ +# VM checking and benchmarking code require './rbconfig' require 'fileutils' diff --git a/tool/expand-config.rb b/tool/expand-config.rb index bb88865..d34f29f 100755 --- a/tool/expand-config.rb +++ b/tool/expand-config.rb @@ -1,5 +1,7 @@ #!./miniruby -s +# Used to expand Ruby config entries for Win32 Makefiles. + config = File.read(conffile = $config) config.sub!(/^(\s*)RUBY_VERSION\b.*(\sor\s*)$/, '\1true\2') rbconfig = Module.new {module_eval(config, conffile)}::RbConfig diff --git a/tool/extlibs.rb b/tool/extlibs.rb index 710d843..ee4fd72 100755 --- a/tool/extlibs.rb +++ b/tool/extlibs.rb @@ -1,4 +1,8 @@ #!/usr/bin/ruby + +# Used to download, extract and patch extension libraries (extlibs) +# for Ruby. See common.mk for Ruby's usage. + require 'fileutils' require 'digest' require_relative 'downloader' diff --git a/tool/fake.rb b/tool/fake.rb index 03d2e4d..99fc24e 100644 --- a/tool/fake.rb +++ b/tool/fake.rb @@ -1,3 +1,6 @@ +# Used by Makefile and configure for building Ruby. +# See common.mk and Makefile.in for details. + class File sep = ("\\" if RUBY_PLATFORM =~ /mswin|bccwin|mingw/) if sep != ALT_SEPARATOR diff --git a/tool/file2lastrev.rb b/tool/file2lastrev.rb index 79e6c65..ee615a5 100755 --- a/tool/file2lastrev.rb +++ b/tool/file2lastrev.rb @@ -1,5 +1,8 @@ #!/usr/bin/env ruby +# Gets the most recent revision of a file in a VCS-agnostic way. +# Used by Doxygen, Makefiles and merger.rb. + require 'optparse' # this file run with BASERUBY, which may be older than 1.9, so no diff --git a/tool/gem-unpack.rb b/tool/gem-unpack.rb index 7f84126..f069d14 100755 --- a/tool/gem-unpack.rb +++ b/tool/gem-unpack.rb @@ -1,6 +1,9 @@ require 'rubygems' require 'rubygems/package' +# This library is used by "make extract-gems" to +# unpack bundled gem files. + def Gem.unpack(file, dir = nil) policy = Gem::Security::LowSecurity (policy = policy.dup).ui = Gem::SilentUI.new diff --git a/tool/gen_dummy_probes.rb b/tool/gen_dummy_probes.rb index 05e724f..8ed17f2 100755 --- a/tool/gen_dummy_probes.rb +++ b/tool/gen_dummy_probes.rb @@ -1,6 +1,8 @@ #!/usr/bin/ruby # -*- coding: us-ascii -*- +# Used to create dummy probes (as for systemtap and DTrace) by Makefiles. See common.mk. + text = ARGF.read # remove comments diff --git a/tool/gen_ruby_tapset.rb b/tool/gen_ruby_tapset.rb index c34fb88..ca4b099 100755 --- a/tool/gen_ruby_tapset.rb +++ b/tool/gen_ruby_tapset.rb @@ -1,5 +1,6 @@ #!/usr/bin/ruby # -*- coding: us-ascii -*- +# Create a tapset for systemtap and DTrace # usage: ./ruby gen_ruby_tapset.rb --ruby-path=/path/to/ruby probes.d > output require "optparse" diff --git a/tool/generic_erb.rb b/tool/generic_erb.rb index 5d44738..0664056 100644 --- a/tool/generic_erb.rb +++ b/tool/generic_erb.rb @@ -1,4 +1,8 @@ # -*- coding: us-ascii -*- + +# Used to expand Ruby template files by common.mk, uncommon.mk and +# some Ruby extension libraries. + require 'erb' require 'optparse' require 'fileutils' diff --git a/tool/id2token.rb b/tool/id2token.rb index 191b872..706154e 100755 --- a/tool/id2token.rb +++ b/tool/id2token.rb @@ -1,5 +1,8 @@ #! /usr/bin/ruby -p # -*- coding: us-ascii -*- + +# Used to build the Ruby parsing code in common.mk and Ripper. + BEGIN { require 'optparse' $:.unshift(File.dirname(__FILE__)) diff --git a/tool/ifchange b/tool/ifchange index cc630b0..8571cf8 100755 --- a/tool/ifchange +++ b/tool/ifchange @@ -1,6 +1,8 @@ #!/bin/sh # usage: ifchange target temporary +# Used in generating revision.h via Makefiles. + set -e timestamp= keepsuffix= diff --git a/tool/insns2vm.rb b/tool/insns2vm.rb index f518707..ecbbb52 100755 --- a/tool/insns2vm.rb +++ b/tool/insns2vm.rb @@ -1,5 +1,8 @@ #!ruby +# This is used by Makefile.in to generate .inc files. +# See Makefile.in for details. + require 'optparse' Version = %w$Revision: 11626 $[1..-1] diff --git a/tool/instruction.rb b/tool/instruction.rb index 4511795..57dc923 100755 --- a/tool/instruction.rb +++ b/tool/instruction.rb @@ -1,7 +1,8 @@ #!./miniruby # -*- coding: us-ascii -*- # -# +# This library is used by insns2vm.rb as part of autogenerating +# instruction files with .inc extensions like insns.inc and vm.inc. require 'erb' $:.unshift(File.dirname(__FILE__)) diff --git a/tool/jisx0208.rb b/tool/jisx0208.rb index 921f574..30185fb 100644 --- a/tool/jisx0208.rb +++ b/tool/jisx0208.rb @@ -1,3 +1,5 @@ +# Library used by tools/enc-emoji-citrus-gen.rb + module JISX0208 class Char class << self diff --git a/tool/merger.rb b/tool/merger.rb index cfc3d58..2faf866 100755 --- a/tool/merger.rb +++ b/tool/merger.rb @@ -3,7 +3,8 @@ exec "${RUBY-ruby}" "-x" "$0" "$@" && [ ] if false #!ruby # This needs ruby 1.9 and subversion. -# run this in a repository to commit. +# As a Ruby committer, run this in an SVN repository +# to commit a change. require 'fileutils' require 'tempfile' diff --git a/tool/mk_call_iseq_optimized.rb b/tool/mk_call_iseq_optimized.rb index 0af637b..7df36eb 100644 --- a/tool/mk_call_iseq_optimized.rb +++ b/tool/mk_call_iseq_optimized.rb @@ -4,7 +4,7 @@ /* DO NOT EDIT THIS FILE DIRECTLY * - * This file is enerated by tool/mkcall_iseq.rb + * This file is generated by tool/mkcall_iseq.rb */ EOS diff --git a/tool/mkrunnable.rb b/tool/mkrunnable.rb index 4e73771..fbfc760 100755 --- a/tool/mkrunnable.rb +++ b/tool/mkrunnable.rb @@ -1,6 +1,9 @@ #!./miniruby # -*- coding: us-ascii -*- +# Used by "make runnable" target, to make symbolic links from a build +# directory. + require './rbconfig' require 'fileutils' diff --git a/tool/node_name.rb b/tool/node_name.rb index fef7720..5c67d7c 100755 --- a/tool/node_name.rb +++ b/tool/node_name.rb @@ -1,4 +1,8 @@ #! ./miniruby + +# Used when making Ruby to generate node_name.inc. +# See common.mk for details. + while gets if ~/enum node_type \{/..~/^\};/ ~/(NODE_.+),/ and puts(" case #{$1}:\n\treturn \"#{$1}\";") diff --git a/tool/parse.rb b/tool/parse.rb index 6243d7a..93ae3e4 100644 --- a/tool/parse.rb +++ b/tool/parse.rb @@ -1,3 +1,6 @@ +# Used as part of the "make parse" Makefile target. +# See common.mk for details. + $file = ARGV[0] $str = ARGF.read.sub(/^__END__.*\z/m, '') puts '# ' + '-' * 70 diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb index 72cca6c..104d5ff 100755 --- a/tool/rbinstall.rb +++ b/tool/rbinstall.rb @@ -1,5 +1,8 @@ #!./miniruby +# Used by the "make install" target to install Ruby. +# See common.mk for more details. + begin load "./rbconfig.rb" rescue LoadError diff --git a/tool/rbuninstall.rb b/tool/rbuninstall.rb index 1a11766..eb324c9 100755 --- a/tool/rbuninstall.rb +++ b/tool/rbuninstall.rb @@ -1,4 +1,8 @@ #! /usr/bin/ruby -nl + +# Used by the "make uninstall" target to uninstall Ruby. +# See common.mk for more details. + BEGIN { $dryrun = false $tty = STDOUT.tty? diff --git a/tool/rmdirs b/tool/rmdirs index 6dcf984..76c4a39 100755 --- a/tool/rmdirs +++ b/tool/rmdirs @@ -1,4 +1,7 @@ #!/bin/sh + +# Script used by configure to delete directories recursively. + for dir do while rmdir "$dir" >/dev/null 2>&1 && parent=`expr "$dir" : '\(.*\)/[^/][^/]*'`; do diff --git a/tool/runruby.rb b/tool/runruby.rb index c316ff2..9329ef7 100755 --- a/tool/runruby.rb +++ b/tool/runruby.rb @@ -1,5 +1,8 @@ #!./miniruby +# Used by "make runruby", configure, and by hand to run a locally-built Ruby +# with correct environment variables and arguments. + show = false precommand = [] while arg = ARGV[0] diff --git a/tool/strip-rdoc.rb b/tool/strip-rdoc.rb index 1902cb5..0ac9c39 100755 --- a/tool/strip-rdoc.rb +++ b/tool/strip-rdoc.rb @@ -1,5 +1,8 @@ #!ruby +# Filter for preventing Doxygen from processing RDoc comments. +# Used by the Doxygen template. + ARGF.binmode source = ARGF.read source = source.gsub(%r{/\*([!*])((?!\*/).+?)\*/}m) do |comment| diff --git a/tool/update-deps b/tool/update-deps index 4c20052..e0067c8 100755 --- a/tool/update-deps +++ b/tool/update-deps @@ -28,7 +28,7 @@ require 'open3' require 'pp' -# When out-of-place bulid, files may be built in source directory or +# When out-of-place build, files may be built in source directory or # build directory. # Some files are always built in the source directory. # Some files are always built in the build directory. diff --git a/tool/vcs.rb b/tool/vcs.rb index 0f20c6e..9d0a276 100644 --- a/tool/vcs.rb +++ b/tool/vcs.rb @@ -1,6 +1,9 @@ # vcs require 'fileutils' +# This library is used by several other tools/ scripts to detect the current +# VCS in use (e.g. SVN, Git) or to interact with that VCS. + ENV.delete('PWD') unless File.respond_to? :realpath diff --git a/tool/vtlh.rb b/tool/vtlh.rb index fcd3630..2e1faf2 100644 --- a/tool/vtlh.rb +++ b/tool/vtlh.rb @@ -1,3 +1,5 @@ +# Convert addresses to line numbers for MiniRuby. + # ARGF = open('ha') cd = `pwd`.chomp + '/' ARGF.each{|line| diff --git a/tool/ytab.sed b/tool/ytab.sed index 706cf75..a9599ce 100755 --- a/tool/ytab.sed +++ b/tool/ytab.sed @@ -1,4 +1,5 @@ #!/bin/sed -f +# This file is used when generating code for the Ruby parser. /^int yydebug;/{ i\ #ifndef yydebug