TypeProf::Task

Rake interface for TypeProf.

TypeProf Task is a Rake task library for TypeProf. It defines tasks to analyze Ruby source codes (and generate RBS files).

Installation

Install the gem and add to the application's Gemfile by executing:

bundle add typeprof-task

If Bundler is not being used to manage dependencies, install the gem by executing:

gem install typeprof-task

Usage

Add below to your Rakefile and run rake typeprof.

require "typeprof/task"

TypeProf::Task.new

Or more complex example:

TypeProf::Task.new(:rbs) do |t|
  t.outfile = "path/to/some.rbs"
  t.require << "pathname"
end

Here are options. See also the API documentation.

name type default TypeProf (< 0.30.0) >= 0.30.0
files array (1) files... file or dirs...
outfile string (2) -o same
quiet bool - --quiet same
include set x -I x
require set x -r x
collection set x --collection same
include_dir set x --include-dir x
exclude_dir set x --exclude-dir x
exclude_untyped bool - --exclude-untyped x
show_version bool - --show-typeprof-version same
show_errors bool - --show-errors same
show_untyped bool - --show-untyped x
show_parameter_names bool - --show-parameter-names same
show_source_locations bool - --show-source-locations same
max_second number - --max-second x
max_iteration number - --max-iteration x
stub_execution bool - --stub-execution x
type_depth_limit number - --type-depth-limit x
union_width_limit number - --union-width-limit x
  • "-" means unspecified
  • "x" means none
  • (1) Files under one of the require paths.
  • (2) sig/GEM_NAME.gen.rbs

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in the library file, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

For Nix users, bundle config --with nix in advance.

References:

Contributing

Bug reports and pull requests are welcome.