Class: Tapioca::Gemfile::Gem

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/tapioca/gemfile.rb

Instance Method Summary collapse

Constructor Details

#initialize(spec) ⇒ Gem

Returns a new instance of Gem.



92
93
94
# File 'lib/tapioca/gemfile.rb', line 92

def initialize(spec)
  @spec = T.let(spec, Tapioca::Gemfile::Spec)
end

Instance Method Details

#filesObject



102
103
104
105
106
# File 'lib/tapioca/gemfile.rb', line 102

def files
  @spec.full_require_paths.flat_map do |path|
    Pathname.glob((Pathname.new(path) / "**/*.rb").to_s)
  end
end

#full_gem_pathObject



97
98
99
# File 'lib/tapioca/gemfile.rb', line 97

def full_gem_path
  @spec.full_gem_path.to_s
end

#nameObject



109
110
111
# File 'lib/tapioca/gemfile.rb', line 109

def name
  @spec.name
end

#rbi_file_nameObject



119
120
121
# File 'lib/tapioca/gemfile.rb', line 119

def rbi_file_name
  "#{name}@#{version}.rbi"
end

#versionObject



114
115
116
# File 'lib/tapioca/gemfile.rb', line 114

def version
  @spec.version
end