Skip to content

Commit

Permalink
chore(release): 0.15.0.beta.5 + rubocop fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
joelmoss committed Apr 15, 2024
1 parent d11bc65 commit 52a5453
Show file tree
Hide file tree
Showing 25 changed files with 79 additions and 46 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ GIT
PATH
remote: .
specs:
proscenium (0.15.0.beta.4)
proscenium (0.15.0.beta.5)
activesupport (>= 6.1.0, < 8.0)
dry-initializer (~> 3.1)
dry-types (~> 1.7)
Expand Down
2 changes: 1 addition & 1 deletion fixtures/dummy/app/controllers/bare_pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class BarePagesController < ApplicationController

private

def normalize_sideload_assets_params # rubocop:disable Metrics/AbcSize
def normalize_sideload_assets_params
%i[sideload_view_assets sideload_layout_assets
sideload_partial_assets sideload_partial_layout_assets].each do |key|
next unless params[key]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file.

# ActiveSupport::Reloader.to_prepare do
Expand Down
1 change: 1 addition & 0 deletions fixtures/dummy/config/initializers/assets.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file.

# Version of your assets, change this if you want to expire all your assets.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file.

# Define an application-wide content security policy
Expand Down
1 change: 1 addition & 0 deletions fixtures/dummy/config/initializers/mime_types.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file.

# Add new mime types for use in respond_to blocks:
Expand Down
1 change: 1 addition & 0 deletions fixtures/dummy/config/initializers/permissions_policy.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

# Define an application-wide HTTP permissions policy. For further
# information see https://developers.google.com/web/updates/2018/06/feature-policy
#
Expand Down
2 changes: 1 addition & 1 deletion lib/proscenium/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def initialize(root: nil, base_url: nil)
@base_url = base_url
end

def build_to_path(path) # rubocop:disable Metrics/AbcSize
def build_to_path(path)
ActiveSupport::Notifications.instrument('build_to_path.proscenium',
identifier: path,
cached: Proscenium.cache.exist?(path)) do
Expand Down
2 changes: 1 addition & 1 deletion lib/proscenium/ui/breadcrumbs/computed_element.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def name
# No matter what, the result is always passed to `url_for` before being returned.
#
# @return [String] the URL for the element
def path # rubocop:disable Metrics/AbcSize
def path
@path ||= unless @element.path.nil?
case path = @element.path
when Array
Expand Down
2 changes: 1 addition & 1 deletion lib/proscenium/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Proscenium
VERSION = '0.15.0.beta.4'
VERSION = '0.15.0.beta.5'
end
2 changes: 2 additions & 0 deletions playground/app/models/application_record.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class ApplicationRecord < ActiveRecord::Base
primary_abstract_class
end
8 changes: 5 additions & 3 deletions playground/bin/rails
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
APP_PATH = File.expand_path("../config/application", __dir__)
require_relative "../config/boot"
require "rails/commands"
# frozen_string_literal: true

APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot'
require 'rails/commands'
6 changes: 4 additions & 2 deletions playground/bin/rake
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
require_relative "../config/boot"
require "rake"
# frozen_string_literal: true

require_relative '../config/boot'
require 'rake'
Rake.application.run
18 changes: 10 additions & 8 deletions playground/bin/setup
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/usr/bin/env ruby
require "fileutils"
# frozen_string_literal: true

require 'fileutils'

# path to your application root.
APP_ROOT = File.expand_path("..", __dir__)
APP_ROOT = File.expand_path('..', __dir__)

def system!(*args)
system(*args, exception: true)
Expand All @@ -13,21 +15,21 @@ FileUtils.chdir APP_ROOT do
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
# Add necessary setup steps to this file.

puts "== Installing dependencies =="
system! "gem install bundler --conservative"
system("bundle check") || system!("bundle install")
puts '== Installing dependencies =='
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')

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

puts "\n== Preparing database =="
system! "bin/rails db:prepare"
system! 'bin/rails db:prepare'

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

puts "\n== Restarting application server =="
system! "bin/rails restart"
system! 'bin/rails restart'
end
4 changes: 3 additions & 1 deletion playground/config.ru
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

# This file is used by Rack-based servers to start the application.

require_relative "config/environment"
require_relative 'config/environment'

run Rails.application
Rails.application.load_server
4 changes: 2 additions & 2 deletions playground/config/boot.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __dir__)
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __dir__)

require "bundler/setup" # Set up gems listed in the Gemfile.
require 'bundler/setup' # Set up gems listed in the Gemfile.
$LOAD_PATH.unshift File.expand_path('../../lib', __dir__)
4 changes: 3 additions & 1 deletion playground/config/environment.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# Load the Rails application.
require_relative "application"
require_relative 'application'

# Initialize the Rails application.
Rails.application.initialize!
2 changes: 2 additions & 0 deletions playground/config/environments/development.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'active_support/core_ext/integer/time'

Rails.application.configure do
Expand Down
16 changes: 9 additions & 7 deletions playground/config/environments/production.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'active_support/core_ext/integer/time'

Rails.application.configure do
Expand All @@ -16,9 +18,9 @@
config.consider_all_requests_local = false
config.action_controller.perform_caching = true

# Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment
# key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files).
# config.require_master_key = true
# Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key,
# or an environment key such as config/credentials/production.key. This key is used to decrypt
# credentials (and other encrypted files). config.require_master_key = true

# Disable serving static files from `public/`, relying on NGINX/Apache to do so instead.
# config.public_file_server.enabled = false
Expand All @@ -38,16 +40,16 @@
config.force_ssl = true

# Log to STDOUT by default
config.logger = ActiveSupport::Logger.new(STDOUT)
config.logger = ActiveSupport::Logger.new($stdout)
.tap { |logger| logger.formatter = Logger::Formatter.new }
.then { |logger| ActiveSupport::TaggedLogging.new(logger) }

# Prepend all log lines with the following tags.
config.log_tags = [:request_id]

# "info" includes generic and useful information about system operation, but avoids logging too much
# information to avoid inadvertent exposure of personally identifiable information (PII). If you
# want to log everything, set the level to "debug".
# "info" includes generic and useful information about system operation, but avoids logging too
# much information to avoid inadvertent exposure of personally identifiable information (PII). If
# you want to log everything, set the level to "debug".
config.log_level = ENV.fetch('RAILS_LOG_LEVEL', 'info')

# Use a different cache store in production.
Expand Down
8 changes: 5 additions & 3 deletions playground/config/environments/test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
require "active_support/core_ext/integer/time"
# frozen_string_literal: true

require 'active_support/core_ext/integer/time'

# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
Expand All @@ -15,12 +17,12 @@
# this is usually not necessary, and can slow down your test suite. However, it's
# recommended that you enable it in continuous integration systems to ensure eager
# loading is working properly before deploying your code.
config.eager_load = ENV["CI"].present?
config.eager_load = ENV['CI'].present?

# Configure public file server for tests with Cache-Control for performance.
config.public_file_server.enabled = true
config.public_file_server.headers = {
"Cache-Control" => "public, max-age=#{1.hour.to_i}"
'Cache-Control' => "public, max-age=#{1.hour.to_i}"
}

# Show full error reports and disable caching.
Expand Down
2 changes: 2 additions & 0 deletions playground/config/initializers/content_security_policy.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file.

# Define an application-wide content security policy.
Expand Down
12 changes: 7 additions & 5 deletions playground/config/initializers/filter_parameter_logging.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file.

# Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file.
# Use this to limit dissemination of sensitive information.
# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
Rails.application.config.filter_parameters += [
:passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
# Configure parameters to be partially matched (e.g. passw matches password) and filtered from the
# log file. Use this to limit dissemination of sensitive information. See the
# ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
Rails.application.config.filter_parameters += %i[
passw secret token _key crypt salt certificate otp ssn
]
2 changes: 2 additions & 0 deletions playground/config/initializers/inflections.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file.

# Add new inflection rules using the following format. Inflections
Expand Down
2 changes: 2 additions & 0 deletions playground/config/initializers/permissions_policy.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file.

# Define an application-wide HTTP permissions policy. For further
Expand Down
20 changes: 11 additions & 9 deletions playground/config/puma.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# This configuration file will be evaluated by Puma. The top-level methods that
# are invoked here are part of Puma's configuration DSL. For more information
# about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html.
Expand All @@ -7,29 +9,29 @@
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches the default thread size of Active Record.
max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
max_threads_count = ENV.fetch('RAILS_MAX_THREADS', 5)
min_threads_count = ENV.fetch('RAILS_MIN_THREADS') { max_threads_count }
threads min_threads_count, max_threads_count

# Specifies that the worker count should equal the number of processors in production.
if ENV["RAILS_ENV"] == "production"
require "concurrent-ruby"
worker_count = Integer(ENV.fetch("WEB_CONCURRENCY") { Concurrent.physical_processor_count })
if ENV['RAILS_ENV'] == 'production'
require 'concurrent-ruby'
worker_count = Integer(ENV.fetch('WEB_CONCURRENCY') { Concurrent.physical_processor_count })
workers worker_count if worker_count > 1
end

# Specifies the `worker_timeout` threshold that Puma will use to wait before
# terminating a worker in development environments.
worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
worker_timeout 3600 if ENV.fetch('RAILS_ENV', 'development') == 'development'

# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
port ENV.fetch("PORT") { 3000 }
port ENV.fetch('PORT', 3000)

# Specifies the `environment` that Puma will run in.
environment ENV.fetch("RAILS_ENV") { "development" }
environment ENV.fetch('RAILS_ENV', 'development')

# Specifies the `pidfile` that Puma will use.
pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
pidfile ENV.fetch('PIDFILE', 'tmp/pids/server.pid')

# Allow puma to be restarted by `bin/rails restart` command.
plugin :tmp_restart

0 comments on commit 52a5453

Please sign in to comment.