diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/README.md | 7 | ||||
-rw-r--r--[-rwxr-xr-x] | tools/line_statistics | 3 | ||||
-rwxr-xr-x | tools/profile | 5 |
3 files changed, 13 insertions, 2 deletions
diff --git a/tools/README.md b/tools/README.md new file mode 100644 index 0000000000..25ab798bd5 --- /dev/null +++ b/tools/README.md @@ -0,0 +1,7 @@ +## Rails dev tools + +This is a collection of utilities used for Rails internal development. +They aren't used by Rails apps directly. + + * `console` drops you in irb and loads local Rails repos + * `profile` profiles `Kernel#require` to help reduce startup time diff --git a/tools/line_statistics b/tools/line_statistics index 5eb5cfdc3d..bfa921b095 100755..100644 --- a/tools/line_statistics +++ b/tools/line_statistics @@ -1,4 +1,5 @@ -#!/usr/bin/env ruby +# Class used to calculates LOC for a provided file list. +# # Example: # files = FileList["lib/active_record/**/*.rb"] # CodeTools::LineStatistics.new(files).print_loc diff --git a/tools/profile b/tools/profile index a35dd18b77..eb7fc7792b 100755 --- a/tools/profile +++ b/tools/profile @@ -1,4 +1,7 @@ #!/usr/bin/env ruby +# Profile require calls giving information about the time and the files that are called +# when loading the provided file. +# # Example: # tools/profile activesupport/lib/active_support.rb [ruby-prof mode] [ruby-prof printer] ENV['NO_RELOAD'] ||= '1' @@ -65,7 +68,7 @@ module CodeTools private def assert_ruby_file_exists(path) - fail Error.new("No such file") unless File.exists?(path) + fail Error.new("No such file") unless File.exist?(path) fail Error.new("#{path} is a directory") if File.directory?(path) ruby_extension = File.extname(path) == '.rb' ruby_executable = File.open(path, 'rb') {|f| f.readline } =~ [/\A#!.*ruby/] |