Class: Gem::Analyzer

Inherits:
Ripper::SexpBuilder
  • Object
show all
Defined in:
lib/rubygems-compile/analyzer.rb

Overview

Uses the ripper parser to analyze ruby code contained in gems and raises warnings if the code has potential issues.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#warningsObject (readonly)

Cache of issues found for the current session.



12
13
14
# File 'lib/rubygems-compile/analyzer.rb', line 12

def warnings
  @warnings
end

Instance Method Details

#on_kw(token) ⇒ Object



19
20
21
22
23
24
# File 'lib/rubygems-compile/analyzer.rb', line 19

def on_kw token
  # Related to MacRuby ticket #721
  if token == '__FILE__'
    @warnings << '__FILE__ keyword is used (MacRuby ticket #721)'
  end
end

#parseObject



14
15
16
17
# File 'lib/rubygems-compile/analyzer.rb', line 14

def parse
  @warnings = []
  super
end