Module: ArchUnit
- Defined in:
- lib/archunit.rb,
lib/archunit/testing.rb,
lib/archunit/version.rb,
lib/archunit/common/filter.rb,
lib/archunit/common/pattern.rb,
lib/archunit/error/user_error.rb,
lib/archunit/testing/color_utils.rb,
lib/archunit/testing/test_result.rb,
lib/archunit/common/regex_factory.rb,
lib/archunit/error/technical_error.rb,
lib/archunit/files/fluentapi/files.rb,
lib/archunit/graph/fluentapi/graph.rb,
lib/archunit/testing/assert_passes.rb,
lib/archunit/testing/rspec_adapter.rb,
lib/archunit/common/extraction/edge.rb,
lib/archunit/extraction/arch_ignore.rb,
lib/archunit/testing/result_factory.rb,
lib/archunit/testing/test_violation.rb,
lib/archunit/common/extraction/graph.rb,
lib/archunit/common/pattern_matching.rb,
lib/archunit/layers/fluentapi/layers.rb,
lib/archunit/slices/fluentapi/slices.rb,
lib/archunit/error/source_parse_error.rb,
lib/archunit/extraction/extract_graph.rb,
lib/archunit/graph/rendering/escaping.rb,
lib/archunit/metrics/calculation/lcom.rb,
lib/archunit/slices/uml/parse_diagram.rb,
lib/archunit/testing/minitest_adapter.rb,
lib/archunit/common/logging/inspection.rb,
lib/archunit/extraction/constant_index.rb,
lib/archunit/extraction/import_visitor.rb,
lib/archunit/extraction/locate_project.rb,
lib/archunit/extraction/resolve_import.rb,
lib/archunit/metrics/calculation/count.rb,
lib/archunit/metrics/fluentapi/metrics.rb,
lib/archunit/slices/uml/export_diagram.rb,
lib/archunit/testing/assertion_failure.rb,
lib/archunit/testing/violation_factory.rb,
lib/archunit/common/assertion/violation.rb,
lib/archunit/common/fluentapi/checkable.rb,
lib/archunit/extraction/extract_imports.rb,
lib/archunit/extraction/import_resolver.rb,
lib/archunit/extraction/resolved_import.rb,
lib/archunit/files/assertion/cycle_free.rb,
lib/archunit/files/extraction/file_info.rb,
lib/archunit/metrics/calculation/metric.rb,
lib/archunit/common/logging/check_logger.rb,
lib/archunit/extraction/constant_visitor.rb,
lib/archunit/graph/rendering/d2_renderer.rb,
lib/archunit/graph/rendering/csv_renderer.rb,
lib/archunit/graph/rendering/dot_renderer.rb,
lib/archunit/metrics/calculation/distance.rb,
lib/archunit/slices/uml/plant_uml_diagram.rb,
lib/archunit/common/extraction/import_kind.rb,
lib/archunit/common/projection/mapped_edge.rb,
lib/archunit/extraction/extraction_profile.rb,
lib/archunit/extraction/resolve_load_paths.rb,
lib/archunit/graph/rendering/export_report.rb,
lib/archunit/graph/rendering/html_document.rb,
lib/archunit/graph/rendering/html_renderer.rb,
lib/archunit/graph/rendering/json_renderer.rb,
lib/archunit/metrics/assertion/metric_zone.rb,
lib/archunit/common/fluentapi/check_options.rb,
lib/archunit/common/logging/logging_options.rb,
lib/archunit/files/assertion/matching_files.rb,
lib/archunit/graph/projection/collapse_node.rb,
lib/archunit/graph/rendering/graph_renderer.rb,
lib/archunit/metrics/extraction/metric_info.rb,
lib/archunit/common/projection/project_edges.rb,
lib/archunit/extraction/extract_dependencies.rb,
lib/archunit/extraction/local_string_tracker.rb,
lib/archunit/files/assertion/depend_on_files.rb,
lib/archunit/graph/projection/node_selection.rb,
lib/archunit/metrics/assertion/custom_metric.rb,
lib/archunit/metrics/fluentapi/logged_metric.rb,
lib/archunit/slices/fluentapi/diagram_source.rb,
lib/archunit/slices/uml/plant_uml_dependency.rb,
lib/archunit/common/projection/project_cycles.rb,
lib/archunit/common/projection/projected_edge.rb,
lib/archunit/common/projection/projected_node.rb,
lib/archunit/graph/projection/aggregate_edges.rb,
lib/archunit/graph/projection/create_snapshot.rb,
lib/archunit/graph/rendering/mermaid_renderer.rb,
lib/archunit/metrics/extraction/distance_info.rb,
lib/archunit/metrics/fluentapi/zone_condition.rb,
lib/archunit/extraction/enumerate_source_files.rb,
lib/archunit/files/fluentapi/file_rule_support.rb,
lib/archunit/graph/projection/pattern_collapse.rb,
lib/archunit/graph/rendering/rendering_support.rb,
lib/archunit/layers/assertion/layer_definition.rb,
lib/archunit/metrics/calculation/numeric_value.rb,
lib/archunit/metrics/fluentapi/metrics_builder.rb,
lib/archunit/testing/layer_violation_formatter.rb,
lib/archunit/testing/slice_violation_formatter.rb,
lib/archunit/common/extraction/parse_diagnostic.rb,
lib/archunit/common/projection/edge_projections.rb,
lib/archunit/common/projection/project_to_nodes.rb,
lib/archunit/extraction/conservative_local_flow.rb,
lib/archunit/files/extraction/extract_file_info.rb,
lib/archunit/graph/projection/graph_report_edge.rb,
lib/archunit/graph/projection/graph_report_node.rb,
lib/archunit/metrics/assertion/metric_predicate.rb,
lib/archunit/metrics/assertion/metric_threshold.rb,
lib/archunit/metrics/fluentapi/metric_selection.rb,
lib/archunit/metrics/reporting/metrics_exporter.rb,
lib/archunit/slices/assertion/adhere_to_diagram.rb,
lib/archunit/slices/projection/slice_projection.rb,
lib/archunit/testing/metric_violation_formatter.rb,
lib/archunit/common/projection/cycles/tarjan_scc.rb,
lib/archunit/layers/assertion/layer_dependencies.rb,
lib/archunit/slices/assertion/contain_dependency.rb,
lib/archunit/extraction/validate_extraction_paths.rb,
lib/archunit/graph/projection/graph_query_options.rb,
lib/archunit/metrics/fluentapi/metric_measurement.rb,
lib/archunit/slices/fluentapi/slice_scope_builder.rb,
lib/archunit/common/assertion/empty_test_violation.rb,
lib/archunit/common/extraction/dependency_evidence.rb,
lib/archunit/files/assertion/custom_file_condition.rb,
lib/archunit/files/fluentapi/custom_file_condition.rb,
lib/archunit/graph/fluentapi/project_graph_builder.rb,
lib/archunit/graph/projection/graph_report_summary.rb,
lib/archunit/layers/fluentapi/layered_architecture.rb,
lib/archunit/slices/projection/slicing_projections.rb,
lib/archunit/extraction/discover_gemspec_load_paths.rb,
lib/archunit/files/fluentapi/file_condition_builder.rb,
lib/archunit/graph/projection/folder_depth_collapse.rb,
lib/archunit/graph/projection/graph_report_snapshot.rb,
lib/archunit/metrics/fluentapi/lcom_metrics_builder.rb,
lib/archunit/common/projection/cycles/johnson_cycles.rb,
lib/archunit/metrics/extraction/extract_project_info.rb,
lib/archunit/metrics/fluentapi/count_metrics_builder.rb,
lib/archunit/metrics/fluentapi/custom_metric_builder.rb,
lib/archunit/metrics/fluentapi/metric_report_builder.rb,
lib/archunit/files/fluentapi/depend_on_file_condition.rb,
lib/archunit/metrics/extraction/extract_distance_info.rb,
lib/archunit/metrics/reporting/metrics_export_options.rb,
lib/archunit/slices/fluentapi/diagram_slice_condition.rb,
lib/archunit/files/fluentapi/cycle_free_file_condition.rb,
lib/archunit/layers/fluentapi/layer_definition_builder.rb,
lib/archunit/metrics/extraction/source_metrics_visitor.rb,
lib/archunit/metrics/fluentapi/custom_metric_condition.rb,
lib/archunit/files/assertion/depend_on_external_modules.rb,
lib/archunit/metrics/fluentapi/distance_metrics_builder.rb,
lib/archunit/slices/assertion/diagram_adherence_options.rb,
lib/archunit/layers/assertion/layer_dependency_violation.rb,
lib/archunit/slices/assertion/slice_dependency_violation.rb,
lib/archunit/files/fluentapi/match_pattern_file_condition.rb,
lib/archunit/layers/fluentapi/layered_architecture_values.rb,
lib/archunit/metrics/fluentapi/metric_predicate_condition.rb,
lib/archunit/metrics/fluentapi/metric_threshold_condition.rb,
lib/archunit/layers/fluentapi/layer_dependency_rule_builder.rb,
lib/archunit/files/fluentapi/depend_on_file_condition_builder.rb,
lib/archunit/slices/fluentapi/negative_slice_condition_builder.rb,
lib/archunit/slices/fluentapi/positive_slice_condition_builder.rb,
lib/archunit/files/fluentapi/depend_on_external_module_condition.rb,
lib/archunit/files/fluentapi/match_pattern_file_condition_builder.rb,
lib/archunit/slices/fluentapi/forbidden_slice_dependency_condition.rb,
lib/archunit/files/fluentapi/depend_on_external_module_condition_builder.rb,
lib/archunit/files/fluentapi/negated_match_pattern_file_condition_builder.rb,
lib/archunit/files/fluentapi/positive_match_pattern_file_condition_builder.rb
Overview
Public ArchUnitRuby API.
Defined Under Namespace
Modules: Common, Extraction, Files, GraphReporting, Layers, Metrics, Slices, Testing Classes: SourceParseError, TechnicalError, UserError
Constant Summary collapse
- Filter =
Common::Filter
- PatternMatching =
Common::PatternMatching
- RegexFactory =
Common::RegexFactory
- LoggingOptions =
Common::Logging::LoggingOptions
- CheckLogger =
Common::Logging::CheckLogger
- Violation =
Common::Assertion::Violation
- EmptyTestViolation =
Common::Assertion::EmptyTestViolation
- CheckOptions =
Common::FluentApi::CheckOptions
- Checkable =
Common::FluentApi::Checkable
- ImportKind =
Common::Extraction::ImportKind
- Edge =
Common::Extraction::Edge
- DependencyEvidence =
Common::Extraction::DependencyEvidence
- ParseDiagnostic =
Common::Extraction::ParseDiagnostic
- Graph =
Common::Extraction::Graph
- MappedEdge =
Common::Projection::MappedEdge
- ProjectedEdge =
Common::Projection::ProjectedEdge
- ProjectedNode =
Common::Projection::ProjectedNode
- CycleViolation =
Files::Assertion::CycleViolation
- FilePatternViolation =
Files::Assertion::FilePatternViolation
- FileDependencyViolation =
Files::Assertion::FileDependencyViolation
- ExternalModuleDependencyViolation =
Files::Assertion::ExternalModuleDependencyViolation
- FileInfo =
Files::Extraction::FileInfo
- CustomFileViolation =
Files::Assertion::CustomFileViolation
- LayerDefinition =
Layers::Assertion::LayerDefinition
- LayerDependencyViolation =
Layers::Assertion::LayerDependencyViolation
- SliceProjection =
Slices::Projection::SliceProjection
- SliceProjections =
Slices::Projection
- SliceDependencyViolation =
Slices::Assertion::SliceDependencyViolation
- DiagramAdherenceOptions =
Slices::Assertion::DiagramAdherenceOptions
- PlantUmlDependency =
Slices::Uml::PlantUmlDependency
- PlantUmlDiagram =
Slices::Uml::PlantUmlDiagram
- PlantUmlParser =
Slices::Uml::PlantUmlParser
- PlantUmlRenderer =
Slices::Uml::PlantUmlRenderer
- FolderDepthCollapse =
GraphReporting::Projection::FolderDepthCollapse
- PatternCollapse =
GraphReporting::Projection::PatternCollapse
- GraphQueryOptions =
GraphReporting::Projection::GraphQueryOptions
- GraphReportNode =
GraphReporting::Projection::GraphReportNode
- GraphReportEdge =
GraphReporting::Projection::GraphReportEdge
- GraphReportSummary =
GraphReporting::Projection::GraphReportSummary
- GraphReportSnapshot =
GraphReporting::Projection::GraphReportSnapshot
- GraphSnapshotFactory =
GraphReporting::Projection::SnapshotFactory
- GraphRenderer =
GraphReporting::Rendering::GraphRenderer
- MetricMethodInfo =
Metrics::Extraction::MethodInfo
- MetricFieldInfo =
Metrics::Extraction::FieldInfo
- ClassInfo =
Metrics::Extraction::ClassInfo
- MetricFileInfo =
Metrics::Extraction::FileInfo
- MetricProjectInfo =
Metrics::Extraction::ProjectInfo
- DistanceInfo =
Metrics::Extraction::DistanceInfo
- Metric =
Metrics::Calculation::Metric
- CountMetrics =
Metrics::Calculation::Count
- LCOMMetrics =
Metrics::Calculation::LCOM
- DistanceMetrics =
Metrics::Calculation::Distance
- MetricMeasurement =
Metrics::FluentApi::MetricMeasurement
- MetricsExportOptions =
Metrics::Reporting::MetricsExportOptions
- MetricsExporter =
Metrics::Reporting::MetricsExporter
- MetricExtraction =
Metrics::Extraction
- MetricZoneViolation =
Metrics::Assertion::MetricZoneViolation
- MetricThresholdViolation =
Metrics::Assertion::MetricThresholdViolation
- MetricPredicateViolation =
Metrics::Assertion::MetricPredicateViolation
- CustomMetricViolation =
Metrics::Assertion::CustomMetricViolation
- TestViolation =
Testing::TestViolation
- TestResult =
Testing::TestResult
- ColorUtils =
Testing::ColorUtils
- ViolationFactory =
Testing::ViolationFactory
- ResultFactory =
Testing::ResultFactory
- AssertionFailure =
Testing::AssertionFailure
- VERSION =
'1.0.0'
Class Method Summary collapse
-
.assert_passes(rule, options = nil) ⇒ nil
Raises AssertionFailure when a rule returns violations.
-
.clear_graph_cache ⇒ nil
Clears every cached dependency graph in the current process.
-
.format_violations(violations, color: nil) ⇒ String
Formats structured violations for a terminal or test failure.
-
.metrics(project_locator = nil) ⇒ Metrics::FluentApi::MetricsBuilder
Starts an immutable source-metrics scope.
-
.project_files(project_locator = nil) ⇒ Files::FluentApi::FileConditionBuilder
(also: files)
Starts an immutable file-rule sentence.
-
.project_graph(project_locator = nil) ⇒ GraphReporting::FluentApi::ProjectGraphBuilder
(also: dependency_graph)
Starts an immutable dependency-graph report.
-
.project_layers(project_locator = nil) ⇒ Layers::FluentApi::LayeredArchitecture
(also: layers)
Starts an immutable named-layer policy.
-
.project_slices(project_locator = nil) ⇒ Slices::FluentApi::SliceScopeBuilder
(also: slices)
Starts an immutable slice-rule sentence.
Class Method Details
.assert_passes(rule, options = nil) ⇒ nil
Raises AssertionFailure when a rule returns violations.
25 26 27 |
# File 'lib/archunit/testing/assert_passes.rb', line 25 def self.assert_passes(rule, = nil) Testing.assert_passes(rule, ) end |
.clear_graph_cache ⇒ nil
Clears every cached dependency graph in the current process. Use this after changing analyzed source files between checks.
116 117 118 |
# File 'lib/archunit.rb', line 116 def self.clear_graph_cache Extraction.clear_graph_cache end |
.format_violations(violations, color: nil) ⇒ String
Formats structured violations for a terminal or test failure.
37 38 39 |
# File 'lib/archunit/testing.rb', line 37 def self.format_violations(violations, color: nil) Testing.format_violations(violations, color:) end |
.metrics(project_locator = nil) ⇒ Metrics::FluentApi::MetricsBuilder
Starts an immutable source-metrics scope.
23 24 25 |
# File 'lib/archunit/metrics/fluentapi/metrics.rb', line 23 def self.metrics(project_locator = nil) Metrics::FluentApi.metrics(project_locator) end |
.project_files(project_locator = nil) ⇒ Files::FluentApi::FileConditionBuilder Also known as: files
Starts an immutable file-rule sentence.
30 31 32 |
# File 'lib/archunit/files/fluentapi/files.rb', line 30 def self.project_files(project_locator = nil) Files::FluentApi.project_files(project_locator) end |
.project_graph(project_locator = nil) ⇒ GraphReporting::FluentApi::ProjectGraphBuilder Also known as: dependency_graph
Starts an immutable dependency-graph report.
27 28 29 |
# File 'lib/archunit/graph/fluentapi/graph.rb', line 27 def self.project_graph(project_locator = nil) GraphReporting::FluentApi.project_graph(project_locator) end |
.project_layers(project_locator = nil) ⇒ Layers::FluentApi::LayeredArchitecture Also known as: layers
Starts an immutable named-layer policy.
27 28 29 |
# File 'lib/archunit/layers/fluentapi/layers.rb', line 27 def self.project_layers(project_locator = nil) Layers::FluentApi.project_layers(project_locator) end |
.project_slices(project_locator = nil) ⇒ Slices::FluentApi::SliceScopeBuilder Also known as: slices
Starts an immutable slice-rule sentence.
27 28 29 |
# File 'lib/archunit/slices/fluentapi/slices.rb', line 27 def self.project_slices(project_locator = nil) Slices::FluentApi.project_slices(project_locator) end |
ArchUnitRuby