Sha256: 718beef16c16a9a3dc4f02c6bf758fc78ecced4395ff611524e3b9a44f279d8d

Contents?: true

Size: 1.43 KB

Versions: 53

Compression:

Stored size: 1.43 KB

Contents

module RBS
  # Copies RBS files loaded through `loader` under `vendor_dir`.
  # 
  # Core libraries and library RBS files will be copied.
  # 
  #   loader = RBS::EnvironmentLoader.new()
  # 
  #   loader.add(library: set)               # Libraries will be copied.
  #   loader.add(library: "minitest", version: "1.2.3")
  # 
  #   loader.add(path: Pathname("sig"))      # Dirs will be ignored.
  # 
  #   vendorer = RBS::Vendorer.new(vendor_dir: Pathname("vendor/rbs"), loader: loader)
  #   vendorer.clearn!
  #   vendorer.copy!
  # 
  # The result will be:
  #   vendor/rbs/core            => Will include core RBSs
  #   vendor/rbs/set-0           => Will include `set` library RBSs.
  #   vendor/rbs/minitest-1.2.3  => Will include `minitest` library RBSs.
  # 
  # The vendorerd RBSs will be loaded through :dir source.
  # 
  #   loader = RBS::EnvironmentLoader.new(core_root: nil, repository: RBS::Repository.new(no_stdlib: true))
  #   loader.add(path: Pathname("vendor/rbs"))
  #   loader.add(path: Pathname("sig"))
  # 
  class Vendorer
    attr_reader vendor_dir: Pathname
    attr_reader loader: EnvironmentLoader

    def initialize: (vendor_dir: Pathname, loader: EnvironmentLoader) -> void
    
    # Copy RBS files into `vendor_dir`.
    # Ensures the `vendor_dir` exists.
    def copy!: () -> void

    # Deletes `vendor_dir` and its content if exists.
    # 
    def clean!: () -> void
    
    def ensure_dir: [A] () { () -> A } -> A
  end
end

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
rbs-1.0.3 sig/vendorer.rbs
rbs-1.0.2 sig/vendorer.rbs
rbs-1.0.1 sig/vendorer.rbs
rbs-1.0.0 sig/vendorer.rbs
rbs-1.0.0.pre2 sig/vendorer.rbs
rbs-1.0.0.pre sig/vendorer.rbs
rbs-0.20.1 sig/vendorer.rbs
rbs-0.20.0 sig/vendorer.rbs
rbs-0.19.0 sig/vendorer.rbs
rbs-0.18.1 sig/vendorer.rbs
rbs-0.18.0 sig/vendorer.rbs
rbs-0.17.0 sig/vendorer.rbs
rbs-0.16.0 sig/vendorer.rbs