class-metrix 0.1.2 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.editorconfig +48 -0
- data/.vscode/README.md +72 -0
- data/.vscode/extensions.json +28 -0
- data/.vscode/launch.json +32 -0
- data/.vscode/settings.json +88 -0
- data/.vscode/tasks.json +99 -0
- data/CHANGELOG.md +71 -4
- data/README.md +41 -7
- data/docs/ARCHITECTURE.md +501 -0
- data/examples/README.md +161 -114
- data/examples/basic_usage.rb +88 -0
- data/examples/debug_levels_demo.rb +65 -0
- data/examples/debug_mode_demo.rb +75 -0
- data/examples/inheritance_and_modules.rb +155 -0
- data/lib/class_metrix/extractor.rb +106 -11
- data/lib/class_metrix/extractors/constants_extractor.rb +155 -21
- data/lib/class_metrix/extractors/methods_extractor.rb +186 -21
- data/lib/class_metrix/extractors/multi_type_extractor.rb +6 -5
- data/lib/class_metrix/formatters/components/footer_component.rb +1 -1
- data/lib/class_metrix/formatters/components/table_component/column_width_calculator.rb +56 -0
- data/lib/class_metrix/formatters/components/table_component/row_processor.rb +138 -0
- data/lib/class_metrix/formatters/components/table_component/table_data_extractor.rb +54 -0
- data/lib/class_metrix/formatters/components/table_component/table_renderer.rb +55 -0
- data/lib/class_metrix/formatters/components/table_component.rb +30 -244
- data/lib/class_metrix/formatters/shared/markdown_table_builder.rb +10 -5
- data/lib/class_metrix/formatters/shared/table_builder.rb +84 -21
- data/lib/class_metrix/formatters/shared/value_processor.rb +72 -16
- data/lib/class_metrix/utils/debug_logger.rb +159 -0
- data/lib/class_metrix/version.rb +1 -1
- metadata +17 -9
- data/examples/advanced/error_handling.rb +0 -199
- data/examples/advanced/hash_expansion.rb +0 -180
- data/examples/basic/01_simple_constants.rb +0 -56
- data/examples/basic/02_simple_methods.rb +0 -99
- data/examples/basic/03_multi_type_extraction.rb +0 -116
- data/examples/components/configurable_reports.rb +0 -201
- data/examples/csv_output_demo.rb +0 -237
- data/examples/real_world/microservices_audit.rb +0 -312
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 440b6eacf85b731cd683533be57ab3b2c17b25605ce70ed650bed43539f34531
|
4
|
+
data.tar.gz: 728575b7ddac28f55d5d192f3e1004858f19820453a9e6c3d00002df50855c92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 868af534a658dc3a083315ee1660f4ba8754919474ac3d6c5c2458f2a5af8df763bfa292d6d1c426a0df20b4ef3419cd7cc031397bd14ed3a563f0dee07b605c
|
7
|
+
data.tar.gz: 9bcfe4160f94b93abf072e1888c92222a790387f16e16d376ef93be48c28d4ac7ee1edd931c6b9e70236c64e3bec17d0610c2561db14ab80e60d4f0ed1a6af41
|
data/.editorconfig
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
# EditorConfig is awesome: https://EditorConfig.org
|
2
|
+
|
3
|
+
# top-most EditorConfig file
|
4
|
+
root = true
|
5
|
+
|
6
|
+
# All files
|
7
|
+
[*]
|
8
|
+
charset = utf-8
|
9
|
+
end_of_line = lf
|
10
|
+
insert_final_newline = true
|
11
|
+
trim_trailing_whitespace = true
|
12
|
+
|
13
|
+
# Ruby files
|
14
|
+
[*.rb]
|
15
|
+
indent_style = space
|
16
|
+
indent_size = 2
|
17
|
+
max_line_length = 140
|
18
|
+
|
19
|
+
# Gemfiles and other Ruby-related files
|
20
|
+
[{Gemfile,Rakefile,*.gemspec}]
|
21
|
+
indent_style = space
|
22
|
+
indent_size = 2
|
23
|
+
|
24
|
+
# YAML files
|
25
|
+
[*.{yml,yaml}]
|
26
|
+
indent_style = space
|
27
|
+
indent_size = 2
|
28
|
+
|
29
|
+
# Markdown files
|
30
|
+
[*.md]
|
31
|
+
indent_style = space
|
32
|
+
indent_size = 2
|
33
|
+
trim_trailing_whitespace = false
|
34
|
+
|
35
|
+
# JSON files
|
36
|
+
[*.json]
|
37
|
+
indent_style = space
|
38
|
+
indent_size = 2
|
39
|
+
|
40
|
+
# JavaScript/TypeScript files (if any)
|
41
|
+
[*.{js,ts}]
|
42
|
+
indent_style = space
|
43
|
+
indent_size = 2
|
44
|
+
|
45
|
+
# Shell scripts
|
46
|
+
[*.sh]
|
47
|
+
indent_style = space
|
48
|
+
indent_size = 2
|
data/.vscode/README.md
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
# VS Code Works### Ruby Support
|
2
|
+
|
3
|
+
- **Ruby LSP** (`shopify.ruby-lsp`) - Primary Ruby language server with Rubocop formatting
|
4
|
+
- **Solargraph** (`castwide.solargraph`) - Alternative Ruby IntelliSense
|
5
|
+
|
6
|
+
### Markdown Support
|
7
|
+
|
8
|
+
- **Prettier** (`esbenp.prettier-vscode`) - Primary Markdown formatter
|
9
|
+
- **Markdown All in One** (`yzhang.markdown-all-in-one`) - Comprehensive Markdown support
|
10
|
+
- **markdownlint** (`davidanson.vscode-markdownlint`) - Markdown lintingnfiguration
|
11
|
+
|
12
|
+
This folder contains VS Code workspace configuration files that help maintain consistent development environment across team members.
|
13
|
+
|
14
|
+
## Files Overview
|
15
|
+
|
16
|
+
- **settings.json**: Workspace-specific settings for Ruby and Markdown formatting
|
17
|
+
- **extensions.json**: Recommended extensions for this project
|
18
|
+
- **tasks.json**: Predefined tasks for common operations (Rubocop, RSpec)
|
19
|
+
- **launch.json**: Debug configurations for Ruby files and tests
|
20
|
+
|
21
|
+
## Required Extensions
|
22
|
+
|
23
|
+
To get the best development experience, install these recommended extensions:
|
24
|
+
|
25
|
+
### Ruby Support
|
26
|
+
|
27
|
+
- **Ruby LSP** (`shopify.ruby-lsp`) - Primary Ruby language server
|
28
|
+
- **Solargraph** (`castwide.solargraph`) - Alternative Ruby IntelliSense
|
29
|
+
|
30
|
+
### Markdown Support
|
31
|
+
|
32
|
+
- **Markdown All in One** (`yzhang.markdown-all-in-one`) - Comprehensive Markdown support
|
33
|
+
- **markdownlint** (`davidanson.vscode-markdownlint`) - Markdown linting
|
34
|
+
|
35
|
+
### General
|
36
|
+
|
37
|
+
- **EditorConfig** (`editorconfig.editorconfig`) - Consistent coding styles
|
38
|
+
- **GitLens** (`eamodio.gitlens`) - Enhanced Git capabilities
|
39
|
+
|
40
|
+
## Auto-formatting
|
41
|
+
|
42
|
+
The configuration enables automatic formatting on save for:
|
43
|
+
|
44
|
+
- **Ruby files**: Using Rubocop via Ruby LSP (Shopify.ruby-lsp)
|
45
|
+
- **Markdown files**: Using Prettier formatter
|
46
|
+
- **Format on type**: Enabled for Ruby files for real-time formatting
|
47
|
+
|
48
|
+
## Available Tasks
|
49
|
+
|
50
|
+
Access via `Ctrl+Shift+P` → "Tasks: Run Task":
|
51
|
+
|
52
|
+
- **Rubocop: Check** - Run Rubocop linting
|
53
|
+
- **Rubocop: Fix** - Auto-fix Rubocop violations
|
54
|
+
- **Rubocop: Fix Current File** - Fix violations in current file only
|
55
|
+
- **RSpec: Run All Tests** - Run complete test suite
|
56
|
+
- **RSpec: Run Current File** - Run tests for current file
|
57
|
+
- **Bundle Install** - Install/update gems
|
58
|
+
|
59
|
+
## Debug Configurations
|
60
|
+
|
61
|
+
Available debug configurations:
|
62
|
+
|
63
|
+
- **Ruby: Run Current File** - Debug the currently open Ruby file
|
64
|
+
- **RSpec: Debug Current File** - Debug tests in current file
|
65
|
+
- **RSpec: Debug All Tests** - Debug entire test suite
|
66
|
+
|
67
|
+
## Setup Instructions
|
68
|
+
|
69
|
+
1. Open this project in VS Code
|
70
|
+
2. Install recommended extensions (VS Code will prompt you)
|
71
|
+
3. Run "Bundle Install" task to ensure gems are installed
|
72
|
+
4. Start coding! Auto-formatting will work on save
|
@@ -0,0 +1,28 @@
|
|
1
|
+
{ "recommendations": [
|
2
|
+
// Ruby language support
|
3
|
+
"shopify.ruby-lsp",
|
4
|
+
"castwide.solargraph",
|
5
|
+
|
6
|
+
// Alternative Ruby support (choose one of the above)
|
7
|
+
// "rebornix.ruby",
|
8
|
+
|
9
|
+
// Markdown support
|
10
|
+
"esbenp.prettier-vscode",
|
11
|
+
"yzhang.markdown-all-in-one",
|
12
|
+
"davidanson.vscode-markdownlint",
|
13
|
+
|
14
|
+
// General productivity
|
15
|
+
"ms-vscode.vscode-json",
|
16
|
+
"redhat.vscode-yaml",
|
17
|
+
"editorconfig.editorconfig",
|
18
|
+
|
19
|
+
// Git integration
|
20
|
+
"eamodio.gitlens",
|
21
|
+
|
22
|
+
// Additional helpful extensions
|
23
|
+
"ms-vscode.test-adapter-converter",
|
24
|
+
"hbenl.vscode-test-explorer",
|
25
|
+
"formulahendry.auto-rename-tag",
|
26
|
+
"bradlc.vscode-tailwindcss"
|
27
|
+
]
|
28
|
+
}
|
data/.vscode/launch.json
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
{
|
2
|
+
"version": "0.2.0",
|
3
|
+
"configurations": [
|
4
|
+
{
|
5
|
+
"name": "Ruby: Run Current File",
|
6
|
+
"type": "ruby_lsp",
|
7
|
+
"request": "launch",
|
8
|
+
"program": "${file}"
|
9
|
+
},
|
10
|
+
{
|
11
|
+
"name": "Ruby: Run with Arguments",
|
12
|
+
"type": "ruby_lsp",
|
13
|
+
"request": "launch",
|
14
|
+
"program": "${file}",
|
15
|
+
"args": []
|
16
|
+
},
|
17
|
+
{
|
18
|
+
"name": "RSpec: Debug Current File",
|
19
|
+
"type": "ruby_lsp",
|
20
|
+
"request": "launch",
|
21
|
+
"program": "bundle",
|
22
|
+
"args": ["exec", "rspec", "${file}"]
|
23
|
+
},
|
24
|
+
{
|
25
|
+
"name": "RSpec: Debug All Tests",
|
26
|
+
"type": "ruby_lsp",
|
27
|
+
"request": "launch",
|
28
|
+
"program": "bundle",
|
29
|
+
"args": ["exec", "rspec"]
|
30
|
+
}
|
31
|
+
]
|
32
|
+
}
|
@@ -0,0 +1,88 @@
|
|
1
|
+
{
|
2
|
+
// Ruby language settings
|
3
|
+
"ruby.format": "rubocop",
|
4
|
+
"ruby.lint": {
|
5
|
+
"rubocop": {
|
6
|
+
"useBundler": true
|
7
|
+
}
|
8
|
+
},
|
9
|
+
"ruby.useLanguageServer": true,
|
10
|
+
"ruby.intellisense": "rubyLsp",
|
11
|
+
|
12
|
+
// Auto-formatting settings
|
13
|
+
"editor.formatOnSave": true,
|
14
|
+
"editor.formatOnPaste": true,
|
15
|
+
"editor.formatOnType": false,
|
16
|
+
"editor.codeActionsOnSave": {
|
17
|
+
"source.fixAll.rubocop": "explicit"
|
18
|
+
},
|
19
|
+
|
20
|
+
// Language-specific formatting
|
21
|
+
"[ruby]": {
|
22
|
+
"editor.defaultFormatter": "Shopify.ruby-lsp",
|
23
|
+
"editor.formatOnSave": true,
|
24
|
+
"editor.tabSize": 2,
|
25
|
+
"editor.insertSpaces": true,
|
26
|
+
"editor.semanticHighlighting.enabled": true,
|
27
|
+
"editor.formatOnType": true,
|
28
|
+
"editor.rulers": [140],
|
29
|
+
"editor.trimAutoWhitespace": true
|
30
|
+
},
|
31
|
+
"[markdown]": {
|
32
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
33
|
+
"editor.formatOnSave": true,
|
34
|
+
"editor.tabSize": 2,
|
35
|
+
"editor.wordWrap": "on",
|
36
|
+
"editor.quickSuggestions": {
|
37
|
+
"comments": "off",
|
38
|
+
"strings": "off",
|
39
|
+
"other": "off"
|
40
|
+
}
|
41
|
+
},
|
42
|
+
|
43
|
+
// File associations
|
44
|
+
"files.associations": {
|
45
|
+
"*.gemspec": "ruby",
|
46
|
+
"Gemfile": "ruby",
|
47
|
+
"Rakefile": "ruby",
|
48
|
+
".rubocop.yml": "yaml"
|
49
|
+
},
|
50
|
+
|
51
|
+
// Auto-save settings
|
52
|
+
"files.autoSave": "onFocusChange",
|
53
|
+
"files.trimTrailingWhitespace": true,
|
54
|
+
"files.insertFinalNewline": true,
|
55
|
+
"files.trimFinalNewlines": true,
|
56
|
+
|
57
|
+
// Ruby LSP specific settings
|
58
|
+
"rubyLsp.enabledFeatures": {
|
59
|
+
"codeActions": true,
|
60
|
+
"diagnostics": true,
|
61
|
+
"documentHighlights": true,
|
62
|
+
"documentLink": true,
|
63
|
+
"documentSymbols": true,
|
64
|
+
"foldingRanges": true,
|
65
|
+
"formatting": true,
|
66
|
+
"hover": true,
|
67
|
+
"inlayHint": true,
|
68
|
+
"onTypeFormatting": true,
|
69
|
+
"selectionRanges": true,
|
70
|
+
"semanticHighlighting": true,
|
71
|
+
"completion": true,
|
72
|
+
"codeLens": true,
|
73
|
+
"definition": true,
|
74
|
+
"workspaceSymbol": true,
|
75
|
+
"signatureHelp": true,
|
76
|
+
"typeHierarchy": true
|
77
|
+
},
|
78
|
+
"rubyLsp.formatter": "rubocop",
|
79
|
+
|
80
|
+
// Rubocop specific settings
|
81
|
+
"ruby.rubocop.configFilePath": ".rubocop.yml",
|
82
|
+
"ruby.rubocop.suppressRubocopWarnings": false,
|
83
|
+
|
84
|
+
// Additional helpful settings
|
85
|
+
"breadcrumbs.enabled": true,
|
86
|
+
"editor.minimap.enabled": true,
|
87
|
+
"workbench.editor.enablePreview": false
|
88
|
+
}
|
data/.vscode/tasks.json
ADDED
@@ -0,0 +1,99 @@
|
|
1
|
+
{
|
2
|
+
"version": "2.0.0",
|
3
|
+
"tasks": [
|
4
|
+
{
|
5
|
+
"label": "Rubocop: Check",
|
6
|
+
"type": "shell",
|
7
|
+
"command": "bundle",
|
8
|
+
"args": ["exec", "rubocop"],
|
9
|
+
"group": "test",
|
10
|
+
"presentation": {
|
11
|
+
"echo": true,
|
12
|
+
"reveal": "always",
|
13
|
+
"focus": false,
|
14
|
+
"panel": "shared"
|
15
|
+
},
|
16
|
+
"problemMatcher": [
|
17
|
+
{
|
18
|
+
"owner": "rubocop",
|
19
|
+
"fileLocation": "absolute",
|
20
|
+
"pattern": [
|
21
|
+
{
|
22
|
+
"regexp": "^([^:]+):(\\d+):(\\d+): ([A-Z]): (.*)$",
|
23
|
+
"file": 1,
|
24
|
+
"line": 2,
|
25
|
+
"column": 3,
|
26
|
+
"severity": 4,
|
27
|
+
"message": 5
|
28
|
+
}
|
29
|
+
]
|
30
|
+
}
|
31
|
+
]
|
32
|
+
},
|
33
|
+
{
|
34
|
+
"label": "Rubocop: Fix",
|
35
|
+
"type": "shell",
|
36
|
+
"command": "bundle",
|
37
|
+
"args": ["exec", "rubocop", "-A"],
|
38
|
+
"group": "build",
|
39
|
+
"presentation": {
|
40
|
+
"echo": true,
|
41
|
+
"reveal": "always",
|
42
|
+
"focus": false,
|
43
|
+
"panel": "shared"
|
44
|
+
}
|
45
|
+
},
|
46
|
+
{
|
47
|
+
"label": "Rubocop: Fix Current File",
|
48
|
+
"type": "shell",
|
49
|
+
"command": "bundle",
|
50
|
+
"args": ["exec", "rubocop", "-A", "${file}"],
|
51
|
+
"group": "build",
|
52
|
+
"presentation": {
|
53
|
+
"echo": true,
|
54
|
+
"reveal": "silent",
|
55
|
+
"focus": false,
|
56
|
+
"panel": "shared"
|
57
|
+
}
|
58
|
+
},
|
59
|
+
{
|
60
|
+
"label": "RSpec: Run All Tests",
|
61
|
+
"type": "shell",
|
62
|
+
"command": "bundle",
|
63
|
+
"args": ["exec", "rspec"],
|
64
|
+
"group": "test",
|
65
|
+
"presentation": {
|
66
|
+
"echo": true,
|
67
|
+
"reveal": "always",
|
68
|
+
"focus": false,
|
69
|
+
"panel": "shared"
|
70
|
+
}
|
71
|
+
},
|
72
|
+
{
|
73
|
+
"label": "RSpec: Run Current File",
|
74
|
+
"type": "shell",
|
75
|
+
"command": "bundle",
|
76
|
+
"args": ["exec", "rspec", "${file}"],
|
77
|
+
"group": "test",
|
78
|
+
"presentation": {
|
79
|
+
"echo": true,
|
80
|
+
"reveal": "always",
|
81
|
+
"focus": false,
|
82
|
+
"panel": "shared"
|
83
|
+
}
|
84
|
+
},
|
85
|
+
{
|
86
|
+
"label": "Bundle Install",
|
87
|
+
"type": "shell",
|
88
|
+
"command": "bundle",
|
89
|
+
"args": ["install"],
|
90
|
+
"group": "build",
|
91
|
+
"presentation": {
|
92
|
+
"echo": true,
|
93
|
+
"reveal": "always",
|
94
|
+
"focus": false,
|
95
|
+
"panel": "shared"
|
96
|
+
}
|
97
|
+
}
|
98
|
+
]
|
99
|
+
}
|
data/CHANGELOG.md
CHANGED
@@ -5,20 +5,86 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
|
-
## [
|
8
|
+
## [Unreleased]
|
9
|
+
|
10
|
+
## [1.0.0] - 2025-06-07
|
11
|
+
|
12
|
+
### 🎉 Major Release - Production Ready
|
13
|
+
|
14
|
+
This marks the first stable release of ClassMetrix with a comprehensive feature set and robust architecture.
|
9
15
|
|
10
16
|
### Added
|
17
|
+
|
18
|
+
- **🐛 Advanced Debug System**: Comprehensive debug logging with three levels (`:basic`, `:detailed`, `:verbose`)
|
19
|
+
- Safe object inspection for problematic objects with broken `inspect`/`to_s` methods
|
20
|
+
- Smart hash detection to prevent issues with proxy objects
|
21
|
+
- Component-specific debug loggers for targeted troubleshooting
|
22
|
+
- Error-resistant operations with graceful degradation
|
23
|
+
- **📊 Enhanced Hash Expansion**: Multiple hash expansion modes for different analysis needs
|
24
|
+
- `show_only_main`: Show collapsed hash representations (default)
|
25
|
+
- `show_only_keys`: Show only expanded key rows for detailed analysis
|
26
|
+
- `show_expanded_details`: Show both main and expanded rows
|
27
|
+
- Support for nested hash structures with proper truncation
|
28
|
+
- **🏗️ Refactored Architecture**: Clean separation of concerns and improved maintainability
|
29
|
+
- Modular extractor system with dedicated extractors for each type
|
30
|
+
- Shared table builders for consistent formatting across output formats
|
31
|
+
- Centralized value processor for robust value handling
|
32
|
+
- Component-based formatter architecture
|
33
|
+
- **⚙️ Enhanced Configuration**: More granular control over extraction and formatting
|
34
|
+
- Hash expansion display options (`hide_main_row`, `hide_key_rows`)
|
35
|
+
- Improved inheritance and module inclusion handling
|
36
|
+
- Better error handling and recovery mechanisms
|
37
|
+
- **🔧 VS Code Integration**: Complete development environment setup
|
38
|
+
- Auto-formatting with Rubocop integration
|
39
|
+
- Task definitions for common operations
|
40
|
+
- Debug configurations for Ruby and RSpec
|
41
|
+
- Recommended extensions for optimal development experience
|
42
|
+
|
43
|
+
### Enhanced
|
44
|
+
|
45
|
+
- **Hash Processing**: Robust handling of complex nested structures and edge cases
|
46
|
+
- **CSV Export**: Improved hash flattening with better column organization
|
47
|
+
- **Error Handling**: More resilient extraction with detailed error reporting
|
48
|
+
- **Performance**: Optimized table building and value processing
|
49
|
+
- **Documentation**: Comprehensive examples and architecture documentation
|
50
|
+
|
51
|
+
### Fixed
|
52
|
+
|
53
|
+
- Parameter list optimization in `MultiTypeExtractor` (reduced from 6 to 5 parameters)
|
54
|
+
- Method length optimization in `ValueProcessor.process_for_csv` (reduced from 28 to 25 lines)
|
55
|
+
- Improved hash detection to prevent issues with ActiveRecord and other proxy objects
|
56
|
+
- Better handling of objects with problematic method behaviors
|
57
|
+
|
58
|
+
### Technical Improvements
|
59
|
+
|
60
|
+
- **Safety-First Design**: All operations wrapped with exception handling
|
61
|
+
- **Debug Integration**: Every component includes comprehensive debug logging
|
62
|
+
- **Type Safety**: Strict hash detection prevents issues with duck-typed objects
|
63
|
+
- **Modular Design**: Easy to extend with new extraction types and formatters
|
64
|
+
- **Test Coverage**: Extensive test suite covering edge cases and error conditions
|
65
|
+
|
66
|
+
### Breaking Changes
|
67
|
+
|
68
|
+
- Hash expansion now defaults to `show_only_main` (was `show_expanded_details`)
|
69
|
+
- Some internal API changes for better consistency (affects custom extensions)
|
70
|
+
|
71
|
+
## [0.1.2] - 2025-06-07
|
72
|
+
|
73
|
+
### Added
|
74
|
+
|
11
75
|
- GitHub Actions CI/CD workflow for automated releases
|
12
76
|
- Multi-version Ruby testing (3.1, 3.2, 3.3)
|
13
77
|
- Automated gem publishing to RubyGems
|
14
78
|
- Version consistency checking
|
15
79
|
|
16
80
|
### Changed
|
81
|
+
|
17
82
|
- Improved CI workflow with better test coverage
|
18
83
|
|
19
|
-
## [0.1.0] -
|
84
|
+
## [0.1.0] - 2025-06-07
|
20
85
|
|
21
86
|
### Added
|
87
|
+
|
22
88
|
- Initial release of ClassMetrix
|
23
89
|
- Constants extraction from Ruby classes
|
24
90
|
- Class methods extraction and comparison
|
@@ -32,10 +98,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
32
98
|
- RuboCop integration
|
33
99
|
|
34
100
|
### Features
|
101
|
+
|
35
102
|
- 🔍 Multi-Type Extraction: Constants, class methods, and more
|
36
|
-
- 📊 Hash Expansion: Expand hash values into readable sub-rows
|
103
|
+
- 📊 Hash Expansion: Expand hash values into readable sub-rows
|
37
104
|
- 🛡️ Error Handling: Graceful handling of missing methods and constants
|
38
105
|
- 📝 Rich Markdown Reports: Professional reports with configurable components
|
39
106
|
- 📄 CSV Export: Data analysis-friendly CSV output with hash flattening
|
40
107
|
- ⚙️ Highly Configurable: Customize every aspect of the output
|
41
|
-
- 🚀 Simple API: Chainable, intuitive interface
|
108
|
+
- 🚀 Simple API: Chainable, intuitive interface
|
data/README.md
CHANGED
@@ -10,6 +10,7 @@
|
|
10
10
|
- **🔍 Multi-Type Extraction**: Constants, class methods, and more
|
11
11
|
- **📊 Hash Expansion**: Expand hash values into readable sub-rows
|
12
12
|
- **🛡️ Error Handling**: Graceful handling of missing methods and constants
|
13
|
+
- **🐛 Debug Mode**: Detailed logging for troubleshooting and analysis
|
13
14
|
- **📝 Rich Markdown Reports**: Professional reports with configurable components
|
14
15
|
- **📄 CSV Export**: Data analysis-friendly CSV output with hash flattening
|
15
16
|
- **⚙️ Highly Configurable**: Customize every aspect of the output
|
@@ -157,6 +158,43 @@ ClassMetrix.extract(:class_methods)
|
|
157
158
|
.to_markdown
|
158
159
|
```
|
159
160
|
|
161
|
+
#### Debug Mode
|
162
|
+
```ruby
|
163
|
+
# Enable detailed logging for troubleshooting
|
164
|
+
ClassMetrix.extract(:constants, :class_methods)
|
165
|
+
.from([ServiceA, ServiceB])
|
166
|
+
.expand_hashes
|
167
|
+
.debug # Enable debug mode (basic level)
|
168
|
+
.to_markdown("debug_report.md")
|
169
|
+
|
170
|
+
# Different debug levels for different needs
|
171
|
+
ClassMetrix.extract(:constants)
|
172
|
+
.from([ServiceA, ServiceB])
|
173
|
+
.debug(:basic) # Key decisions and summaries only
|
174
|
+
.to_markdown
|
175
|
+
|
176
|
+
ClassMetrix.extract(:constants)
|
177
|
+
.from([ServiceA, ServiceB])
|
178
|
+
.debug(:detailed) # More context and intermediate steps
|
179
|
+
.to_markdown
|
180
|
+
|
181
|
+
ClassMetrix.extract(:constants)
|
182
|
+
.from([ServiceA, ServiceB])
|
183
|
+
.debug(:verbose) # Full details including individual value processing
|
184
|
+
.to_markdown
|
185
|
+
```
|
186
|
+
|
187
|
+
**Debug Levels:**
|
188
|
+
- **`:basic`** (default) - Key decisions and summaries only
|
189
|
+
- **`:detailed`** - More context and intermediate steps
|
190
|
+
- **`:verbose`** - Full details including individual value processing
|
191
|
+
|
192
|
+
**Debug Features:**
|
193
|
+
- **Safe Object Inspection**: Handles objects with problematic `inspect`/`to_s` methods
|
194
|
+
- **Hash Detection Analysis**: Shows why objects are/aren't treated as expandable hashes
|
195
|
+
- **Smart Logging**: Reduces spam by grouping related operations and focusing on key decisions
|
196
|
+
- **Error Diagnostics**: Detailed error context for troubleshooting
|
197
|
+
|
160
198
|
#### CSV Output
|
161
199
|
```ruby
|
162
200
|
# Basic CSV output
|
@@ -264,7 +302,7 @@ ClassMetrix.extract(:constants)
|
|
264
302
|
---
|
265
303
|
## Report Information
|
266
304
|
|
267
|
-
- **Generated by**: [ClassMetrix gem](https://github.com/
|
305
|
+
- **Generated by**: [ClassMetrix gem](https://github.com/patrick204nqh/class-metrix)
|
268
306
|
- **Generated at**: 2024-01-15 14:30:25 UTC
|
269
307
|
- **Ruby version**: 3.2.0
|
270
308
|
```
|
@@ -374,7 +412,7 @@ Each component is independently configurable and can be customized for specific
|
|
374
412
|
|
375
413
|
```bash
|
376
414
|
# Clone the repository
|
377
|
-
git clone https://github.com/
|
415
|
+
git clone https://github.com/patrick204nqh/class-metrix.git
|
378
416
|
cd class-metrix
|
379
417
|
|
380
418
|
# Install dependencies
|
@@ -407,11 +445,7 @@ This gem is available as open source under the terms of the [MIT License](LICENS
|
|
407
445
|
|
408
446
|
## 🔗 Links
|
409
447
|
|
410
|
-
- [Documentation](https://github.com/
|
448
|
+
- [Documentation](https://github.com/patrick204nqh/class-metrix/wiki)
|
411
449
|
- [Examples](examples/)
|
412
450
|
- [Build Guide](BUILD_GUIDE.md)
|
413
451
|
- [Changelog](CHANGELOG.md)
|
414
|
-
|
415
|
-
---
|
416
|
-
|
417
|
-
**Built with ❤️ for Ruby developers who love clean, maintainable code.**
|