Class: Keela::Strategies::Methods
Instance Method Summary
collapse
#definition_file_pattern, #extract_definitions_from_file
Instance Method Details
#default_definition_file_pattern ⇒ Object
10
11
12
|
# File 'lib/keela/strategies/methods.rb', line 10
def default_definition_file_pattern
%r{app/helpers|app/models}
end
|
14
15
16
17
18
|
# File 'lib/keela/strategies/methods.rb', line 14
def (line)
return nil unless line =~ /def ([^(;\s]+)/
Regexp.last_match(1).chomp
end
|
#name ⇒ Object
6
7
8
|
# File 'lib/keela/strategies/methods.rb', line 6
def name
"methods"
end
|
33
34
35
|
# File 'lib/keela/strategies/methods.rb', line 33
def
false
end
|
#usage_regex(name) ⇒ Object
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/keela/strategies/methods.rb', line 20
def usage_regex(name)
method_name = Regexp.quote(name.sub(/^self\./, ""))
if name.end_with?("=")
/(?<!def |def self\.)#{method_name.chomp("=")}\W=*/
else
/(?<!def |def self\.)#{method_name}\W/
end
end
|