54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
# File 'lib/migrate/common.rb', line 54
def infer_engine_from_namespace
caller_locations(3, 10).each do |loc|
path = loc.absolute_path || loc.path
if path =~ %r{/gems/(lesli_[^/-]+)}
return $1
end
if path =~ %r{/engines/(lesli_[^/]+)}
return $1
end
if path =~ %r{/engines/(Lesli[^/]+)}
return $1.underscore
end
if path =~ %r{/gems/(lesli)}
return $1
end
if path =~ %r{/engines/(lesli)}
return $1
end
if path =~ %r{/engines/(Lesli)}
return $1.underscore
end
end
nil
end
|