sig/environment_loader.rbs in rbs-3.0.4 vs sig/environment_loader.rbs in rbs-3.1.0
- old
+ new
@@ -1,27 +1,29 @@
module RBS
# EnvironmentLoader is an object to load RBS files from filesystem.
#
# Set up your configuration through repository and `#add` method.
#
- # # Set up the repository to load library RBSs from.
- # repo = RBS::Repository.default
- # repo.add(Pathname("vendor/rbs/gem-rbs"))
- # repo.add(Pathname("vendor/rbs/internal-rbs"))
+ # ```ruby
+ # # Set up the repository to load library RBSs from.
+ # repo = RBS::Repository.default
+ # repo.add(Pathname("vendor/rbs/gem-rbs"))
+ # repo.add(Pathname("vendor/rbs/internal-rbs"))
#
- # loader = RBS::EnvironmentLoader.new(repository: repo)
+ # loader = RBS::EnvironmentLoader.new(repository: repo)
#
- # # Add libraries to load RBS files.
- # loader.add(library: "minitest")
- # loader.add(library: "rbs", version: "1.0.0")
+ # # Add libraries to load RBS files.
+ # loader.add(library: "minitest")
+ # loader.add(library: "rbs", version: "1.0.0")
#
- # # Add dirs to load RBS files from.
- # loader.add(path: Pathname("sig"))
+ # # Add dirs to load RBS files from.
+ # loader.add(path: Pathname("sig"))
#
- # # Load RBSs into an environment.
- # environment = RBS::Environment.new()
- # loader.load(env: environment)
+ # # Load RBSs into an environment.
+ # environment = RBS::Environment.new()
+ # loader.load(env: environment)
+ # ```
#
class EnvironmentLoader
class UnknownLibraryError < StandardError
attr_reader library: Library
@@ -33,10 +35,12 @@
attr_reader version: String?
def initialize: (name: String, version: String?) -> void
end
+ include FileFinder
+
DEFAULT_CORE_ROOT: Pathname
attr_reader core_root: Pathname?
attr_reader repository: Repository
@@ -101,9 +105,7 @@
def self.gem_sig_path: (String name, String? version) -> [Gem::Specification, Pathname]?
def each_signature: () { (source, Pathname, Buffer, Array[AST::Declarations::t], Array[AST::Directives::t]) -> void } -> void
def each_dir: { (source, Pathname) -> void } -> void
-
- def each_file: (Pathname path, immediate: boolish, skip_hidden: boolish) { (Pathname) -> void } -> void
end
end