gregschmit/rails-rest-framework

View on GitHub
bin/setup

Summary

Maintainability
Test Coverage
#!/usr/bin/env ruby

# Configure the development or production environment; must be idempotent.

require "fileutils"

def system!(*args)
  system(*args) || abort("\n== Command #{args} failed ==")
end

FileUtils.chdir(File.expand_path("..", __dir__)) do
  puts "== Installing Ruby dependencies =="
  system!("bundle install")

  puts "\n== Preparing database =="
  system!("bin/rails db:reset")

  puts "\n== Removing old logs and tempfiles =="
  system!("bin/rails log:clear tmp:clear")

  puts "\n\nšŸš€ Ready! Run the test application with: `rails s`. šŸš€\n"
end