Class: Tapioca::Gemfile::Gem
- Inherits:
-
Object
- Object
- Tapioca::Gemfile::Gem
- Extended by:
- T::Sig
- Defined in:
- lib/tapioca/gemfile.rb
Constant Summary collapse
- IGNORED_GEMS =
T.let(%w{ sorbet sorbet-static sorbet-runtime tapioca }.freeze, T::Array[String])
Instance Attribute Summary collapse
-
#full_gem_path ⇒ Object
readonly
Returns the value of attribute full_gem_path.
Instance Method Summary collapse
- #contains_path?(path) ⇒ Boolean
- #files ⇒ Object
- #ignore?(gemfile_dir) ⇒ Boolean
-
#initialize(spec) ⇒ Gem
constructor
A new instance of Gem.
- #name ⇒ Object
- #rbi_file_name ⇒ Object
- #version ⇒ Object
Constructor Details
Instance Attribute Details
#full_gem_path ⇒ Object (readonly)
Returns the value of attribute full_gem_path.
86 87 88 |
# File 'lib/tapioca/gemfile.rb', line 86 def full_gem_path @full_gem_path end |
Instance Method Details
#contains_path?(path) ⇒ Boolean
123 124 125 |
# File 'lib/tapioca/gemfile.rb', line 123 def contains_path?(path) to_realpath(path).start_with?(full_gem_path) end |
#files ⇒ Object
101 102 103 104 105 |
# File 'lib/tapioca/gemfile.rb', line 101 def files @spec.full_require_paths.flat_map do |path| Pathname.glob((Pathname.new(path) / "**/*.rb").to_s) end end |
#ignore?(gemfile_dir) ⇒ Boolean
96 97 98 |
# File 'lib/tapioca/gemfile.rb', line 96 def ignore?(gemfile_dir) gem_ignored? || gem_in_app_dir?(gemfile_dir) end |
#name ⇒ Object
108 109 110 |
# File 'lib/tapioca/gemfile.rb', line 108 def name @spec.name end |
#rbi_file_name ⇒ Object
118 119 120 |
# File 'lib/tapioca/gemfile.rb', line 118 def rbi_file_name "#{name}@#{version}.rbi" end |
#version ⇒ Object
113 114 115 |
# File 'lib/tapioca/gemfile.rb', line 113 def version @spec.version end |