propel_rails 0.1.1
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/README.md +255 -0
- data/Rakefile +15 -0
- data/lib/generators/propel/install_generator.rb +235 -0
- data/lib/propel/rails/version.rb +7 -0
- data/lib/propel_rails.rb +85 -0
- data/propel_rails.gemspec +62 -0
- metadata +223 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ceb77f8e5827cfa28561ea50453ebaa21f02454b5a210d5ebbc556994b4fa113
|
4
|
+
data.tar.gz: 0a9b2b19a9e9f7b82c34d0241a190a931d3461b3d2f4f96224b072fca8e2f78f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c309658d212e5bbd2c54c51aad21897011f50aaabfe7fc1b52dcf14937fdfbe90c47e03466648c00b341c8f54dc6a7867041c6f82855591274ce708b5722c9fd
|
7
|
+
data.tar.gz: 044f828e687b18a7aa5d8c1704619683be402dd13e30fed40c13b4f9f4ba4ca7b31b8c3cb447d2a181bd61bd0a57a9c3cd3f5d941750b23225815e9bef6f88cc
|
data/README.md
ADDED
@@ -0,0 +1,255 @@
|
|
1
|
+
# Propel Rails
|
2
|
+
|
3
|
+
A modular Ruby framework meta gem that orchestrates the installation of Propel components for building modern web applications.
|
4
|
+
|
5
|
+
## Overview
|
6
|
+
|
7
|
+
Propel Rails is a meta gem that provides unified installation and configuration for the Propel framework ecosystem. It coordinates the setup of multiple self-extracting Propel gems to create a complete development environment.
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
Add this line to your application's Gemfile:
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
gem 'propel_rails', path: 'propel_rails'
|
15
|
+
```
|
16
|
+
|
17
|
+
And then execute:
|
18
|
+
|
19
|
+
```bash
|
20
|
+
bundle install
|
21
|
+
```
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
Propel Rails provides an orchestrator that manages the installation of individual Propel components. You can install all components together or pick specific ones for your needs.
|
26
|
+
|
27
|
+
### Full Framework Installation
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
# Add all Propel gems to your Gemfile
|
31
|
+
gem 'propel_rails', path: 'propel_rails'
|
32
|
+
gem 'propel_api', path: 'propel_api'
|
33
|
+
gem 'propel_auth', path: 'propel_auth'
|
34
|
+
gem 'propel_facets', path: 'propel_facets'
|
35
|
+
|
36
|
+
bundle install
|
37
|
+
|
38
|
+
# Install all components with orchestration
|
39
|
+
rails generate propel:install
|
40
|
+
```
|
41
|
+
|
42
|
+
### Selective Component Installation
|
43
|
+
|
44
|
+
```bash
|
45
|
+
# Install only API components
|
46
|
+
rails generate propel:install --api-only
|
47
|
+
|
48
|
+
# Install only authentication
|
49
|
+
rails generate propel:install --auth-only
|
50
|
+
|
51
|
+
# Install only facets system
|
52
|
+
rails generate propel:install --facets-only
|
53
|
+
|
54
|
+
# Install API with Graphiti instead of PropelFacets
|
55
|
+
rails generate propel:install --graphiti
|
56
|
+
|
57
|
+
# Custom API configuration
|
58
|
+
rails generate propel:install --api-version=v2 --api-namespace=admin_api
|
59
|
+
```
|
60
|
+
|
61
|
+
### Available Components
|
62
|
+
|
63
|
+
When you install `propel_rails`, it can orchestrate the installation of:
|
64
|
+
|
65
|
+
- **`propel_api`** - Complete API resource generation with dual serialization support
|
66
|
+
- **`propel_auth`** - JWT-based authentication with multi-tenancy
|
67
|
+
- **`propel_facets`** - Flexible JSON representations for models
|
68
|
+
- **`graphiti`** - JSON:API serialization (alternative to PropelFacets)
|
69
|
+
|
70
|
+
### Framework Configuration
|
71
|
+
|
72
|
+
```ruby
|
73
|
+
Propel::Rails.configure do |config|
|
74
|
+
config.environment = 'production' # or 'development', 'test'
|
75
|
+
config.logger = Rails.logger
|
76
|
+
config.root_path = Rails.root
|
77
|
+
end
|
78
|
+
```
|
79
|
+
|
80
|
+
### Environment Detection
|
81
|
+
|
82
|
+
```ruby
|
83
|
+
if Propel::Rails.configuration.development?
|
84
|
+
puts "Running in development mode"
|
85
|
+
end
|
86
|
+
|
87
|
+
if Propel::Rails.configuration.production?
|
88
|
+
puts "Running in production mode"
|
89
|
+
end
|
90
|
+
```
|
91
|
+
|
92
|
+
## Component Details
|
93
|
+
|
94
|
+
### PropelApi Integration
|
95
|
+
Propel Rails orchestrates PropelApi installation with coordinated configuration:
|
96
|
+
|
97
|
+
```bash
|
98
|
+
# Orchestrated installation with shared configuration
|
99
|
+
rails generate propel:install
|
100
|
+
# Automatically configures API with authentication integration
|
101
|
+
```
|
102
|
+
|
103
|
+
### PropelAuth Integration
|
104
|
+
Coordinates JWT authentication setup with API integration:
|
105
|
+
|
106
|
+
```bash
|
107
|
+
# Authentication routes automatically integrate with API versioning
|
108
|
+
rails generate propel:install --api-version=v2
|
109
|
+
# Creates /api/v2/auth/* routes
|
110
|
+
```
|
111
|
+
|
112
|
+
### PropelFacets Integration
|
113
|
+
Configures facets system to work seamlessly with generated APIs:
|
114
|
+
|
115
|
+
```bash
|
116
|
+
# Facets automatically connect to API controllers
|
117
|
+
rails generate propel:install --adapter=propel_facets
|
118
|
+
# API controllers use facet rendering by default
|
119
|
+
```
|
120
|
+
|
121
|
+
## Orchestration Features
|
122
|
+
|
123
|
+
### Coordinated Installation
|
124
|
+
- **Component validation** - Checks for required gems before installation
|
125
|
+
- **Dependency management** - Ensures components are installed in correct order
|
126
|
+
- **Configuration sharing** - Coordinates settings across all components
|
127
|
+
- **Migration management** - Runs database migrations as needed
|
128
|
+
|
129
|
+
### Intelligent Defaults
|
130
|
+
- **API versioning** - Consistent versioning across all components
|
131
|
+
- **Namespace coordination** - Shared namespacing for routes and controllers
|
132
|
+
- **Authentication integration** - Automatic API authentication setup
|
133
|
+
- **Serialization coordination** - Consistent JSON handling across components
|
134
|
+
|
135
|
+
### Error Handling
|
136
|
+
- **Missing gem detection** - Clear error messages for missing dependencies
|
137
|
+
- **Installation validation** - Verifies successful component installation
|
138
|
+
- **Rollback support** - Clean failure handling with helpful messages
|
139
|
+
|
140
|
+
## Auto-Loading (Optional)
|
141
|
+
|
142
|
+
Propel Rails can automatically load available Propel gems:
|
143
|
+
|
144
|
+
```ruby
|
145
|
+
# In your application, Propel Rails will detect and load:
|
146
|
+
require 'propel_rails'
|
147
|
+
|
148
|
+
# Automatically attempts to require:
|
149
|
+
# - propel_auth
|
150
|
+
# - propel_api
|
151
|
+
# - propel_facets
|
152
|
+
|
153
|
+
# Gracefully handles missing gems with development notifications
|
154
|
+
```
|
155
|
+
|
156
|
+
## Development
|
157
|
+
|
158
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests.
|
159
|
+
|
160
|
+
```bash
|
161
|
+
# Test the meta gem
|
162
|
+
cd propel_rails
|
163
|
+
bundle exec rake test
|
164
|
+
|
165
|
+
# Test orchestration functionality
|
166
|
+
bundle exec ruby -Ilib:test test/propel_rails_test.rb
|
167
|
+
```
|
168
|
+
|
169
|
+
## Generated Output Example
|
170
|
+
|
171
|
+
When you run `rails generate propel:install`, Propel Rails coordinates:
|
172
|
+
|
173
|
+
```
|
174
|
+
🚀 Propel Rails Framework Installation
|
175
|
+
======================================================================
|
176
|
+
Setting up your Rails application with Propel components...
|
177
|
+
|
178
|
+
📦 Installing Api component...
|
179
|
+
✅ PropelApi installed successfully
|
180
|
+
|
181
|
+
📦 Installing Auth component...
|
182
|
+
✅ PropelAuth installed successfully
|
183
|
+
|
184
|
+
📦 Installing Facets component...
|
185
|
+
✅ PropelFacets installed successfully
|
186
|
+
|
187
|
+
🗃️ Running database migrations...
|
188
|
+
✅ Database migrations completed
|
189
|
+
|
190
|
+
🎉 Propel Installation Complete!
|
191
|
+
======================================================================
|
192
|
+
|
193
|
+
📋 Next steps:
|
194
|
+
1. Review generated configuration files
|
195
|
+
2. Customize API controllers and routes as needed
|
196
|
+
3. Set up authentication flows
|
197
|
+
4. Test your API endpoints
|
198
|
+
|
199
|
+
🔗 Useful commands:
|
200
|
+
rails generate propel_api:controller ModelName # Generate API controller
|
201
|
+
rails routes # View generated routes
|
202
|
+
rails console # Test models and APIs
|
203
|
+
```
|
204
|
+
|
205
|
+
## Architecture
|
206
|
+
|
207
|
+
Propel Rails serves as the coordination layer for the Propel ecosystem:
|
208
|
+
|
209
|
+
```
|
210
|
+
┌─────────────────┐
|
211
|
+
│ Propel Rails │ ← Meta gem orchestrator
|
212
|
+
└─────────────────┘
|
213
|
+
│
|
214
|
+
┌────┴────┐
|
215
|
+
│ Install │ ← Coordinated installation
|
216
|
+
│ Generator│
|
217
|
+
└────┬────┘
|
218
|
+
│
|
219
|
+
┌────▼────┬──────────┬──────────────┐
|
220
|
+
│PropelApi│PropelAuth│PropelFacets │ ← Individual gems
|
221
|
+
└─────────┴──────────┴──────────────┘
|
222
|
+
│ │ │
|
223
|
+
┌────▼────┬────▼────┬─────▼─────┐
|
224
|
+
│ API │ Auth │ Facets │ ← Extracted runtime
|
225
|
+
│Controllers│ System │ System │
|
226
|
+
└─────────┴─────────┴───────────┘
|
227
|
+
```
|
228
|
+
|
229
|
+
## Version Management
|
230
|
+
|
231
|
+
The meta gem coordinates version compatibility across components:
|
232
|
+
|
233
|
+
```ruby
|
234
|
+
# propel_rails.gemspec includes coordinated dependencies:
|
235
|
+
# spec.add_dependency "propel_auth", "~> #{Propel::Rails::VERSION}"
|
236
|
+
# spec.add_dependency "propel_api", "~> #{Propel::Rails::VERSION}"
|
237
|
+
# spec.add_dependency "propel_facets", "~> #{Propel::Rails::VERSION}"
|
238
|
+
```
|
239
|
+
|
240
|
+
## Self-Extracting Benefits
|
241
|
+
|
242
|
+
While Propel Rails remains as a coordinator, it manages self-extracting components:
|
243
|
+
|
244
|
+
- **No runtime bloat** - Individual components extract and remove themselves
|
245
|
+
- **Coordinated setup** - Single command installs entire framework
|
246
|
+
- **Flexible deployment** - Choose components needed for each project
|
247
|
+
- **Unified configuration** - Shared settings across all components
|
248
|
+
|
249
|
+
## Contributing
|
250
|
+
|
251
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/propel-web/propel_rails.
|
252
|
+
|
253
|
+
## License
|
254
|
+
|
255
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
require "rake/testtask"
|
5
|
+
require "rubocop/rake_task"
|
6
|
+
|
7
|
+
Rake::TestTask.new(:test) do |t|
|
8
|
+
t.libs << "test"
|
9
|
+
t.test_files = FileList["test/**/*_test.rb"]
|
10
|
+
t.verbose = true
|
11
|
+
end
|
12
|
+
|
13
|
+
RuboCop::RakeTask.new
|
14
|
+
|
15
|
+
task default: %i[test rubocop]
|
@@ -0,0 +1,235 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails/generators/base'
|
4
|
+
|
5
|
+
##
|
6
|
+
# Main Propel installer that orchestrates the installation of Propel components
|
7
|
+
#
|
8
|
+
# Usage:
|
9
|
+
# rails generate propel:install # Install all components (API + Auth + Facets)
|
10
|
+
# rails generate propel:install --api-only # Install only API components
|
11
|
+
# rails generate propel:install --auth-only # Install only Auth components
|
12
|
+
# rails generate propel:install --facets-only # Install only Facets components
|
13
|
+
# rails generate propel:install --graphiti # Use Graphiti instead of Facets for API
|
14
|
+
# rails generate propel:install --api-version=v2 # Custom API version
|
15
|
+
#
|
16
|
+
# This generator coordinates the installation of:
|
17
|
+
# - PropelApi (API controllers, routes, configuration)
|
18
|
+
# - PropelAuth (authentication, user management)
|
19
|
+
# - PropelFacets or Graphiti (API serialization/filtering)
|
20
|
+
#
|
21
|
+
module Propel
|
22
|
+
class InstallGenerator < ::Rails::Generators::Base
|
23
|
+
source_root File.expand_path("templates", __dir__)
|
24
|
+
|
25
|
+
desc "Install and configure Propel Rails framework components"
|
26
|
+
|
27
|
+
# Component selection options
|
28
|
+
class_option :api_only,
|
29
|
+
type: :boolean,
|
30
|
+
default: false,
|
31
|
+
desc: "Install only PropelApi components"
|
32
|
+
|
33
|
+
class_option :auth_only,
|
34
|
+
type: :boolean,
|
35
|
+
default: false,
|
36
|
+
desc: "Install only PropelAuth components"
|
37
|
+
|
38
|
+
class_option :facets_only,
|
39
|
+
type: :boolean,
|
40
|
+
default: false,
|
41
|
+
desc: "Install only PropelFacets components"
|
42
|
+
|
43
|
+
class_option :graphiti,
|
44
|
+
type: :boolean,
|
45
|
+
default: false,
|
46
|
+
desc: "Use Graphiti instead of PropelFacets for API serialization"
|
47
|
+
|
48
|
+
# Configuration options
|
49
|
+
class_option :api_version,
|
50
|
+
type: :string,
|
51
|
+
default: "v1",
|
52
|
+
desc: "API version (e.g., v1, v2)"
|
53
|
+
|
54
|
+
class_option :api_namespace,
|
55
|
+
type: :string,
|
56
|
+
default: "api",
|
57
|
+
desc: "API namespace (e.g., api, public_api)"
|
58
|
+
|
59
|
+
class_option :skip_auth,
|
60
|
+
type: :boolean,
|
61
|
+
default: false,
|
62
|
+
desc: "Skip authentication setup"
|
63
|
+
|
64
|
+
class_option :skip_migrations,
|
65
|
+
type: :boolean,
|
66
|
+
default: false,
|
67
|
+
desc: "Skip running database migrations"
|
68
|
+
|
69
|
+
class_option :components,
|
70
|
+
type: :array,
|
71
|
+
desc: "Specific components to install (api, auth, facets)"
|
72
|
+
|
73
|
+
def install_propel_components
|
74
|
+
show_welcome_message
|
75
|
+
|
76
|
+
components = determine_components_to_install
|
77
|
+
validate_component_availability(components)
|
78
|
+
|
79
|
+
say "Installing Propel components: #{components.join(', ')}", :green
|
80
|
+
|
81
|
+
install_components(components)
|
82
|
+
run_migrations unless options[:skip_migrations]
|
83
|
+
show_completion_message
|
84
|
+
end
|
85
|
+
|
86
|
+
private
|
87
|
+
|
88
|
+
def show_welcome_message
|
89
|
+
say "\n" + "="*70, :green
|
90
|
+
say "🚀 Propel Rails Framework Installation", :green
|
91
|
+
say "="*70, :green
|
92
|
+
say "Setting up your Rails application with Propel components...", :cyan
|
93
|
+
end
|
94
|
+
|
95
|
+
def determine_components_to_install
|
96
|
+
# Handle --components option first
|
97
|
+
if options[:components]
|
98
|
+
components = options[:components].map(&:to_sym)
|
99
|
+
# Convert component names to internal format
|
100
|
+
components.map! { |c| c == :facets ? (options[:graphiti] ? :graphiti : :facets) : c }
|
101
|
+
return components
|
102
|
+
end
|
103
|
+
|
104
|
+
if options[:api_only]
|
105
|
+
return [:api]
|
106
|
+
elsif options[:auth_only]
|
107
|
+
return [:auth]
|
108
|
+
elsif options[:facets_only]
|
109
|
+
return [:facets]
|
110
|
+
else
|
111
|
+
# Default: install all components
|
112
|
+
components = [:api, :auth]
|
113
|
+
components << (options[:graphiti] ? :graphiti : :facets)
|
114
|
+
return components
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
def validate_component_availability(components)
|
119
|
+
missing_gems = []
|
120
|
+
|
121
|
+
missing_gems << "propel_api" if components.include?(:api) && !gem_available?("propel_api")
|
122
|
+
missing_gems << "propel_auth" if components.include?(:auth) && !gem_available?("propel_auth")
|
123
|
+
missing_gems << "propel_facets" if components.include?(:facets) && !gem_available?("propel_facets")
|
124
|
+
missing_gems << "graphiti" if components.include?(:graphiti) && !gem_available?("graphiti")
|
125
|
+
|
126
|
+
if missing_gems.any?
|
127
|
+
say "\n❌ Missing required gems:", :red
|
128
|
+
missing_gems.each { |gem| say " - #{gem}", :red }
|
129
|
+
say "\nAdd these gems to your Gemfile and run 'bundle install'", :red
|
130
|
+
exit(1)
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
def install_components(components)
|
135
|
+
components.each do |component|
|
136
|
+
say "\n📦 Installing #{component.to_s.capitalize} component...", :blue
|
137
|
+
|
138
|
+
case component
|
139
|
+
when :api
|
140
|
+
install_propel_api
|
141
|
+
when :auth
|
142
|
+
install_propel_auth
|
143
|
+
when :facets
|
144
|
+
install_propel_facets
|
145
|
+
when :graphiti
|
146
|
+
install_graphiti_support
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
def install_propel_api
|
152
|
+
begin
|
153
|
+
generate "propel_api:install",
|
154
|
+
"--api-version=#{options[:api_version]}",
|
155
|
+
"--api-namespace=#{options[:api_namespace]}"
|
156
|
+
say " ✅ PropelApi installed successfully", :green
|
157
|
+
rescue => e
|
158
|
+
say " ❌ PropelApi installation failed: #{e.message}", :red
|
159
|
+
raise
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
def install_propel_auth
|
164
|
+
begin
|
165
|
+
auth_options = []
|
166
|
+
auth_options << "--skip-migrations" if options[:skip_migrations]
|
167
|
+
|
168
|
+
generate "propel_auth:install", *auth_options
|
169
|
+
say " ✅ PropelAuth installed successfully", :green
|
170
|
+
rescue => e
|
171
|
+
say " ❌ PropelAuth installation failed: #{e.message}", :red
|
172
|
+
raise
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
def install_propel_facets
|
177
|
+
begin
|
178
|
+
generate "propel_facets:install"
|
179
|
+
say " ✅ PropelFacets installed successfully", :green
|
180
|
+
rescue => e
|
181
|
+
say " ❌ PropelFacets installation failed: #{e.message}", :red
|
182
|
+
raise
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
def install_graphiti_support
|
187
|
+
# Note: This would integrate with Graphiti gem if available
|
188
|
+
# For now, we'll just configure basic Graphiti support
|
189
|
+
say " ⚠️ Graphiti integration not yet implemented", :yellow
|
190
|
+
say " Please configure Graphiti manually", :yellow
|
191
|
+
end
|
192
|
+
|
193
|
+
def run_migrations
|
194
|
+
unless options[:skip_migrations]
|
195
|
+
say "\n🗃️ Running database migrations...", :blue
|
196
|
+
begin
|
197
|
+
rails_command "db:migrate"
|
198
|
+
say " ✅ Database migrations completed", :green
|
199
|
+
rescue => e
|
200
|
+
say " ⚠️ Migration failed: #{e.message}", :yellow
|
201
|
+
say " Run 'rails db:migrate' manually if needed", :yellow
|
202
|
+
end
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
def show_completion_message
|
207
|
+
say "\n" + "="*70, :green
|
208
|
+
say "🎉 Propel Installation Complete!", :green
|
209
|
+
say "="*70, :green
|
210
|
+
|
211
|
+
say "\n📋 Next steps:", :cyan
|
212
|
+
say " 1. Review generated configuration files", :white
|
213
|
+
say " 2. Customize API controllers and routes as needed", :white
|
214
|
+
say " 3. Set up authentication flows", :white
|
215
|
+
say " 4. Test your API endpoints", :white
|
216
|
+
|
217
|
+
say "\n🔗 Useful commands:", :cyan
|
218
|
+
say " rails generate propel_api:controller ModelName # Generate API controller", :white
|
219
|
+
say " rails routes # View generated routes", :white
|
220
|
+
say " rails console # Test models and APIs", :white
|
221
|
+
|
222
|
+
say "\n📖 Documentation: https://github.com/propel-web/propel_rails", :cyan
|
223
|
+
say "\n"
|
224
|
+
end
|
225
|
+
|
226
|
+
def gem_available?(gem_name)
|
227
|
+
begin
|
228
|
+
Gem::Specification.find_by_name(gem_name)
|
229
|
+
true
|
230
|
+
rescue Gem::LoadError
|
231
|
+
false
|
232
|
+
end
|
233
|
+
end
|
234
|
+
end
|
235
|
+
end
|
data/lib/propel_rails.rb
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "propel/rails/version"
|
4
|
+
require "pathname"
|
5
|
+
|
6
|
+
module Propel
|
7
|
+
module Rails
|
8
|
+
class Error < StandardError; end
|
9
|
+
|
10
|
+
# Framework configuration
|
11
|
+
class Configuration
|
12
|
+
attr_accessor :environment, :logger, :root_path
|
13
|
+
|
14
|
+
def initialize
|
15
|
+
@environment = ENV.fetch("RAILS_ENV", "development")
|
16
|
+
@logger = nil
|
17
|
+
@root_path = nil
|
18
|
+
end
|
19
|
+
|
20
|
+
def development?
|
21
|
+
@environment == "development"
|
22
|
+
end
|
23
|
+
|
24
|
+
def production?
|
25
|
+
@environment == "production"
|
26
|
+
end
|
27
|
+
|
28
|
+
def test?
|
29
|
+
@environment == "test"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
class << self
|
34
|
+
attr_writer :configuration
|
35
|
+
|
36
|
+
def configuration
|
37
|
+
@configuration ||= Configuration.new
|
38
|
+
end
|
39
|
+
|
40
|
+
def configure
|
41
|
+
yield(configuration)
|
42
|
+
end
|
43
|
+
|
44
|
+
def version
|
45
|
+
VERSION
|
46
|
+
end
|
47
|
+
|
48
|
+
def root
|
49
|
+
@root ||= Pathname.new(File.expand_path("../..", __dir__))
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
# Auto-load propel gems if they're available
|
56
|
+
# This allows the framework to work with individual gems
|
57
|
+
# without requiring all of them to be installed
|
58
|
+
# propel-access
|
59
|
+
# propel-ai
|
60
|
+
# propel-forms
|
61
|
+
# propel-calendar
|
62
|
+
# propel-payroll
|
63
|
+
# propel-billing
|
64
|
+
# propel-accounting
|
65
|
+
|
66
|
+
|
67
|
+
gems_to_load = %w[
|
68
|
+
propel_auth
|
69
|
+
propel_api
|
70
|
+
propel_facets
|
71
|
+
]
|
72
|
+
|
73
|
+
gems_to_load.each do |gem_name|
|
74
|
+
begin
|
75
|
+
require gem_name
|
76
|
+
rescue LoadError
|
77
|
+
# Gem not available, skip it
|
78
|
+
puts "#{gem_name} not available" if Propel::Rails.configuration.development?
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
# Welcome message for development
|
83
|
+
if Propel::Rails.configuration.development?
|
84
|
+
puts "Propel Rails v#{Propel::Rails::VERSION} loaded"
|
85
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/propel/rails/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "propel_rails"
|
7
|
+
spec.version = Propel::Rails::VERSION
|
8
|
+
spec.authors = ["Propel Team"]
|
9
|
+
spec.email = ["admin@propel-hq.dev"]
|
10
|
+
|
11
|
+
spec.summary = "A modular Ruby framework for building modern web applications"
|
12
|
+
spec.description = <<~DESC
|
13
|
+
Propel Rails is a modular Ruby framework built as a collection of independent gems
|
14
|
+
that work together seamlessly. It provides authentication, API generation, access control,
|
15
|
+
AI integration, and more - all designed to work individually or as a cohesive framework.
|
16
|
+
DESC
|
17
|
+
spec.homepage = "https://github.com/propel-hq/propel_rails.git"
|
18
|
+
spec.license = "MIT"
|
19
|
+
spec.required_ruby_version = ">= 3.2.0"
|
20
|
+
|
21
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
22
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
23
|
+
spec.metadata["source_code_uri"] = "https://github.com/propel-hq/propel_rails.git"
|
24
|
+
# spec.metadata["changelog_uri"] = "https://github.com/propel/propel_rails/blob/main/CHANGELOG.md"
|
25
|
+
# spec.metadata["documentation_uri"] = "https://docs.propel.com"
|
26
|
+
# spec.metadata["bug_tracker_uri"] = "https://github.com/propel/propel_rails/issues"
|
27
|
+
|
28
|
+
# Specify which files should be added to the gem when it is released.
|
29
|
+
spec.files = Dir.chdir(__dir__) do
|
30
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
31
|
+
(File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ test/ spec/ features/ .git .github appveyor Gemfile])
|
32
|
+
end
|
33
|
+
end
|
34
|
+
spec.bindir = "exe"
|
35
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
36
|
+
spec.require_paths = ["lib"]
|
37
|
+
|
38
|
+
# Runtime dependencies - these are the core gems that make up the framework
|
39
|
+
spec.add_dependency "propel_authentication", "~> #{Propel::Rails::VERSION}"
|
40
|
+
spec.add_dependency "propel_api", "~> #{Propel::Rails::VERSION}"
|
41
|
+
spec.add_dependency "propel_facets", "~> #{Propel::Rails::VERSION}"
|
42
|
+
# spec.add_dependency "propel_access", "~> #{Propel::Rails::VERSION}"
|
43
|
+
# spec.add_dependency "propel_ai", "~> #{Propel::Rails::VERSION}"
|
44
|
+
# spec.add_dependency "propel_billing", "~> #{Propel::Rails::VERSION}"
|
45
|
+
# spec.add_dependency "propel_invoicing", "~> #{Propel::Rails::VERSION}"
|
46
|
+
# spec.add_dependency "propel_accounting", "~> #{Propel::Rails::VERSION}"
|
47
|
+
# spec.add_dependency "propel_forms", "~> #{Propel::Rails::VERSION}"
|
48
|
+
|
49
|
+
# Development dependencies
|
50
|
+
spec.add_development_dependency "bundler", "~> 2.4"
|
51
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
52
|
+
spec.add_development_dependency "minitest", "~> 5.18"
|
53
|
+
spec.add_development_dependency "minitest-reporters", "~> 1.6"
|
54
|
+
spec.add_development_dependency "rubocop", "~> 1.50"
|
55
|
+
spec.add_development_dependency "rubocop-minitest", "~> 0.31"
|
56
|
+
spec.add_development_dependency "simplecov", "~> 0.22"
|
57
|
+
spec.add_development_dependency "pry", "~> 0.14"
|
58
|
+
spec.add_development_dependency "pry-byebug", "~> 3.10"
|
59
|
+
|
60
|
+
# For now, we'll keep it simple and not add the individual gem dependencies
|
61
|
+
# until they are properly structured and published
|
62
|
+
end
|
metadata
ADDED
@@ -0,0 +1,223 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: propel_rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Propel Team
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2025-07-11 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: propel_authentication
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.1.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.1.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: propel_api
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.1.1
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.1.1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: propel_facets
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.1.1
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.1.1
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.4'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.4'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '13.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '13.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: minitest
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '5.18'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '5.18'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: minitest-reporters
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.6'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.6'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rubocop
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '1.50'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '1.50'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rubocop-minitest
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0.31'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0.31'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: simplecov
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0.22'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0.22'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: pry
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0.14'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0.14'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: pry-byebug
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '3.10'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '3.10'
|
181
|
+
description: |
|
182
|
+
Propel Rails is a modular Ruby framework built as a collection of independent gems
|
183
|
+
that work together seamlessly. It provides authentication, API generation, access control,
|
184
|
+
AI integration, and more - all designed to work individually or as a cohesive framework.
|
185
|
+
email:
|
186
|
+
- admin@propel-hq.dev
|
187
|
+
executables: []
|
188
|
+
extensions: []
|
189
|
+
extra_rdoc_files: []
|
190
|
+
files:
|
191
|
+
- README.md
|
192
|
+
- Rakefile
|
193
|
+
- lib/generators/propel/install_generator.rb
|
194
|
+
- lib/propel/rails/version.rb
|
195
|
+
- lib/propel_rails.rb
|
196
|
+
- propel_rails.gemspec
|
197
|
+
homepage: https://github.com/propel-hq/propel_rails.git
|
198
|
+
licenses:
|
199
|
+
- MIT
|
200
|
+
metadata:
|
201
|
+
allowed_push_host: https://rubygems.org
|
202
|
+
homepage_uri: https://github.com/propel-hq/propel_rails.git
|
203
|
+
source_code_uri: https://github.com/propel-hq/propel_rails.git
|
204
|
+
post_install_message:
|
205
|
+
rdoc_options: []
|
206
|
+
require_paths:
|
207
|
+
- lib
|
208
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
209
|
+
requirements:
|
210
|
+
- - ">="
|
211
|
+
- !ruby/object:Gem::Version
|
212
|
+
version: 3.2.0
|
213
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
214
|
+
requirements:
|
215
|
+
- - ">="
|
216
|
+
- !ruby/object:Gem::Version
|
217
|
+
version: '0'
|
218
|
+
requirements: []
|
219
|
+
rubygems_version: 3.4.19
|
220
|
+
signing_key:
|
221
|
+
specification_version: 4
|
222
|
+
summary: A modular Ruby framework for building modern web applications
|
223
|
+
test_files: []
|