Skip to content

Commit 0c6116e

Browse files
committed
feat: Major v2 rewrite with modern Ruby architecture and enhanced features
BREAKING CHANGES: - Complete architectural overhaul from v4.x to v5.0.0 - Replaced entity system with simpler resources pattern - Restructured client layer from client/ to clients/ directory - Removed param builders in favor of integrated client logic - Changed module structure and namespacing New Features: - Zeitwerk autoloading for modern Ruby module management - Smart upload detection with automatic method selection - Enhanced multipart upload with parallel processing support - Progress tracking for all upload operations - Batch upload capabilities with error handling per file - CDN subdomain support for improved performance - Comprehensive examples and integration tests Improvements: - Modern Ruby 3.0+ architecture with frozen string literals - Centralized configuration with environment variable support - Better error handling with ErrorHandler and ThrottleHandler mixins - Thread-safe upload operations with configurable concurrency - Extensive VCR test coverage for API operations - Clean separation between REST and Upload API clients Ruby 3.4+ Compatibility: - Added addressable dependency (missing runtime dependency) - Fixed gemspec require_paths (removed redundant paths) - Added base64, bigdecimal, mutex_m gems for Ruby 3.4+ stdlib changes - CI matrix already includes Ruby 3.4 testing Technical Changes: - 198 files changed (+11,500 additions, -5,000 deletions) - Migrated from mimemagic to mime-types for MIME detection - Replaced parallel/retries with built-in threading - Removed uploadcare-api_struct dependency - Added comprehensive YARD documentation structure
1 parent ca841a7 commit 0c6116e

File tree

199 files changed

+11534
-4993
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

199 files changed

+11534
-4993
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@ Gemfile.lock
1818
.ruby-version
1919
project_files
2020
*.gem
21+
.vscode/
22+
.DS_Store
2123
.claude/

.rubocop.yml

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
AllCops:
22
NewCops: enable
33
TargetRubyVersion: 3.0
4+
SuggestExtensions: false
45

56
Layout/LineLength:
67
Max: 120
@@ -10,24 +11,47 @@ Layout/LineLength:
1011
Lint/IneffectiveAccessModifier:
1112
Enabled: false
1213

13-
Style/HashTransformKeys:
14-
Exclude:
15-
- 'lib/uploadcare/entity/decorator/paginator.rb'
16-
- 'lib/uploadcare/client/conversion/video_conversion_client.rb'
17-
- 'lib/uploadcare/entity/file.rb'
18-
1914
Metrics/BlockLength:
2015
Exclude:
2116
- 'bin/'
2217
- 'spec/**/*'
2318
- 'uploadcare-ruby.gemspec'
2419

20+
Metrics/ClassLength:
21+
Max: 100
22+
Exclude:
23+
- 'lib/uploadcare/clients/upload_client.rb' # Complex upload logic with 9 endpoints
24+
- 'lib/uploadcare/resources/file.rb' # Pre-existing file resource with many methods
25+
- 'lib/uploadcare/uploader.rb' # Uploader module with multiple upload strategies
26+
2527
Metrics/ModuleLength:
28+
Max: 100
2629
Exclude:
2730
- 'spec/**/*'
31+
- 'lib/uploadcare/uploader.rb' # Uploader module with multiple upload strategies
2832

2933
Metrics/MethodLength:
3034
Max: 20
35+
Exclude:
36+
- 'lib/uploadcare/clients/upload_client.rb' # Parallel upload requires coordination logic
37+
- 'lib/uploadcare/uploader.rb' # Parallel upload coordination
38+
39+
Metrics/AbcSize:
40+
Max: 17
41+
Exclude:
42+
- 'lib/uploadcare/clients/upload_client.rb' # Upload methods have multiple parameters and validations
43+
- 'lib/uploadcare/uploader.rb' # Parallel upload coordination
44+
45+
Metrics/CyclomaticComplexity:
46+
Max: 7
47+
Exclude:
48+
- 'lib/uploadcare/clients/upload_client.rb' # Upload logic has multiple conditional paths
49+
- 'lib/uploadcare/uploader.rb' # Parallel upload coordination
50+
51+
Metrics/PerceivedComplexity:
52+
Max: 8
53+
Exclude:
54+
- 'lib/uploadcare/clients/upload_client.rb' # Parallel upload coordination is inherently complex
3155

3256
Style/Documentation:
3357
Enabled: false

Gemfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
source 'https://rubygems.org'
44

5+
# Ruby 3.4+ compatibility - these gems are no longer in stdlib
6+
gem 'base64'
7+
gem 'bigdecimal'
8+
gem 'mutex_m'
9+
510
gem 'byebug'
611
gem 'rake'
712
gem 'rspec'

0 commit comments

Comments
 (0)