Skip to content

Commit

Permalink
Remove unused gems, replace credentials with secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
printercu committed Mar 12, 2022
1 parent 4024300 commit 559693c
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 55 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@
/config/master.key

spec/examples.txt
config/secrets.yml
12 changes: 6 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ gem "turbo-rails"
gem "stimulus-rails"

# Build JSON APIs with ease [https://github.com/rails/jbuilder]
gem "jbuilder"
# gem "jbuilder"

# Use Redis adapter to run Action Cable in production
gem "redis", "~> 4.0"
# gem "redis", "~> 4.0"

# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
# gem "kredis"
Expand All @@ -40,7 +40,7 @@ gem "redis", "~> 4.0"
gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]

# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", require: false
# gem "bootsnap", require: false

# Use Sass to process CSS
# gem "sassc-rails"
Expand Down Expand Up @@ -75,9 +75,9 @@ end

group :test do
# Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
gem "capybara"
gem "selenium-webdriver"
gem "webdrivers"
# gem "capybara"
# gem "selenium-webdriver"
# gem "webdrivers"

gem "rspec-rails"
gem "rspec-its"
Expand Down
40 changes: 0 additions & 40 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -66,24 +66,10 @@ GEM
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
awesome_print (1.9.2)
bindex (0.8.1)
bootsnap (1.11.1)
msgpack (~> 1.2)
builder (3.2.4)
byebug (11.1.3)
capybara (3.36.0)
addressable
matrix
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
childprocess (4.1.0)
coderay (1.1.3)
concurrent-ruby (1.1.9)
crass (1.0.6)
Expand All @@ -104,20 +90,15 @@ GEM
io-wait (0.2.1)
irb (1.4.1)
reline (>= 0.3.0)
jbuilder (2.11.5)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
loofah (2.14.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (1.0.2)
matrix (0.4.2)
method_source (1.0.0)
mini_mime (1.1.2)
minitest (5.15.0)
msgpack (1.4.5)
net-imap (0.2.3)
digest
net-protocol
Expand Down Expand Up @@ -147,7 +128,6 @@ GEM
yard (~> 0.9.11)
pry-rails (0.3.9)
pry (>= 0.10.4)
public_suffix (4.0.6)
puma (5.6.2)
nio4r (~> 2.0)
racc (1.6.0)
Expand Down Expand Up @@ -181,11 +161,8 @@ GEM
thor (~> 1.0)
zeitwerk (~> 2.5)
rake (13.0.6)
redis (4.6.0)
regexp_parser (2.2.1)
reline (0.3.1)
io-console (~> 0.5)
rexml (3.2.5)
rspec-core (3.11.0)
rspec-support (~> 3.11.0)
rspec-expectations (3.11.0)
Expand All @@ -206,11 +183,6 @@ GEM
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
rspec-support (3.11.0)
rubyzip (2.3.2)
selenium-webdriver (4.1.0)
childprocess (>= 0.5, < 5.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2)
spring (4.0.0)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
Expand All @@ -237,16 +209,10 @@ GEM
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webdrivers (5.0.0)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (~> 4.0)
webrick (1.7.0)
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
yard (0.9.27)
webrick (~> 1.7.0)
zeitwerk (2.5.4)
Expand All @@ -256,21 +222,16 @@ PLATFORMS

DEPENDENCIES
awesome_print
bootsnap
capybara
debug
importmap-rails
jbuilder
pry
pry-byebug
pry-doc
pry-rails
puma (~> 5.0)
rails (~> 7.0.2, >= 7.0.2.3)
redis (~> 4.0)
rspec-its
rspec-rails
selenium-webdriver
spring
spring-commands-rspec
sprockets-rails
Expand All @@ -279,7 +240,6 @@ DEPENDENCIES
turbo-rails
tzinfo-data
web-console
webdrivers

RUBY VERSION
ruby 3.0.0p0
Expand Down
5 changes: 4 additions & 1 deletion bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ FileUtils.chdir APP_ROOT do
system! "gem install bundler --conservative"
system("bundle check") || system!("bundle install")

# puts "\n== Copying sample files =="
puts "\n== Copying sample files =="
# unless File.exist?("config/database.yml")
# FileUtils.cp "config/database.yml.sample", "config/database.yml"
# end
unless File.exist?("config/secrets.yml")
cp "config/secrets.yml.sample", "config/secrets.yml"
end

puts "\n== Preparing database =="
system! "bin/rails db:prepare"
Expand Down
2 changes: 1 addition & 1 deletion config/boot.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

require "bundler/setup" # Set up gems listed in the Gemfile.
require "bootsnap/setup" # Speed up boot time by caching expensive operations.
# require "bootsnap/setup" # Speed up boot time by caching expensive operations.
1 change: 0 additions & 1 deletion config/credentials.yml.enc

This file was deleted.

10 changes: 10 additions & 0 deletions config/secrets.yml.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
development: &dev
secret_key_base: 93b7f55dd41146764804e122fc94b1e9b9fd86718659a219e8f0828135156dd0245165b215e29d740da4626d92ef2f04648627f8de96b75e59ef8d1a06f35788

test:
secret_key_base: 7fb559360ff2d7297bf5fbe7eeb7480e3692373708e08283498acfcbfb4207c142812bb52f36606e13cbf9b22a309bf4a64882e0424527f42423106f77e9faba

# Do not keep production secrets in the repository,
# instead read values from the environment.
production:
<<: *dev
12 changes: 6 additions & 6 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@

# Checks for pending migrations and applies them before tests are run.
# If you are not using ActiveRecord, you can remove these lines.
begin
ActiveRecord::Migration.maintain_test_schema!
rescue ActiveRecord::PendingMigrationError => e
puts e.to_s.strip
exit 1
end
# begin
# ActiveRecord::Migration.maintain_test_schema!
# rescue ActiveRecord::PendingMigrationError => e
# puts e.to_s.strip
# exit 1
# end
RSpec.configure do |config|
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
config.fixture_path = "#{::Rails.root}/spec/fixtures"
Expand Down

0 comments on commit 559693c

Please sign in to comment.