Class: Solargraph::Convention::Gemspec

Inherits:
Base
  • Object
show all
Defined in:
lib/solargraph/convention/gemspec.rb

Constant Summary

Constants inherited from Base

Base::EMPTY_ENVIRON

Instance Method Summary collapse

Methods inherited from Base

#global

Instance Method Details

#local(source_map) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/solargraph/convention/gemspec.rb', line 6

def local source_map
  return EMPTY_ENVIRON unless File.basename(source_map.filename).end_with?('.gemspec')
  @environ ||= Environ.new(
    requires: ['rubygems'],
    pins: [
      Solargraph::Pin::Reference::Override.from_comment(
        'Gem::Specification.new',
        %(
@yieldparam [self]
        )
      )
    ]
  )
end