Class: Tapioca::Gemfile::Gem
- Inherits:
-
Object
- Object
- Tapioca::Gemfile::Gem
- Extended by:
- T::Sig
- Defined in:
- lib/tapioca/gemfile.rb
Instance Method Summary collapse
- #files ⇒ Object
- #full_gem_path ⇒ Object
-
#initialize(spec) ⇒ Gem
constructor
A new instance of Gem.
- #name ⇒ Object
- #rbi_file_name ⇒ Object
- #version ⇒ Object
Methods included from T::Sig
Constructor Details
#initialize(spec) ⇒ Gem
Returns a new instance of Gem.
104 105 106 |
# File 'lib/tapioca/gemfile.rb', line 104 def initialize(spec) @spec = T.let(spec, Spec) end |
Instance Method Details
#files ⇒ Object
114 115 116 117 118 |
# File 'lib/tapioca/gemfile.rb', line 114 def files @spec.full_require_paths.flat_map do |path| Pathname.new(path).glob("**/*.rb") end end |
#full_gem_path ⇒ Object
109 110 111 |
# File 'lib/tapioca/gemfile.rb', line 109 def full_gem_path @spec.full_gem_path.to_s end |
#name ⇒ Object
121 122 123 |
# File 'lib/tapioca/gemfile.rb', line 121 def name @spec.name end |
#rbi_file_name ⇒ Object
131 132 133 |
# File 'lib/tapioca/gemfile.rb', line 131 def rbi_file_name "#{name}@#{version}.rbi" end |
#version ⇒ Object
126 127 128 |
# File 'lib/tapioca/gemfile.rb', line 126 def version @spec.version end |