Class: Gem::Analyzer
- Inherits:
-
Ripper::SexpBuilder
- Object
- Ripper::SexpBuilder
- Gem::Analyzer
- 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
-
#warnings ⇒ Object
readonly
Cache of issues found for the current session.
Instance Method Summary collapse
Instance Attribute Details
#warnings ⇒ Object (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 |
#parse ⇒ Object
14 15 16 17 |
# File 'lib/rubygems-compile/analyzer.rb', line 14 def parse @warnings = [] super end |