Class: RubyAudit::Scanner
- Inherits:
-
Object
- Object
- RubyAudit::Scanner
- Defined in:
- lib/ruby_audit/scanner.rb
Defined Under Namespace
Classes: Version
Instance Method Summary collapse
-
#initialize ⇒ Scanner
constructor
A new instance of Scanner.
- #scan(options = {}, &block) ⇒ Object
- #scan_ruby(options = {}, &block) ⇒ Object
- #scan_rubygems(options = {}, &block) ⇒ Object
Constructor Details
Instance Method Details
#scan(options = {}, &block) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/ruby_audit/scanner.rb', line 19 def scan( = {}, &block) return enum_for(__method__, ) unless block scan_ruby(, &block) scan_rubygems(, &block) self end |
#scan_ruby(options = {}, &block) ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/ruby_audit/scanner.rb', line 28 def scan_ruby( = {}, &block) version = if RUBY_PATCHLEVEL < 0 ruby_version else "#{RUBY_VERSION}.#{RUBY_PATCHLEVEL}" end specs = [Version.new(RUBY_ENGINE, version)] scan_inner(specs, 'ruby', , &block) end |