universal_document_processor 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 +7 -0
- data/AI_USAGE_GUIDE.md +404 -0
- data/CHANGELOG.md +67 -0
- data/GEM_RELEASE_GUIDE.md +288 -0
- data/Gemfile +27 -0
- data/LICENSE +21 -0
- data/README.md +726 -0
- data/Rakefile +36 -0
- data/lib/universal_document_processor/ai_agent.rb +491 -0
- data/lib/universal_document_processor/document.rb +225 -0
- data/lib/universal_document_processor/processors/archive_processor.rb +290 -0
- data/lib/universal_document_processor/processors/base_processor.rb +58 -0
- data/lib/universal_document_processor/processors/character_validator.rb +283 -0
- data/lib/universal_document_processor/processors/excel_processor.rb +219 -0
- data/lib/universal_document_processor/processors/image_processor.rb +172 -0
- data/lib/universal_document_processor/processors/pdf_processor.rb +105 -0
- data/lib/universal_document_processor/processors/powerpoint_processor.rb +214 -0
- data/lib/universal_document_processor/processors/text_processor.rb +360 -0
- data/lib/universal_document_processor/processors/word_processor.rb +137 -0
- data/lib/universal_document_processor/utils/file_detector.rb +83 -0
- data/lib/universal_document_processor/utils/japanese_filename_handler.rb +205 -0
- data/lib/universal_document_processor/version.rb +3 -0
- data/lib/universal_document_processor.rb +223 -0
- metadata +198 -0
@@ -0,0 +1,288 @@
|
|
1
|
+
# 🚀 Universal Document Processor - Gem Release Guide
|
2
|
+
|
3
|
+
## Overview
|
4
|
+
|
5
|
+
This guide will walk you through the complete process of releasing your Universal Document Processor gem through GitHub and publishing it to RubyGems.
|
6
|
+
|
7
|
+
## 📋 Prerequisites
|
8
|
+
|
9
|
+
1. **GitHub Account**: Make sure you have a GitHub account
|
10
|
+
2. **RubyGems Account**: Create an account at [rubygems.org](https://rubygems.org)
|
11
|
+
3. **Git**: Ensure Git is installed and configured
|
12
|
+
4. **Ruby**: Ruby 2.7+ installed
|
13
|
+
5. **Bundler**: Latest version of Bundler
|
14
|
+
|
15
|
+
## 🛠️ Step-by-Step Release Process
|
16
|
+
|
17
|
+
### Step 1: Prepare Your Local Repository
|
18
|
+
|
19
|
+
```bash
|
20
|
+
# Navigate to your gem directory
|
21
|
+
cd universal_document_processor
|
22
|
+
|
23
|
+
# Check current status
|
24
|
+
git status
|
25
|
+
|
26
|
+
# Add all files to git
|
27
|
+
git add .
|
28
|
+
|
29
|
+
# Commit your changes
|
30
|
+
git commit -m "Initial gem setup with AI features"
|
31
|
+
|
32
|
+
# Check your remote origin (should point to GitHub)
|
33
|
+
git remote -v
|
34
|
+
```
|
35
|
+
|
36
|
+
### Step 2: Create GitHub Repository
|
37
|
+
|
38
|
+
1. **Go to GitHub**: Visit [github.com](https://github.com)
|
39
|
+
2. **Create New Repository**:
|
40
|
+
- Repository name: `universal_document_processor`
|
41
|
+
- Description: "Universal document processor with AI capabilities for all file formats"
|
42
|
+
- Make it **Public** (required for gem publishing)
|
43
|
+
- Don't initialize with README (you already have one)
|
44
|
+
|
45
|
+
3. **Add GitHub as remote origin**:
|
46
|
+
```bash
|
47
|
+
# Replace YOUR_USERNAME with your actual GitHub username
|
48
|
+
git remote add origin https://github.com/YOUR_USERNAME/universal_document_processor.git
|
49
|
+
|
50
|
+
# Or if you already have origin set, update it:
|
51
|
+
git remote set-url origin https://github.com/YOUR_USERNAME/universal_document_processor.git
|
52
|
+
```
|
53
|
+
|
54
|
+
### Step 3: Push to GitHub
|
55
|
+
|
56
|
+
```bash
|
57
|
+
# Push to GitHub
|
58
|
+
git branch -M main
|
59
|
+
git push -u origin main
|
60
|
+
```
|
61
|
+
|
62
|
+
### Step 4: Set Up RubyGems Account
|
63
|
+
|
64
|
+
1. **Create RubyGems Account**: Visit [rubygems.org](https://rubygems.org) and sign up
|
65
|
+
2. **Get API Key**:
|
66
|
+
- Go to your profile → "Edit Profile" → "API Keys"
|
67
|
+
- Create a new API key with appropriate permissions
|
68
|
+
3. **Configure local gem credentials**:
|
69
|
+
```bash
|
70
|
+
# This will prompt for your RubyGems.org credentials
|
71
|
+
gem push --help
|
72
|
+
```
|
73
|
+
|
74
|
+
### Step 5: Build and Test Your Gem Locally
|
75
|
+
|
76
|
+
```bash
|
77
|
+
# Install dependencies
|
78
|
+
bundle install
|
79
|
+
|
80
|
+
# Build the gem
|
81
|
+
gem build universal_document_processor.gemspec
|
82
|
+
|
83
|
+
# Test installation locally
|
84
|
+
gem install ./universal_document_processor-1.0.0.gem
|
85
|
+
|
86
|
+
# Test that it works
|
87
|
+
ruby -e "require 'universal_document_processor'; puts 'Gem loaded successfully!'"
|
88
|
+
```
|
89
|
+
|
90
|
+
### Step 6: Publish to RubyGems
|
91
|
+
|
92
|
+
```bash
|
93
|
+
# Push the gem to RubyGems
|
94
|
+
gem push universal_document_processor-1.0.0.gem
|
95
|
+
```
|
96
|
+
|
97
|
+
If successful, you'll see:
|
98
|
+
```
|
99
|
+
Pushing gem to https://rubygems.org...
|
100
|
+
Successfully registered gem: universal_document_processor (1.0.0)
|
101
|
+
```
|
102
|
+
|
103
|
+
### Step 7: Create GitHub Release
|
104
|
+
|
105
|
+
1. **Go to your GitHub repository**
|
106
|
+
2. **Click "Releases"** → **"Create a new release"**
|
107
|
+
3. **Fill in the details**:
|
108
|
+
- **Tag version**: `v1.0.0`
|
109
|
+
- **Release title**: `Universal Document Processor v1.0.0`
|
110
|
+
- **Description**: Copy from your CHANGELOG.md
|
111
|
+
4. **Publish release**
|
112
|
+
|
113
|
+
### Step 8: Update Repository Links
|
114
|
+
|
115
|
+
Update your gemspec file with the correct GitHub URLs:
|
116
|
+
|
117
|
+
```ruby
|
118
|
+
# In universal_document_processor.gemspec
|
119
|
+
spec.homepage = "https://github.com/YOUR_USERNAME/universal_document_processor"
|
120
|
+
spec.metadata = {
|
121
|
+
"homepage_uri" => "https://github.com/YOUR_USERNAME/universal_document_processor",
|
122
|
+
"source_code_uri" => "https://github.com/YOUR_USERNAME/universal_document_processor",
|
123
|
+
"bug_tracker_uri" => "https://github.com/YOUR_USERNAME/universal_document_processor/issues",
|
124
|
+
# ... other metadata
|
125
|
+
}
|
126
|
+
```
|
127
|
+
|
128
|
+
## 🔄 Future Updates and Versioning
|
129
|
+
|
130
|
+
### Semantic Versioning
|
131
|
+
|
132
|
+
Follow [Semantic Versioning](https://semver.org/):
|
133
|
+
- **MAJOR** (1.0.0 → 2.0.0): Breaking changes
|
134
|
+
- **MINOR** (1.0.0 → 1.1.0): New features, backward compatible
|
135
|
+
- **PATCH** (1.0.0 → 1.0.1): Bug fixes, backward compatible
|
136
|
+
|
137
|
+
### Release Process for Updates
|
138
|
+
|
139
|
+
1. **Update version** in `lib/universal_document_processor/version.rb`:
|
140
|
+
```ruby
|
141
|
+
module UniversalDocumentProcessor
|
142
|
+
VERSION = "1.1.0"
|
143
|
+
end
|
144
|
+
```
|
145
|
+
|
146
|
+
2. **Update CHANGELOG.md** with new changes
|
147
|
+
|
148
|
+
3. **Commit and tag**:
|
149
|
+
```bash
|
150
|
+
git add .
|
151
|
+
git commit -m "Release v1.1.0"
|
152
|
+
git tag v1.1.0
|
153
|
+
git push origin main --tags
|
154
|
+
```
|
155
|
+
|
156
|
+
4. **Build and publish**:
|
157
|
+
```bash
|
158
|
+
gem build universal_document_processor.gemspec
|
159
|
+
gem push universal_document_processor-1.1.0.gem
|
160
|
+
```
|
161
|
+
|
162
|
+
5. **Create GitHub Release** for the new version
|
163
|
+
|
164
|
+
## 🛡️ Security Best Practices
|
165
|
+
|
166
|
+
### 1. Enable MFA on RubyGems
|
167
|
+
```bash
|
168
|
+
# Enable two-factor authentication
|
169
|
+
gem owner --add your@email.com --otp 123456
|
170
|
+
```
|
171
|
+
|
172
|
+
### 2. Secure API Keys
|
173
|
+
- Never commit API keys to the repository
|
174
|
+
- Use environment variables for sensitive data
|
175
|
+
- Add `.env` files to `.gitignore`
|
176
|
+
|
177
|
+
### 3. Gem Signing (Optional but Recommended)
|
178
|
+
```bash
|
179
|
+
# Create a self-signed certificate
|
180
|
+
gem cert --build your@email.com
|
181
|
+
|
182
|
+
# Sign your gem
|
183
|
+
gem build universal_document_processor.gemspec --sign
|
184
|
+
```
|
185
|
+
|
186
|
+
## 📊 GitHub Actions for Automated Testing (Optional)
|
187
|
+
|
188
|
+
Create `.github/workflows/ci.yml`:
|
189
|
+
|
190
|
+
```yaml
|
191
|
+
name: CI
|
192
|
+
|
193
|
+
on:
|
194
|
+
push:
|
195
|
+
branches: [ main ]
|
196
|
+
pull_request:
|
197
|
+
branches: [ main ]
|
198
|
+
|
199
|
+
jobs:
|
200
|
+
test:
|
201
|
+
runs-on: ubuntu-latest
|
202
|
+
strategy:
|
203
|
+
matrix:
|
204
|
+
ruby-version: ['2.7', '3.0', '3.1', '3.2']
|
205
|
+
|
206
|
+
steps:
|
207
|
+
- uses: actions/checkout@v3
|
208
|
+
|
209
|
+
- name: Set up Ruby
|
210
|
+
uses: ruby/setup-ruby@v1
|
211
|
+
with:
|
212
|
+
ruby-version: ${{ matrix.ruby-version }}
|
213
|
+
bundler-cache: true
|
214
|
+
|
215
|
+
- name: Run tests
|
216
|
+
run: bundle exec rspec
|
217
|
+
|
218
|
+
- name: Run rubocop
|
219
|
+
run: bundle exec rubocop
|
220
|
+
```
|
221
|
+
|
222
|
+
## 🎯 Post-Release Checklist
|
223
|
+
|
224
|
+
- [ ] Gem is available on [rubygems.org](https://rubygems.org)
|
225
|
+
- [ ] GitHub repository is public and accessible
|
226
|
+
- [ ] README.md is comprehensive and up-to-date
|
227
|
+
- [ ] CHANGELOG.md reflects all changes
|
228
|
+
- [ ] License file is present
|
229
|
+
- [ ] GitHub release is created with proper tags
|
230
|
+
- [ ] Links in gemspec point to correct repositories
|
231
|
+
- [ ] Documentation is clear for users
|
232
|
+
|
233
|
+
## 📈 Promotion and Marketing
|
234
|
+
|
235
|
+
### 1. Announce Your Gem
|
236
|
+
- Write a blog post about your gem
|
237
|
+
- Share on social media (Twitter, LinkedIn)
|
238
|
+
- Post in Ruby communities and forums
|
239
|
+
- Submit to Ruby newsletter curators
|
240
|
+
|
241
|
+
### 2. Documentation
|
242
|
+
- Create detailed documentation using YARD
|
243
|
+
- Add code examples and tutorials
|
244
|
+
- Create video demonstrations
|
245
|
+
|
246
|
+
### 3. Community Engagement
|
247
|
+
- Respond to issues and pull requests promptly
|
248
|
+
- Maintain active development
|
249
|
+
- Gather user feedback and iterate
|
250
|
+
|
251
|
+
## 🆘 Troubleshooting
|
252
|
+
|
253
|
+
### Common Issues
|
254
|
+
|
255
|
+
1. **"Permission denied" when pushing to RubyGems**
|
256
|
+
- Check your API credentials
|
257
|
+
- Ensure you have push permissions
|
258
|
+
- Verify gem name isn't already taken
|
259
|
+
|
260
|
+
2. **Git push rejected**
|
261
|
+
- Pull latest changes: `git pull origin main`
|
262
|
+
- Resolve any conflicts
|
263
|
+
- Try push again
|
264
|
+
|
265
|
+
3. **Gem build fails**
|
266
|
+
- Check gemspec syntax
|
267
|
+
- Ensure all required files are present
|
268
|
+
- Verify Ruby version compatibility
|
269
|
+
|
270
|
+
4. **GitHub repository access issues**
|
271
|
+
- Check repository visibility (should be public)
|
272
|
+
- Verify SSH keys or access tokens
|
273
|
+
- Ensure correct remote URL
|
274
|
+
|
275
|
+
## 📞 Support
|
276
|
+
|
277
|
+
If you encounter issues during the release process:
|
278
|
+
|
279
|
+
1. **Check the logs**: Most tools provide detailed error messages
|
280
|
+
2. **GitHub Documentation**: [GitHub Docs](https://docs.github.com)
|
281
|
+
3. **RubyGems Guides**: [RubyGems.org Guides](https://guides.rubygems.org)
|
282
|
+
4. **Ruby Community**: Stack Overflow, Reddit r/ruby
|
283
|
+
|
284
|
+
---
|
285
|
+
|
286
|
+
**Congratulations! Your gem is now live and available to the Ruby community! 🎉**
|
287
|
+
|
288
|
+
Remember to maintain your gem regularly, respond to user feedback, and keep it updated with new features and bug fixes.
|
data/Gemfile
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in universal_document_processor.gemspec
|
4
|
+
gemspec
|
5
|
+
|
6
|
+
gem "rake", "~> 13.0"
|
7
|
+
|
8
|
+
group :development do
|
9
|
+
gem "rspec", "~> 3.12"
|
10
|
+
gem "rubocop", "~> 1.50"
|
11
|
+
gem "yard", "~> 0.9"
|
12
|
+
gem "bundler", "~> 2.0"
|
13
|
+
end
|
14
|
+
|
15
|
+
group :test do
|
16
|
+
gem "simplecov", "~> 0.22"
|
17
|
+
gem "webmock", "~> 3.18"
|
18
|
+
end
|
19
|
+
|
20
|
+
# Optional dependencies for enhanced functionality
|
21
|
+
# Uncomment these if you want them available during development
|
22
|
+
# gem "pdf-reader", "~> 2.0"
|
23
|
+
# gem "prawn", "~> 2.4"
|
24
|
+
# gem "docx", "~> 0.8"
|
25
|
+
# gem "roo", "~> 2.8"
|
26
|
+
# gem "mini_magick", "~> 4.11"
|
27
|
+
# gem "yomu", "~> 0.2"
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2024 Vikas Patil
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|