Skip to content

Commit 2c84856

Browse files
Intial gems
- for testing - Tailwindcss - linters
1 parent 4a96f8d commit 2c84856

Some content is hidden

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

43 files changed

+5757
-96
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,7 @@
2929

3030
# Ignore master key for decrypting credentials and more.
3131
/config/master.key
32+
33+
/app/assets/builds/*
34+
!/app/assets/builds/.keep
35+
/node_modules

.rubocop.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
AllCops:
2+
NewCops: enable
3+
Exclude:
4+
- "db/**/*"
5+
- "bin/*"
6+
- "config/**/*"
7+
- "Guardfile"
8+
- "Rakefile"
9+
- "node_modules/**/*"
10+
11+
DisplayCopNames: true
12+
13+
Layout/LineLength:
14+
Max: 120
15+
Metrics/MethodLength:
16+
Include:
17+
- "app/controllers/*"
18+
- "app/models/*"
19+
Max: 20
20+
Metrics/AbcSize:
21+
Include:
22+
- "app/controllers/*"
23+
- "app/models/*"
24+
Max: 50
25+
Metrics/ClassLength:
26+
Max: 150
27+
Metrics/BlockLength:
28+
IgnoredMethods: ['describe']
29+
Max: 30
30+
31+
Style/Documentation:
32+
Enabled: false
33+
Style/ClassAndModuleChildren:
34+
Enabled: false
35+
Style/EachForSimpleLoop:
36+
Enabled: false
37+
Style/AndOr:
38+
Enabled: false
39+
Style/DefWithParentheses:
40+
Enabled: false
41+
Style/FrozenStringLiteralComment:
42+
EnforcedStyle: never
43+
44+
Layout/HashAlignment:
45+
EnforcedColonStyle: key
46+
Layout/ExtraSpacing:
47+
AllowForAlignment: false
48+
Layout/MultilineMethodCallIndentation:
49+
Enabled: true
50+
EnforcedStyle: indented
51+
Lint/RaiseException:
52+
Enabled: false
53+
Lint/StructNewOverride:
54+
Enabled: false
55+
Style/HashEachMethods:
56+
Enabled: false
57+
Style/HashTransformKeys:
58+
Enabled: false
59+
Style/HashTransformValues:
60+
Enabled: false

.stylelintrc.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": ["stylelint-config-standard"],
3+
"plugins": ["stylelint-scss", "stylelint-csstree-validator"],
4+
"rules": {
5+
"at-rule-no-unknown": null,
6+
"scss/at-rule-no-unknown": true,
7+
"csstree/validator": true
8+
},
9+
"ignoreFiles": ["build/**", "dist/**", "**/reset*.css", "**/bootstrap*.css", "**/*tailwind.css"]
10+
}

Gemfile

+25-14
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
1-
source "https://rubygems.org"
1+
# frozen_string_literal: true
2+
3+
source 'https://rubygems.org'
24
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
35

4-
ruby "3.1.1"
6+
ruby '3.1.1'
57

68
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
7-
gem "rails", "~> 7.0.2", ">= 7.0.2.2"
9+
gem 'rails', '~> 7.0.2', '>= 7.0.2.2'
810

911
# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
10-
gem "sprockets-rails"
12+
gem 'sprockets-rails'
1113

1214
# Use postgresql as the database for Active Record
13-
gem "pg", "~> 1.1"
15+
gem 'pg', '~> 1.1'
1416

1517
# Use the Puma web server [https://github.com/puma/puma]
16-
gem "puma", "~> 5.0"
18+
gem 'puma', '~> 5.0'
1719

1820
# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
19-
gem "importmap-rails"
21+
gem 'importmap-rails'
2022

2123
# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
22-
gem "turbo-rails"
24+
gem 'turbo-rails'
2325

2426
# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
25-
gem "stimulus-rails"
27+
gem 'stimulus-rails'
2628

2729
# Build JSON APIs with ease [https://github.com/rails/jbuilder]
28-
gem "jbuilder"
30+
gem 'jbuilder'
2931

3032
# Use Redis adapter to run Action Cable in production
3133
# gem "redis", "~> 4.0"
@@ -37,10 +39,10 @@ gem "jbuilder"
3739
# gem "bcrypt", "~> 3.1.7"
3840

3941
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
40-
gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]
42+
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
4143

4244
# Reduces boot times through caching; required in config/boot.rb
43-
gem "bootsnap", require: false
45+
gem 'bootsnap', require: false
4446

4547
# Use Sass to process CSS
4648
# gem "sassc-rails"
@@ -50,12 +52,12 @@ gem "bootsnap", require: false
5052

5153
group :development, :test do
5254
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
53-
gem "debug", platforms: %i[ mri mingw x64_mingw ]
55+
gem 'debug', platforms: %i[mri mingw x64_mingw]
5456
end
5557

5658
group :development do
5759
# Use console on exceptions pages [https://github.com/rails/web-console]
58-
gem "web-console"
60+
gem 'web-console'
5961

6062
# Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
6163
# gem "rack-mini-profiler"
@@ -64,3 +66,12 @@ group :development do
6466
# gem "spring"
6567
end
6668

69+
group :test do
70+
# Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
71+
gem 'capybara'
72+
gem 'rspec-rails', '~> 5.1'
73+
gem 'selenium-webdriver'
74+
gem 'webdrivers'
75+
end
76+
77+
gem 'tailwindcss-rails', '~> 2.0'

Gemfile.lock

+57
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,28 @@ GEM
6666
i18n (>= 1.6, < 2)
6767
minitest (>= 5.1)
6868
tzinfo (~> 2.0)
69+
addressable (2.8.0)
70+
public_suffix (>= 2.0.2, < 5.0)
6971
bindex (0.8.1)
7072
bootsnap (1.11.1)
7173
msgpack (~> 1.2)
7274
builder (3.2.4)
75+
capybara (3.36.0)
76+
addressable
77+
matrix
78+
mini_mime (>= 0.1.3)
79+
nokogiri (~> 1.8)
80+
rack (>= 1.6.0)
81+
rack-test (>= 0.6.3)
82+
regexp_parser (>= 1.5, < 3.0)
83+
xpath (~> 3.2)
84+
childprocess (4.1.0)
7385
concurrent-ruby (1.1.9)
7486
crass (1.0.6)
7587
debug (1.4.0)
7688
irb (>= 1.3.6)
7789
reline (>= 0.2.7)
90+
diff-lcs (1.5.0)
7891
digest (3.1.0)
7992
erubi (1.10.0)
8093
globalid (1.0.0)
@@ -97,6 +110,7 @@ GEM
97110
mail (2.7.1)
98111
mini_mime (>= 0.1.1)
99112
marcel (1.0.2)
113+
matrix (0.4.2)
100114
method_source (1.0.0)
101115
mini_mime (1.1.2)
102116
minitest (5.15.0)
@@ -117,9 +131,12 @@ GEM
117131
net-protocol
118132
timeout
119133
nio4r (2.5.8)
134+
nokogiri (1.13.3-arm64-darwin)
135+
racc (~> 1.4)
120136
nokogiri (1.13.3-x86_64-linux)
121137
racc (~> 1.4)
122138
pg (1.3.4)
139+
public_suffix (4.0.6)
123140
puma (5.6.2)
124141
nio4r (~> 2.0)
125142
racc (1.6.0)
@@ -153,8 +170,32 @@ GEM
153170
thor (~> 1.0)
154171
zeitwerk (~> 2.5)
155172
rake (13.0.6)
173+
regexp_parser (2.2.1)
156174
reline (0.3.1)
157175
io-console (~> 0.5)
176+
rexml (3.2.5)
177+
rspec-core (3.11.0)
178+
rspec-support (~> 3.11.0)
179+
rspec-expectations (3.11.0)
180+
diff-lcs (>= 1.2.0, < 2.0)
181+
rspec-support (~> 3.11.0)
182+
rspec-mocks (3.11.0)
183+
diff-lcs (>= 1.2.0, < 2.0)
184+
rspec-support (~> 3.11.0)
185+
rspec-rails (5.1.1)
186+
actionpack (>= 5.2)
187+
activesupport (>= 5.2)
188+
railties (>= 5.2)
189+
rspec-core (~> 3.10)
190+
rspec-expectations (~> 3.10)
191+
rspec-mocks (~> 3.10)
192+
rspec-support (~> 3.10)
193+
rspec-support (3.11.0)
194+
rubyzip (2.3.2)
195+
selenium-webdriver (4.1.0)
196+
childprocess (>= 0.5, < 5.0)
197+
rexml (~> 3.2, >= 3.2.5)
198+
rubyzip (>= 1.2.2)
158199
sprockets (4.0.3)
159200
concurrent-ruby (~> 1.0)
160201
rack (> 1, < 3)
@@ -165,6 +206,10 @@ GEM
165206
stimulus-rails (1.0.4)
166207
railties (>= 6.0.0)
167208
strscan (3.0.1)
209+
tailwindcss-rails (2.0.8-arm64-darwin)
210+
railties (>= 6.0.0)
211+
tailwindcss-rails (2.0.8-x86_64-linux)
212+
railties (>= 6.0.0)
168213
thor (1.2.1)
169214
timeout (0.2.0)
170215
turbo-rails (1.0.1)
@@ -177,27 +222,39 @@ GEM
177222
activemodel (>= 6.0.0)
178223
bindex (>= 0.4.0)
179224
railties (>= 6.0.0)
225+
webdrivers (5.0.0)
226+
nokogiri (~> 1.6)
227+
rubyzip (>= 1.3.0)
228+
selenium-webdriver (~> 4.0)
180229
websocket-driver (0.7.5)
181230
websocket-extensions (>= 0.1.0)
182231
websocket-extensions (0.1.5)
232+
xpath (3.2.0)
233+
nokogiri (~> 1.8)
183234
zeitwerk (2.5.4)
184235

185236
PLATFORMS
237+
arm64-darwin-21
186238
x86_64-linux
187239

188240
DEPENDENCIES
189241
bootsnap
242+
capybara
190243
debug
191244
importmap-rails
192245
jbuilder
193246
pg (~> 1.1)
194247
puma (~> 5.0)
195248
rails (~> 7.0.2, >= 7.0.2.2)
249+
rspec-rails (~> 5.1)
250+
selenium-webdriver
196251
sprockets-rails
197252
stimulus-rails
253+
tailwindcss-rails (~> 2.0)
198254
turbo-rails
199255
tzinfo-data
200256
web-console
257+
webdrivers
201258

202259
RUBY VERSION
203260
ruby 3.1.1p18

Procfile.dev

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
web: bin/rails server -p 3000
2+
css: bin/rails tailwindcss:watch

Rakefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
# frozen_string_literal: true
2+
13
# Add your own tasks in files placed in lib/tasks ending in .rake,
24
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
35

4-
require_relative "config/application"
6+
require_relative 'config/application'
57

68
Rails.application.load_tasks

app/assets/builds/.keep

Whitespace-only changes.

app/assets/config/manifest.js

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
//= link_directory ../stylesheets .css
33
//= link_tree ../../javascript .js
44
//= link_tree ../../../vendor/javascript .js
5+
//= link_tree ../builds
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
4+
5+
/*
6+
7+
@layer components {
8+
.btn-primary {
9+
@apply py-2 px-4 bg-blue-200;
10+
}
11+
}
12+
13+
*/

app/channels/application_cable/channel.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module ApplicationCable
24
class Channel < ActionCable::Channel::Base
35
end

app/channels/application_cable/connection.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module ApplicationCable
24
class Connection < ActionCable::Connection::Base
35
end
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
# frozen_string_literal: true
2+
3+
# Apllication controller
14
class ApplicationController < ActionController::Base
25
end

app/helpers/application_helper.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
# frozen_string_literal: true
2+
3+
# ApplicationHelper
14
module ApplicationHelper
25
end

app/jobs/application_job.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ApplicationJob < ActiveJob::Base
24
# Automatically retry jobs that encountered a deadlock
35
# retry_on ActiveRecord::Deadlocked

app/mailers/application_mailer.rb

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
# frozen_string_literal: true
2+
13
class ApplicationMailer < ActionMailer::Base
2-
default from: "[email protected]"
3-
layout "mailer"
4+
default from: '[email protected]'
5+
layout 'mailer'
46
end

app/models/application_record.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class ApplicationRecord < ActiveRecord::Base
24
primary_abstract_class
35
end

app/views/layouts/application.html.erb

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@
55
<meta name="viewport" content="width=device-width,initial-scale=1">
66
<%= csrf_meta_tags %>
77
<%= csp_meta_tag %>
8+
<%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %>
89

910
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
1011
<%= javascript_importmap_tags %>
1112
</head>
1213

1314
<body>
14-
<%= yield %>
15+
<main class="container mx-auto mt-28 px-5 flex">
16+
<%= yield %>
17+
</main>
1518
</body>
1619
</html>

0 commit comments

Comments
 (0)