reposer 1.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 21e6ac1d1b953194dc4176df7f2dffeb3d1642a6d74297980ff71e9389e88b76
4
+ data.tar.gz: ab6964bc0cda7ad948032fb28bf5c7dd84bf0fbf443f625531a9199940981a16
5
+ SHA512:
6
+ metadata.gz: aba8513ddcf8f13210dd61f0c736c87d68d05d8b067a4a8d01851a0c1ee84453dae1b800e79be30d503e1547fa3cff46b181067faebfeb139e5a66735d063bc7
7
+ data.tar.gz: d4d3eebe27baec85cde71c21f6475e0d8a2fe8cf88237d9e4e502f1653dae91e2ba06d6cf89c60e48a5050632ab74ac30b7d0e28091b9decd5d40ffcb2b8b987
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --require spec_helper
2
+ --format documentation
3
+ --color
data/.rubocop.yml ADDED
@@ -0,0 +1,33 @@
1
+ require:
2
+ - rubocop-performance
3
+ - rubocop-rspec
4
+
5
+ AllCops:
6
+ TargetRubyVersion: 3.0
7
+ NewCops: enable
8
+ Exclude:
9
+ - 'vendor/**/*'
10
+ - 'spec/vcr_cassettes/**/*'
11
+
12
+ Style/Documentation:
13
+ Enabled: false
14
+
15
+ Style/StringLiterals:
16
+ EnforcedStyle: double_quotes
17
+
18
+ Style/StringLiteralsInInterpolation:
19
+ EnforcedStyle: double_quotes
20
+
21
+ Layout/LineLength:
22
+ Max: 120
23
+
24
+ Metrics/BlockLength:
25
+ Exclude:
26
+ - 'spec/**/*'
27
+ - '*.gemspec'
28
+
29
+ Metrics/MethodLength:
30
+ Max: 20
31
+
32
+ Metrics/ClassLength:
33
+ Max: 150
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.4.7
data/CHANGELOG.md ADDED
@@ -0,0 +1,203 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [1.1.0] - 2025-01-20
11
+
12
+ ### Changed - Gem Renamed
13
+ - **Breaking**: Gem renamed from `repose` to `repo-composer` (original name taken on RubyGems)
14
+ - Installation: `gem install repo-composer` (was `gem install repose`)
15
+ - Command: `repo-composer` (was `repose`)
16
+ - All functionality remains identical
17
+
18
+ ### Added - AI Provider Integration 🤖
19
+
20
+ #### Gemini AI Integration
21
+ - **New Provider**: `Repose::AI::GeminiProvider` for Google Gemini AI
22
+ - AI-powered repository descriptions, topics, and README generation
23
+ - Support for multiple models (gemini-1.5-flash default, gemini-1.5-pro)
24
+ - Automatic API key configuration via `GEMINI_API_KEY` environment variable
25
+ - Retry logic with exponential backoff (max 3 retries, 30s timeout)
26
+ - Comprehensive error handling (authentication, rate limiting, timeouts)
27
+ - 56 test cases with full coverage
28
+
29
+ #### Ollama Local AI Integration
30
+ - **New Provider**: `Repose::AI::OllamaProvider` for local AI models
31
+ - Privacy-focused AI generation using locally-hosted models
32
+ - Support for all Ollama models (mistral, llama3, gemma, etc.)
33
+ - Model listing and pulling capabilities
34
+ - Configurable via `OLLAMA_ENDPOINT` and `OLLAMA_MODEL` env vars
35
+ - Connection error handling with setup instructions
36
+ - 56 test cases with full coverage
37
+
38
+ #### Enhanced AIGenerator
39
+ - Auto-detection of available AI providers (Gemini → Ollama → Fallback)
40
+ - Explicit provider selection via `provider:` constructor parameter
41
+ - `use_ai?` method to check if AI provider is active
42
+ - Graceful degradation to template-based generation on errors
43
+ - Comprehensive fallback logic for all generation methods
44
+ - 13 new test cases for provider integration
45
+
46
+ #### Error Handling
47
+ - Extended error hierarchy with AI-specific exceptions
48
+ - `ConfigurationError` for missing/invalid API keys
49
+ - `APIError` for general API failures
50
+ - `AuthenticationError` for invalid credentials
51
+ - `RateLimitError` for API rate limit exceeded
52
+
53
+ #### Documentation & Demos
54
+ - `demo_ai_providers.rb` - Comprehensive demo of all AI features
55
+ - Fallback mode demonstration
56
+ - Gemini integration (when API key available)
57
+ - Ollama integration (when service running)
58
+ - Auto-detection behavior
59
+ - Error handling and graceful degradation
60
+ - Configuration examples
61
+
62
+ ### Changed
63
+ - **AIGenerator API**: Now accepts optional `provider:` parameter
64
+ - `:gemini` - Force Gemini provider
65
+ - `:ollama` - Force Ollama provider
66
+ - `:none`/`false` - Force fallback mode
67
+ - `nil` (default) - Auto-detect best available
68
+
69
+ ### Technical Details
70
+ - **Test Coverage**: 96.63% (373/386 lines)
71
+ - **New Code**: 455 lines (AI providers)
72
+ - **Test Code**: 642 lines (comprehensive suite)
73
+ - **Dependencies**: No new gems (uses Net::HTTP)
74
+ - **Backward Compatible**: All existing tests passing
75
+
76
+ ### Configuration Examples
77
+ ```bash
78
+ # Gemini
79
+ export GEMINI_API_KEY='your-api-key'
80
+
81
+ # Ollama (optional, defaults shown)
82
+ export OLLAMA_ENDPOINT='http://localhost:11434'
83
+ export OLLAMA_MODEL='mistral'
84
+ ```
85
+
86
+ ### Usage Examples
87
+ ```ruby
88
+ # Auto-detect provider
89
+ generator = Repose::AIGenerator.new
90
+
91
+ # Force specific provider
92
+ generator = Repose::AIGenerator.new(provider: :gemini)
93
+ generator = Repose::AIGenerator.new(provider: :ollama)
94
+
95
+ # Generate content
96
+ result = generator.generate({
97
+ name: "my-project",
98
+ language: "Ruby",
99
+ framework: "Rails",
100
+ purpose: "Web application"
101
+ })
102
+ ```
103
+
104
+ ---
105
+
106
+ ## [1.0.0] - 2025-11-07 🎉
107
+
108
+ ### 🎯 Production Release
109
+ First stable production release of Repose - the AI-powered GitHub repository creation tool.
110
+
111
+ ### ✨ Features
112
+ - **🤖 AI-Generated Content**: Automatically generates descriptions, topics, and READMEs using GPT-4 patterns
113
+ - **🎯 Smart Context Awareness**: Understands project purpose from name, language, and framework
114
+ - **🔧 Interactive CLI**: Guided prompts for missing information with intelligent defaults
115
+ - **📝 Professional READMEs**: Creates comprehensive, well-structured documentation
116
+ - **🏷️ Intelligent Topics**: Generates relevant tags and topics automatically based on project context
117
+ - **👁️ Preview Mode**: See generated content before creating repository with `--dry-run`
118
+ - **🔐 Secure Configuration**: Encrypted storage of API keys and tokens with proper file permissions
119
+ - **⚡ Framework Support**: Built-in support for popular frameworks across multiple languages
120
+
121
+ ### 🛠️ Technical Implementation
122
+ - **98.39% Test Coverage**: Comprehensive test suite with unit, integration, and error handling tests
123
+ - **Ruby 3.4.7+ Support**: Modern Ruby compatibility with latest language features
124
+ - **Robust Error Handling**: Graceful error handling with detailed error messages and recovery options
125
+ - **Modular Architecture**: Clean separation of concerns with dedicated classes for each responsibility
126
+ - **GitHub API Integration**: Full integration with GitHub API v4 using Octokit
127
+ - **Interactive UX**: Beautiful CLI interface using TTY toolkit with spinners, prompts, and colors
128
+
129
+ ### 🌍 Language & Framework Support
130
+ - **Ruby**: Rails, Sinatra, Hanami, Roda
131
+ - **JavaScript/TypeScript**: React, Vue, Express, Next.js, Nuxt, Angular
132
+ - **Python**: Django, Flask, FastAPI, Streamlit
133
+ - **Go**: Gin, Echo, Fiber, Chi
134
+ - **Java**: Spring Boot, Quarkus, Micronaut
135
+ - **Rust**: Actix, Axum, Warp, Rocket
136
+ - **Swift**: Vapor, Perfect, Kitura
137
+ - **And more**: Extensible architecture for additional languages
138
+
139
+ ### 🎨 Usage Examples
140
+ ```bash
141
+ # Quick repository creation
142
+ repose create my-awesome-project
143
+
144
+ # With specific options
145
+ repose create web-scraper --language ruby --framework rails --private
146
+
147
+ # Preview before creating
148
+ repose create ai-chatbot --language python --framework fastapi --dry-run
149
+
150
+ # Interactive mode with intelligent prompts
151
+ repose create awesome-api # Repose will guide you through the process
152
+ ```
153
+
154
+ ### 🔧 Configuration
155
+ ```bash
156
+ # One-time setup
157
+ repose configure
158
+
159
+ # Configure programmatically
160
+ repose create my-project --language go --framework gin --topics api,microservice
161
+ ```
162
+
163
+ ### 📦 Installation
164
+ ```bash
165
+ gem install repose
166
+ ```
167
+
168
+ ### 🏗️ Architecture
169
+ - `Repose::CLI`: Thor-based command-line interface with interactive prompts
170
+ - `Repose::AIGenerator`: Intelligent content generation with fallback mechanisms
171
+ - `Repose::GitHubClient`: GitHub API integration with error handling
172
+ - `Repose::Config`: Secure configuration management with validation
173
+ - `Repose::Errors`: Comprehensive error hierarchy for different failure modes
174
+
175
+ ### 🧪 Quality Assurance
176
+ - **123 Test Examples**: Comprehensive test coverage across all components
177
+ - **Unit Tests**: Individual class and method testing
178
+ - **Integration Tests**: End-to-end workflow validation
179
+ - **Error Handling Tests**: Comprehensive error scenario coverage
180
+ - **Mock & Stub Tests**: External API interaction testing
181
+ - **Configuration Tests**: Secure file handling validation
182
+
183
+ ### 📋 Requirements
184
+ - Ruby 3.0.0 or higher
185
+ - GitHub Personal Access Token (for repository creation)
186
+ - OpenAI API Key (for enhanced content generation)
187
+
188
+ ### 🔒 Security
189
+ - Secure API key storage with 600 file permissions
190
+ - Input validation and sanitization
191
+ - Error message sanitization (no sensitive data in logs)
192
+ - Secure YAML configuration handling
193
+
194
+ ---
195
+
196
+ ## [0.1.0] - 2024-11-07
197
+
198
+ ### Added
199
+ - Initial project structure and core functionality
200
+ - Basic CLI interface and GitHub integration
201
+ - AI content generation foundation
202
+ - Configuration system prototype
203
+ - Error handling framework
data/Gemfile ADDED
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gemspec
6
+
7
+ group :development, :test do
8
+ gem "rspec", "~> 3.0"
9
+ gem "rubocop", "~> 1.0"
10
+ gem "rubocop-performance", require: false
11
+ gem "rubocop-rspec", require: false
12
+ gem "pry", "~> 0.14"
13
+ gem "yard", "~> 0.9"
14
+ end
15
+
16
+ group :test do
17
+ gem "webmock", "~> 3.0"
18
+ gem "vcr", "~> 6.0"
19
+ gem "simplecov", "~> 0.22"
20
+ gem "simplecov-lcov", "~> 0.8"
21
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,151 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ repose (1.1.0)
5
+ faraday (~> 2.0)
6
+ octokit (~> 6.0)
7
+ ostruct (~> 0.6)
8
+ pastel (~> 0.8)
9
+ thor (~> 1.0)
10
+ tty-prompt (~> 0.23)
11
+ tty-spinner (~> 0.9)
12
+ yaml (~> 0.3)
13
+
14
+ GEM
15
+ remote: https://rubygems.org/
16
+ specs:
17
+ addressable (2.8.7)
18
+ public_suffix (>= 2.0.2, < 7.0)
19
+ ast (2.4.3)
20
+ base64 (0.3.0)
21
+ bigdecimal (3.3.1)
22
+ coderay (1.1.3)
23
+ crack (1.0.1)
24
+ bigdecimal
25
+ rexml
26
+ diff-lcs (1.6.2)
27
+ docile (1.4.1)
28
+ faraday (2.14.0)
29
+ faraday-net_http (>= 2.0, < 3.5)
30
+ json
31
+ logger
32
+ faraday-net_http (3.4.1)
33
+ net-http (>= 0.5.0)
34
+ hashdiff (1.2.1)
35
+ json (2.16.0)
36
+ language_server-protocol (3.17.0.5)
37
+ lint_roller (1.1.0)
38
+ logger (1.7.0)
39
+ method_source (1.1.0)
40
+ net-http (0.7.0)
41
+ uri
42
+ octokit (6.1.1)
43
+ faraday (>= 1, < 3)
44
+ sawyer (~> 0.9)
45
+ ostruct (0.6.3)
46
+ parallel (1.27.0)
47
+ parser (3.3.10.0)
48
+ ast (~> 2.4.1)
49
+ racc
50
+ pastel (0.8.0)
51
+ tty-color (~> 0.5)
52
+ prism (1.6.0)
53
+ pry (0.15.2)
54
+ coderay (~> 1.1)
55
+ method_source (~> 1.0)
56
+ public_suffix (6.0.2)
57
+ racc (1.8.1)
58
+ rainbow (3.1.1)
59
+ regexp_parser (2.11.3)
60
+ rexml (3.4.4)
61
+ rspec (3.13.2)
62
+ rspec-core (~> 3.13.0)
63
+ rspec-expectations (~> 3.13.0)
64
+ rspec-mocks (~> 3.13.0)
65
+ rspec-core (3.13.6)
66
+ rspec-support (~> 3.13.0)
67
+ rspec-expectations (3.13.5)
68
+ diff-lcs (>= 1.2.0, < 2.0)
69
+ rspec-support (~> 3.13.0)
70
+ rspec-mocks (3.13.7)
71
+ diff-lcs (>= 1.2.0, < 2.0)
72
+ rspec-support (~> 3.13.0)
73
+ rspec-support (3.13.6)
74
+ rubocop (1.81.7)
75
+ json (~> 2.3)
76
+ language_server-protocol (~> 3.17.0.2)
77
+ lint_roller (~> 1.1.0)
78
+ parallel (~> 1.10)
79
+ parser (>= 3.3.0.2)
80
+ rainbow (>= 2.2.2, < 4.0)
81
+ regexp_parser (>= 2.9.3, < 3.0)
82
+ rubocop-ast (>= 1.47.1, < 2.0)
83
+ ruby-progressbar (~> 1.7)
84
+ unicode-display_width (>= 2.4.0, < 4.0)
85
+ rubocop-ast (1.47.1)
86
+ parser (>= 3.3.7.2)
87
+ prism (~> 1.4)
88
+ rubocop-performance (1.26.1)
89
+ lint_roller (~> 1.1)
90
+ rubocop (>= 1.75.0, < 2.0)
91
+ rubocop-ast (>= 1.47.1, < 2.0)
92
+ rubocop-rspec (3.7.0)
93
+ lint_roller (~> 1.1)
94
+ rubocop (~> 1.72, >= 1.72.1)
95
+ ruby-progressbar (1.13.0)
96
+ sawyer (0.9.3)
97
+ addressable (>= 2.3.5)
98
+ faraday (>= 0.17.3, < 3)
99
+ simplecov (0.22.0)
100
+ docile (~> 1.1)
101
+ simplecov-html (~> 0.11)
102
+ simplecov_json_formatter (~> 0.1)
103
+ simplecov-html (0.13.2)
104
+ simplecov-lcov (0.9.0)
105
+ simplecov_json_formatter (0.1.4)
106
+ thor (1.4.0)
107
+ tty-color (0.6.0)
108
+ tty-cursor (0.7.1)
109
+ tty-prompt (0.23.1)
110
+ pastel (~> 0.8)
111
+ tty-reader (~> 0.8)
112
+ tty-reader (0.9.0)
113
+ tty-cursor (~> 0.7)
114
+ tty-screen (~> 0.8)
115
+ wisper (~> 2.0)
116
+ tty-screen (0.8.2)
117
+ tty-spinner (0.9.3)
118
+ tty-cursor (~> 0.7)
119
+ unicode-display_width (3.2.0)
120
+ unicode-emoji (~> 4.1)
121
+ unicode-emoji (4.1.0)
122
+ uri (1.1.1)
123
+ vcr (6.3.1)
124
+ base64
125
+ webmock (3.26.1)
126
+ addressable (>= 2.8.0)
127
+ crack (>= 0.3.2)
128
+ hashdiff (>= 0.4.0, < 2.0.0)
129
+ wisper (2.0.1)
130
+ yaml (0.4.0)
131
+ yard (0.9.37)
132
+
133
+ PLATFORMS
134
+ arm64-darwin-24
135
+ ruby
136
+
137
+ DEPENDENCIES
138
+ pry (~> 0.14)
139
+ repose!
140
+ rspec (~> 3.0)
141
+ rubocop (~> 1.0)
142
+ rubocop-performance
143
+ rubocop-rspec
144
+ simplecov (~> 0.22)
145
+ simplecov-lcov (~> 0.8)
146
+ vcr (~> 6.0)
147
+ webmock (~> 3.0)
148
+ yard (~> 0.9)
149
+
150
+ BUNDLED WITH
151
+ 2.7.2
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Wesley Scholl
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.