Class: RailsArchitect::Analyzers::ArchitectureAnalyzer

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_architect/analyzers/architecture_analyzer.rb

Overview

Analyzes Rails project architecture, structure, and design patterns

Constant Summary collapse

STANDARD_DIRS =
%w[
  app/models
  app/controllers
  app/views
  app/helpers
  app/services
  app/decorators
  app/policies
  app/validators
  config
  lib
  spec
].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project_path = Rails.root) ⇒ ArchitectureAnalyzer

Returns a new instance of ArchitectureAnalyzer.



25
26
27
# File 'lib/rails_architect/analyzers/architecture_analyzer.rb', line 25

def initialize(project_path = Rails.root)
  @project_path = project_path
end

Instance Attribute Details

#project_pathObject (readonly)

Returns the value of attribute project_path.



23
24
25
# File 'lib/rails_architect/analyzers/architecture_analyzer.rb', line 23

def project_path
  @project_path
end

Instance Method Details

#analyzeObject



29
30
31
32
33
34
35
36
37
# File 'lib/rails_architect/analyzers/architecture_analyzer.rb', line 29

def analyze
  {
    score: calculate_score,
    structure: check_structure,
    suggestions: generate_suggestions,
    missing_dirs: missing_directories,
    optional_dirs: check_optional_dirs
  }
end