Class: Hashira::Analysis::NamespacePlacement
- Inherits:
-
Placement
- Object
- Placement
- Hashira::Analysis::NamespacePlacement
show all
- Defined in:
- lib/hashira/analysis/namespace_placement.rb
Constant Summary
collapse
- RAILS_BASES =
%w[ApplicationRecord ApplicationController ApplicationJob ApplicationMailer
ApplicationHelper ApplicationCable ApplicationResource ApplicationSerializer
ApplicationPolicy ApplicationDecorator].freeze
Instance Method Summary
collapse
Methods inherited from Placement
build, #initialize
Instance Method Details
#baseline ⇒ Object
15
|
# File 'lib/hashira/analysis/namespace_placement.rb', line 15
def baseline = []
|
#charge(_file, nesting) ⇒ Object
17
18
19
|
# File 'lib/hashira/analysis/namespace_placement.rb', line 17
def charge(_file, nesting)
nesting.reverse_each.filter_map { catalog.strip(it).first }.first || project.root
end
|
#folding(census) ⇒ Object
23
|
# File 'lib/hashira/analysis/namespace_placement.rb', line 23
def folding(census) = Hashira::Analysis::Folding.new(catalog, census, suffixes: suffixes)
|
#mode ⇒ Object
11
|
# File 'lib/hashira/analysis/namespace_placement.rb', line 11
def mode = :namespace
|
#placed ⇒ Object
13
|
# File 'lib/hashira/analysis/namespace_placement.rb', line 13
def placed = catalog.map { [it, it.name] }
|
#skip?(segments) ⇒ Boolean
21
|
# File 'lib/hashira/analysis/namespace_placement.rb', line 21
def skip?(segments) = project.rails? && RAILS_BASES.include?(segments.first)
|