Class: Boson::MethodInspector
- Inherits:
-
Object
- Object
- Boson::MethodInspector
- Extended by:
- Libraries
- Includes:
- MoreInspector, MoreMethodInspector
- Defined in:
- lib/boson/science.rb,
lib/boson/libraries.rb,
lib/boson/more_inspector.rb,
lib/boson/more_method_inspector.rb
Overview
This module also saves method locations so CommentInspector can scrape their commented method attributes.
Defined Under Namespace
Modules: Libraries, MoreInspector, MoreMethodInspector
Class Method Summary collapse
-
.scrape_arguments(file_string, meth) ⇒ Object
Returns argument arrays.
Instance Method Summary collapse
-
#inspector_in_file?(meth, inspector_method) ⇒ Boolean
investigate why this can’t be included.
Methods included from Libraries
Methods included from MoreMethodInspector
#during_new_method_added, #find_method_locations, #has_inspector_method?, #set_arguments
Class Method Details
.scrape_arguments(file_string, meth) ⇒ Object
Returns argument arrays
4 5 6 7 8 9 |
# File 'lib/boson/more_method_inspector.rb', line 4 def self.scrape_arguments(file_string, meth) tabspace = "[ \t]" if match = /^#{tabspace}*def#{tabspace}+(?:\w+\.)?#{Regexp.quote(meth)}#{tabspace}*($|(?:\(|\s+)([^\n\)]+)\s*\)?\s*$)/.match(file_string) (match.to_a[2] || '').strip.split(/\s*,\s*/).map {|e| e.split(/\s*=\s*/)} end end |
Instance Method Details
#inspector_in_file?(meth, inspector_method) ⇒ Boolean
investigate why this can’t be included
12 13 14 15 |
# File 'lib/boson/more_method_inspector.rb', line 12 def inspector_in_file?(meth, inspector_method) !(file_line = store[:method_locations] && store[:method_locations][meth]) ? false : true end |