<commit_before># Template for rails new app
# Run this like `rails new shipit -m template.rb`
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.5')
  raise Thor::Error, "You need at least Ruby 2.5 to install shipit"
end
if Gem::Version.new(Rails::VERSION::STRING) < Gem::Version.new('6.0')
  raise Thor::Error, "You need Rails 6.0 to install shipit"
end

route %(mount Shipit::Engine, at: '/')

gem 'sidekiq'
gem 'shipit-engine'
gem 'redis-rails'

create_file 'Procfile', <<-CODE
web: bundle exec rails s -p $PORT
worker: bundle exec sidekiq -C config/sidekiq.yml
CODE

environment 'Pubsubstub.use_persistent_connections = false'
environment 'config.cache_store = :redis_store, Shipit.redis_url.to_s, { expires_in: 90.minutes }', env: :production
environment 'config.active_record.cache_versioning = false', env: :production

remove_file 'config/database.yml'
create_file 'config/database.yml', <<-CODE
default: &default
  adapter: sqlite3
  pool: 5
  timeout: 5000

development:
  <<: *default
  database: db/development.sqlite3

# Warning: The database defined as "test" will be erased and<commit_msg>Replace 'redis-rails' cache with built in rails implementation<commit_after># Template for rails new app
# Run this like `rails new shipit -m template.rb`
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.5')
  raise Thor::Error, "You need at least Ruby 2.5 to install shipit"
end
if Gem::Version.new(Rails::VERSION::STRING) < Gem::Version.new('6.0')
  raise Thor::Error, "You need Rails 6.0 to install shipit"
end

route %(mount Shipit::Engine, at: '/')

gem 'sidekiq'
gem 'shipit-engine'
gsub_file 'Gemfile', "# Use Redis adapter to run Action Cable in production", ''
gsub_file 'Gemfile', "# gem 'redis'", "gem 'redis'"

create_file 'Procfile', <<-CODE
web: bundle exec rails s -p $PORT
worker: bundle exec sidekiq -C config/sidekiq.yml
CODE

environment 'Pubsubstub.use_persistent_connections = false'
environment 'config.cache_store = :redis_cache_store, { url: Shipit.redis_url.to_s, expires_in: 90.minutes }', env: :production

remove_file 'config/database.yml'
create_file 'config/database.yml', <<-CODE
default: &default
  adapter: sqlite3
  pool: 5
  timeout: 5000

development:
  <<: *default
  database: db/development.sqlite3

# Warning: The database defined as "test" will be erased and
{'fraction_non_alphanumeric': 0.12829373650107992, 'fraction_numerical': 0.01468682505399568, 'mean_word_length': 5.276422764227642, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6088184', 'n_tokens_mistral': 822, 'n_tokens_neox': 770, 'n_words': 241}