Sha256: 54dfc132f056b14e7d4e07bfa16919e91128f7eb7896c0f8eaa9e3168a3a8b48
Contents?: true
Size: 1.53 KB
Versions: 8
Compression:
Stored size: 1.53 KB
Contents
file :src do sh "git clone https://github.com/minitest/minitest.git src" end desc "generate minitest" task :minitest => :src do $:.unshift(File.expand_path("src/lib")) out = Pathname('out') out.rmtree rescue nil require 'orthoses' Orthoses::Builder.new do use Orthoses::CreateFileByName, base_dir: out.to_s use Orthoses::Filter do |name, content| name.start_with?("Minitest") || name == "Kernel" end use Orthoses::Constant, strict: false, if: ->(current, const, val, rbs){ !Orthoses::Utils.rbs_defined_const?("#{current}::#{const}") } use Orthoses::Mixin use Orthoses::Attribute use Orthoses::RBSPrototypeRB, paths: Dir.glob('src/lib/minitest{.rb,/*.rb}'), constant_filter: ->(_) { false }, mixin_filter: ->(_) { false }, attribute_filter: ->(_) { false } run ->(){ require_relative 'src/lib/minitest' require_relative 'src/lib/minitest/test' require_relative 'src/lib/minitest/spec' require_relative 'src/lib/minitest/parallel' require_relative 'src/lib/minitest/mock' require_relative 'src/lib/minitest/benchmark' require_relative 'src/lib/minitest/pride_plugin' } end.call sh "rbs -r mutex_m -I #{out} validate --silent" out.join("manifest.yaml").write <<~YAML dependencies: - name: mutex_m YAML tmp = out.join("kernel.rbs").read out.join("kernel.rbs").open("w") do |f| f.puts "%a{annotate:rdoc:skip}" f.write tmp end sh "rbs annotate --gems out" end task default: :minitest
Version data entries
8 entries across 8 versions & 1 rubygems