Skip to content

Commit 83835db

Browse files
committed
Generate Rails engine and fill the basics
0 parents  commit 83835db

Some content is hidden

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

69 files changed

+1033
-0
lines changed

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/.bundle/
2+
/doc/
3+
/log/*.log
4+
/pkg/
5+
/tmp/
6+
/test/dummy/db/*.sqlite3
7+
/test/dummy/db/*.sqlite3-*
8+
/test/dummy/log/*.log
9+
/test/dummy/tmp/

Gemfile

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
source "https://rubygems.org"
2+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3+
4+
# Specify your gem's dependencies in active_job-database_queue.gemspec.
5+
gemspec
6+
7+
gem "sqlite3"
8+
9+
# Start debugger with binding.b [https://github.com/ruby/debug]
10+
# gem "debug", ">= 1.0.0"

Gemfile.lock

+159
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
PATH
2+
remote: .
3+
specs:
4+
active_job-database_queue (0.1.0)
5+
rails (>= 7.0.3.1)
6+
7+
GEM
8+
remote: https://rubygems.org/
9+
specs:
10+
actioncable (7.0.4)
11+
actionpack (= 7.0.4)
12+
activesupport (= 7.0.4)
13+
nio4r (~> 2.0)
14+
websocket-driver (>= 0.6.1)
15+
actionmailbox (7.0.4)
16+
actionpack (= 7.0.4)
17+
activejob (= 7.0.4)
18+
activerecord (= 7.0.4)
19+
activestorage (= 7.0.4)
20+
activesupport (= 7.0.4)
21+
mail (>= 2.7.1)
22+
net-imap
23+
net-pop
24+
net-smtp
25+
actionmailer (7.0.4)
26+
actionpack (= 7.0.4)
27+
actionview (= 7.0.4)
28+
activejob (= 7.0.4)
29+
activesupport (= 7.0.4)
30+
mail (~> 2.5, >= 2.5.4)
31+
net-imap
32+
net-pop
33+
net-smtp
34+
rails-dom-testing (~> 2.0)
35+
actionpack (7.0.4)
36+
actionview (= 7.0.4)
37+
activesupport (= 7.0.4)
38+
rack (~> 2.0, >= 2.2.0)
39+
rack-test (>= 0.6.3)
40+
rails-dom-testing (~> 2.0)
41+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
42+
actiontext (7.0.4)
43+
actionpack (= 7.0.4)
44+
activerecord (= 7.0.4)
45+
activestorage (= 7.0.4)
46+
activesupport (= 7.0.4)
47+
globalid (>= 0.6.0)
48+
nokogiri (>= 1.8.5)
49+
actionview (7.0.4)
50+
activesupport (= 7.0.4)
51+
builder (~> 3.1)
52+
erubi (~> 1.4)
53+
rails-dom-testing (~> 2.0)
54+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
55+
activejob (7.0.4)
56+
activesupport (= 7.0.4)
57+
globalid (>= 0.3.6)
58+
activemodel (7.0.4)
59+
activesupport (= 7.0.4)
60+
activerecord (7.0.4)
61+
activemodel (= 7.0.4)
62+
activesupport (= 7.0.4)
63+
activestorage (7.0.4)
64+
actionpack (= 7.0.4)
65+
activejob (= 7.0.4)
66+
activerecord (= 7.0.4)
67+
activesupport (= 7.0.4)
68+
marcel (~> 1.0)
69+
mini_mime (>= 1.1.0)
70+
activesupport (7.0.4)
71+
concurrent-ruby (~> 1.0, >= 1.0.2)
72+
i18n (>= 1.6, < 2)
73+
minitest (>= 5.1)
74+
tzinfo (~> 2.0)
75+
builder (3.2.4)
76+
concurrent-ruby (1.1.10)
77+
crass (1.0.6)
78+
date (3.3.3)
79+
erubi (1.12.0)
80+
globalid (1.0.0)
81+
activesupport (>= 5.0)
82+
i18n (1.12.0)
83+
concurrent-ruby (~> 1.0)
84+
loofah (2.19.1)
85+
crass (~> 1.0.2)
86+
nokogiri (>= 1.5.9)
87+
mail (2.8.0.1)
88+
mini_mime (>= 0.1.1)
89+
net-imap
90+
net-pop
91+
net-smtp
92+
marcel (1.0.2)
93+
method_source (1.0.0)
94+
mini_mime (1.1.2)
95+
mini_portile2 (2.8.1)
96+
minitest (5.17.0)
97+
net-imap (0.3.4)
98+
date
99+
net-protocol
100+
net-pop (0.1.2)
101+
net-protocol
102+
net-protocol (0.2.1)
103+
timeout
104+
net-smtp (0.3.3)
105+
net-protocol
106+
nio4r (2.5.8)
107+
nokogiri (1.14.0-arm64-darwin)
108+
racc (~> 1.4)
109+
racc (1.6.2)
110+
rack (2.2.5)
111+
rack-test (2.0.2)
112+
rack (>= 1.3)
113+
rails (7.0.4)
114+
actioncable (= 7.0.4)
115+
actionmailbox (= 7.0.4)
116+
actionmailer (= 7.0.4)
117+
actionpack (= 7.0.4)
118+
actiontext (= 7.0.4)
119+
actionview (= 7.0.4)
120+
activejob (= 7.0.4)
121+
activemodel (= 7.0.4)
122+
activerecord (= 7.0.4)
123+
activestorage (= 7.0.4)
124+
activesupport (= 7.0.4)
125+
bundler (>= 1.15.0)
126+
railties (= 7.0.4)
127+
rails-dom-testing (2.0.3)
128+
activesupport (>= 4.2.0)
129+
nokogiri (>= 1.6)
130+
rails-html-sanitizer (1.4.4)
131+
loofah (~> 2.19, >= 2.19.1)
132+
railties (7.0.4)
133+
actionpack (= 7.0.4)
134+
activesupport (= 7.0.4)
135+
method_source
136+
rake (>= 12.2)
137+
thor (~> 1.0)
138+
zeitwerk (~> 2.5)
139+
rake (13.0.6)
140+
sqlite3 (1.5.4)
141+
mini_portile2 (~> 2.8.0)
142+
thor (1.2.1)
143+
timeout (0.3.1)
144+
tzinfo (2.0.5)
145+
concurrent-ruby (~> 1.0)
146+
websocket-driver (0.7.5)
147+
websocket-extensions (>= 0.1.0)
148+
websocket-extensions (0.1.5)
149+
zeitwerk (2.6.6)
150+
151+
PLATFORMS
152+
arm64-darwin-22
153+
154+
DEPENDENCIES
155+
active_job-database_queue!
156+
sqlite3
157+
158+
BUNDLED WITH
159+
2.4.2

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Basecamp
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.

MIT-LICENSE

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright 2023 Rosa Gutierrez
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# ActiveJob::DatabaseQueue
2+
Short description and motivation.
3+
4+
## Usage
5+
How to use my plugin.
6+
7+
## Installation
8+
Add this line to your application's Gemfile:
9+
10+
```ruby
11+
gem "active_job-database_queue"
12+
```
13+
14+
And then execute:
15+
```bash
16+
$ bundle
17+
```
18+
19+
Or install it yourself as:
20+
```bash
21+
$ gem install active_job-database_queue
22+
```
23+
24+
## Contributing
25+
Contribution directions go here.
26+
27+
## License
28+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

Rakefile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
require "bundler/setup"
2+
3+
APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
4+
load "rails/tasks/engine.rake"
5+
6+
load "rails/tasks/statistics.rake"
7+
8+
require "bundler/gem_tasks"

active_job-database_queue.gemspec

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
require_relative "lib/active_job/database_queue/version"
2+
3+
Gem::Specification.new do |spec|
4+
spec.name = "active_job-database_queue"
5+
spec.version = ActiveJob::DatabaseQueue::VERSION
6+
spec.authors = ["Rosa Gutierrez"]
7+
spec.email = ["[email protected]"]
8+
spec.homepage = "http://github.com/basecamp/active_job-database_queue"
9+
spec.summary = "Database-backed Active Job backend."
10+
spec.description = "Database-backed Active Job backend."
11+
spec.license = "MIT"
12+
13+
spec.metadata["homepage_uri"] = spec.homepage
14+
spec.metadata["source_code_uri"] = "http://github.com/basecamp/active_job-database_queue"
15+
16+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
17+
Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"]
18+
end
19+
20+
spec.add_dependency "rails", ">= 7.0.3.1"
21+
end

app/assets/config/active_job_database_queue_manifest.js

Whitespace-only changes.

app/assets/images/active_job/database_queue/.keep

Whitespace-only changes.

app/assets/stylesheets/active_job/database_queue/.keep

Whitespace-only changes.

app/controllers/.keep

Whitespace-only changes.

app/controllers/concerns/.keep

Whitespace-only changes.

app/helpers/.keep

Whitespace-only changes.

app/jobs/.keep

Whitespace-only changes.

app/models/.keep

Whitespace-only changes.

app/models/concerns/.keep

Whitespace-only changes.

app/views/.keep

Whitespace-only changes.

bin/rails

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env ruby
2+
# This command will automatically be run when you run "rails" with Rails gems
3+
# installed from the root of your application.
4+
5+
ENGINE_ROOT = File.expand_path("..", __dir__)
6+
ENGINE_PATH = File.expand_path("../lib/active_job/database_queue/engine", __dir__)
7+
APP_PATH = File.expand_path("../test/dummy/config/application", __dir__)
8+
9+
# Set up gems listed in the Gemfile.
10+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
11+
require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
12+
13+
require "rails"
14+
# Pick the frameworks you want:
15+
require "active_model/railtie"
16+
require "active_job/railtie"
17+
require "active_record/railtie"
18+
# require "active_storage/engine"
19+
require "action_controller/railtie"
20+
# require "action_mailer/railtie"
21+
require "action_view/railtie"
22+
# require "action_cable/engine"
23+
require "rails/test_unit/railtie"
24+
require "rails/engine/commands"

config/routes.rb

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Rails.application.routes.draw do
2+
end

lib/active_job/database_queue.rb

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
require "active_job/database_queue/version"
2+
require "active_job/database_queue/engine"
3+
4+
module ActiveJob
5+
module DatabaseQueue
6+
# Your code goes here...
7+
end
8+
end
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module ActiveJob
2+
module DatabaseQueue
3+
class Engine < ::Rails::Engine
4+
end
5+
end
6+
end
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module ActiveJob
2+
module DatabaseQueue
3+
VERSION = "0.1.0"
4+
end
5+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# desc "Explaining what the task does"
2+
# task :active_job_database_queue do
3+
# # Task goes here
4+
# end
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require "test_helper"
2+
3+
class ActiveJob::DatabaseQueueTest < ActiveSupport::TestCase
4+
test "it has a version number" do
5+
assert ActiveJob::DatabaseQueue::VERSION
6+
end
7+
end

test/controllers/.keep

Whitespace-only changes.

test/dummy/Rakefile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Add your own tasks in files placed in lib/tasks ending in .rake,
2+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3+
4+
require_relative "config/application"
5+
6+
Rails.application.load_tasks

test/dummy/app/assets/images/.keep

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* Application styles */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class ApplicationController < ActionController::Base
2+
end

test/dummy/app/controllers/concerns/.keep

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module ApplicationHelper
2+
end
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class ApplicationJob < ActiveJob::Base
2+
# Automatically retry jobs that encountered a deadlock
3+
# retry_on ActiveRecord::Deadlocked
4+
5+
# Most jobs are safe to ignore if the underlying records are no longer available
6+
# discard_on ActiveJob::DeserializationError
7+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class ApplicationRecord < ActiveRecord::Base
2+
primary_abstract_class
3+
end

test/dummy/app/models/concerns/.keep

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Dummy</title>
5+
<meta name="viewport" content="width=device-width,initial-scale=1">
6+
<%= csrf_meta_tags %>
7+
<%= csp_meta_tag %>
8+
9+
<%= stylesheet_link_tag "application" %>
10+
</head>
11+
12+
<body>
13+
<%= yield %>
14+
</body>
15+
</html>

test/dummy/bin/rails

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env ruby
2+
APP_PATH = File.expand_path("../config/application", __dir__)
3+
require_relative "../config/boot"
4+
require "rails/commands"

test/dummy/bin/rake

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env ruby
2+
require_relative "../config/boot"
3+
require "rake"
4+
Rake.application.run

0 commit comments

Comments
 (0)