commit 74f134c71a9d72768dc9dbb466dab82cc90cf406 Author: RubyOn Date: Wed Apr 16 23:15:08 2025 +0900 first commit diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..a79e364 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,3 @@ +# Make sure RUBY_VERSION matches the Ruby version in .ruby-version +ARG RUBY_VERSION=3.4.2 +FROM ghcr.io/rails/devcontainer/images/ruby:$RUBY_VERSION diff --git a/.devcontainer/compose.yaml b/.devcontainer/compose.yaml new file mode 100644 index 0000000..73d5458 --- /dev/null +++ b/.devcontainer/compose.yaml @@ -0,0 +1,27 @@ +name: "farmitry_hvac" + +services: + rails-app: + build: + context: .. + dockerfile: .devcontainer/Dockerfile + + volumes: + - ../..:/workspaces:cached + + # Overrides default command so things don't shut down after the process ends. + command: sleep infinity + + # Uncomment the next line to use a non-root user for all processes. + # user: vscode + + # Use "forwardPorts" in **devcontainer.json** to forward an app port locally. + # (Adding the "ports" property to this file will not forward from a Codespace.) + depends_on: + - selenium + + selenium: + image: selenium/standalone-chromium + restart: unless-stopped + + diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..f73fc1c --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,36 @@ +// For format details, see https://containers.dev/implementors/json_reference/. +// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/ruby +{ + "name": "farmitry_hvac", + "dockerComposeFile": "compose.yaml", + "service": "rails-app", + "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", + + // Features to add to the dev container. More info: https://containers.dev/features. + "features": { + "ghcr.io/devcontainers/features/github-cli:1": {}, + "ghcr.io/rails/devcontainer/features/activestorage": {}, + "ghcr.io/devcontainers/features/node:1": {}, + "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}, + "ghcr.io/rails/devcontainer/features/sqlite3": {} + }, + + "containerEnv": { + "CAPYBARA_SERVER_PORT": "45678", + "SELENIUM_HOST": "selenium", + "KAMAL_REGISTRY_PASSWORD": "$KAMAL_REGISTRY_PASSWORD" + }, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + "forwardPorts": [3000], + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://containers.dev/implementors/json_reference/#remoteUser. + // "remoteUser": "root", + + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "bin/setup --skip-server" +} diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..325bfc0 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,51 @@ +# See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files. + +# Ignore git directory. +/.git/ +/.gitignore + +# Ignore bundler config. +/.bundle + +# Ignore all environment files. +/.env* + +# Ignore all default key files. +/config/master.key +/config/credentials/*.key + +# Ignore all logfiles and tempfiles. +/log/* +/tmp/* +!/log/.keep +!/tmp/.keep + +# Ignore pidfiles, but keep the directory. +/tmp/pids/* +!/tmp/pids/.keep + +# Ignore storage (uploaded files in development and any SQLite databases). +/storage/* +!/storage/.keep +/tmp/storage/* +!/tmp/storage/.keep + +# Ignore assets. +/node_modules/ +/app/assets/builds/* +!/app/assets/builds/.keep +/public/assets + +# Ignore CI service files. +/.github + +# Ignore Kamal files. +/config/deploy*.yml +/.kamal + +# Ignore development files +/.devcontainer + +# Ignore Docker-related files +/.dockerignore +/Dockerfile* diff --git a/.erb_lint.yml b/.erb_lint.yml new file mode 100644 index 0000000..8fd4fc9 --- /dev/null +++ b/.erb_lint.yml @@ -0,0 +1,9 @@ +# .erb_lint.yml +linters: + RuboCop: + enabled: true + rubocop_config: .rubocop.yml + SpaceInHtmlTag: + enabled: false + RequireInputAutocomplete: + enabled: false \ No newline at end of file diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8dc4323 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,9 @@ +# See https://git-scm.com/docs/gitattributes for more about git attribute files. + +# Mark the database schema as having been generated. +db/schema.rb linguist-generated + +# Mark any vendored files as having been vendored. +vendor/* linguist-vendored +config/credentials/*.yml.enc diff=rails_credentials +config/credentials.yml.enc diff=rails_credentials diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..f0527e6 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +version: 2 +updates: +- package-ecosystem: bundler + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 10 +- package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 10 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..dab7654 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,74 @@ +name: CI + +on: + pull_request: + push: + branches: [ main ] + +jobs: + scan_ruby: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: .ruby-version + bundler-cache: true + + - name: Scan for common Rails security vulnerabilities using static analysis + run: bin/brakeman --no-pager + + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: .ruby-version + bundler-cache: true + + - name: Lint code for consistent style + run: bin/rubocop -f github + + test: + runs-on: ubuntu-latest + + # services: + # redis: + # image: redis + # ports: + # - 6379:6379 + # options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5 + steps: + - name: Install packages + run: sudo apt-get update && sudo apt-get install --no-install-recommends -y build-essential git libyaml-dev node-gyp pkg-config python-is-python3 google-chrome-stable + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: .ruby-version + bundler-cache: true + + - name: Run tests + env: + RAILS_ENV: test + # REDIS_URL: redis://localhost:6379/0 + run: bin/rails db:test:prepare test test:system + + - name: Keep screenshots from failed system tests + uses: actions/upload-artifact@v4 + if: failure() + with: + name: screenshots + path: ${{ github.workspace }}/tmp/screenshots + if-no-files-found: ignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..afd85fd --- /dev/null +++ b/.gitignore @@ -0,0 +1,39 @@ +# See https://help.github.com/articles/ignoring-files for more about ignoring files. +# +# Temporary files generated by your text editor or operating system +# belong in git's global ignore instead: +# `$XDG_CONFIG_HOME/git/ignore` or `~/.config/git/ignore` + +# Ignore bundler config. +/.bundle + +# Ignore all environment files. +/.env* + +# Ignore all logfiles and tempfiles. +/log/* +/tmp/* +!/log/.keep +!/tmp/.keep + +# Ignore pidfiles, but keep the directory. +/tmp/pids/* +!/tmp/pids/ +!/tmp/pids/.keep + +# Ignore storage (uploaded files in development and any SQLite databases). +/storage/* +!/storage/.keep +/tmp/storage/* +!/tmp/storage/ +!/tmp/storage/.keep + +/public/assets + +# Ignore master key for decrypting credentials and more. +/config/master.key + +/app/assets/builds/* +!/app/assets/builds/.keep + +/node_modules diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/farmitry_hvac.iml b/.idea/farmitry_hvac.iml new file mode 100644 index 0000000..529c03a --- /dev/null +++ b/.idea/farmitry_hvac.iml @@ -0,0 +1,345 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + file://$MODULE_DIR$/app + + + file://$MODULE_DIR$/app/assets + + + file://$MODULE_DIR$/app/channels + + + file://$MODULE_DIR$/app/controllers + + + file://$MODULE_DIR$/app/helpers + + + file://$MODULE_DIR$/app/mailers + + + file://$MODULE_DIR$/app/models + + + file://$MODULE_DIR$/app/views + + + file://$MODULE_DIR$/config + + + file://$MODULE_DIR$/config/cable.yml + + + file://$MODULE_DIR$/config/cache.yml + + + file://$MODULE_DIR$/config/database.yml + + + file://$MODULE_DIR$/config/environment.rb + + + file://$MODULE_DIR$/config/environments + + + file://$MODULE_DIR$/config/initializers + + + file://$MODULE_DIR$/config/locales + + + file://$MODULE_DIR$/config/routes + + + file://$MODULE_DIR$/config/routes.rb + + + file://$MODULE_DIR$/config/solid_cache.yml + + + file://$MODULE_DIR$/db + + + file://$MODULE_DIR$/db/migrate + + + file://$MODULE_DIR$/db/seeds.rb + + + file://$MODULE_DIR$/lib + + + file://$MODULE_DIR$/lib/assets + + + file://$MODULE_DIR$/lib/tasks + + + file://$MODULE_DIR$/lib/templates + + + file://$MODULE_DIR$/log/development.log + + + file://$MODULE_DIR$/public + + + file://$MODULE_DIR$/public/javascripts + + + file://$MODULE_DIR$/public/stylesheets + + + file://$MODULE_DIR$/test/mailers/previews + file://$MODULE_DIR$/test/mailers/previews + + + file://$MODULE_DIR$/tmp + + + file://$MODULE_DIR$/vendor + + + file://$MODULE_DIR$/vendor/assets + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..09e82d5 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..aabc36f --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.kamal/hooks/docker-setup.sample b/.kamal/hooks/docker-setup.sample new file mode 100755 index 0000000..2fb07d7 --- /dev/null +++ b/.kamal/hooks/docker-setup.sample @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "Docker set up on $KAMAL_HOSTS..." diff --git a/.kamal/hooks/post-app-boot.sample b/.kamal/hooks/post-app-boot.sample new file mode 100755 index 0000000..70f9c4b --- /dev/null +++ b/.kamal/hooks/post-app-boot.sample @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "Booted app version $KAMAL_VERSION on $KAMAL_HOSTS..." diff --git a/.kamal/hooks/post-deploy.sample b/.kamal/hooks/post-deploy.sample new file mode 100755 index 0000000..75efafc --- /dev/null +++ b/.kamal/hooks/post-deploy.sample @@ -0,0 +1,14 @@ +#!/bin/sh + +# A sample post-deploy hook +# +# These environment variables are available: +# KAMAL_RECORDED_AT +# KAMAL_PERFORMER +# KAMAL_VERSION +# KAMAL_HOSTS +# KAMAL_ROLE (if set) +# KAMAL_DESTINATION (if set) +# KAMAL_RUNTIME + +echo "$KAMAL_PERFORMER deployed $KAMAL_VERSION to $KAMAL_DESTINATION in $KAMAL_RUNTIME seconds" diff --git a/.kamal/hooks/post-proxy-reboot.sample b/.kamal/hooks/post-proxy-reboot.sample new file mode 100755 index 0000000..1435a67 --- /dev/null +++ b/.kamal/hooks/post-proxy-reboot.sample @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "Rebooted kamal-proxy on $KAMAL_HOSTS" diff --git a/.kamal/hooks/pre-app-boot.sample b/.kamal/hooks/pre-app-boot.sample new file mode 100755 index 0000000..45f7355 --- /dev/null +++ b/.kamal/hooks/pre-app-boot.sample @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "Booting app version $KAMAL_VERSION on $KAMAL_HOSTS..." diff --git a/.kamal/hooks/pre-build.sample b/.kamal/hooks/pre-build.sample new file mode 100755 index 0000000..f87d811 --- /dev/null +++ b/.kamal/hooks/pre-build.sample @@ -0,0 +1,51 @@ +#!/bin/sh + +# A sample pre-build hook +# +# Checks: +# 1. We have a clean checkout +# 2. A remote is configured +# 3. The branch has been pushed to the remote +# 4. The version we are deploying matches the remote +# +# These environment variables are available: +# KAMAL_RECORDED_AT +# KAMAL_PERFORMER +# KAMAL_VERSION +# KAMAL_HOSTS +# KAMAL_ROLE (if set) +# KAMAL_DESTINATION (if set) + +if [ -n "$(git status --porcelain)" ]; then + echo "Git checkout is not clean, aborting..." >&2 + git status --porcelain >&2 + exit 1 +fi + +first_remote=$(git remote) + +if [ -z "$first_remote" ]; then + echo "No git remote set, aborting..." >&2 + exit 1 +fi + +current_branch=$(git branch --show-current) + +if [ -z "$current_branch" ]; then + echo "Not on a git branch, aborting..." >&2 + exit 1 +fi + +remote_head=$(git ls-remote $first_remote --tags $current_branch | cut -f1) + +if [ -z "$remote_head" ]; then + echo "Branch not pushed to remote, aborting..." >&2 + exit 1 +fi + +if [ "$KAMAL_VERSION" != "$remote_head" ]; then + echo "Version ($KAMAL_VERSION) does not match remote HEAD ($remote_head), aborting..." >&2 + exit 1 +fi + +exit 0 diff --git a/.kamal/hooks/pre-connect.sample b/.kamal/hooks/pre-connect.sample new file mode 100755 index 0000000..18e61d7 --- /dev/null +++ b/.kamal/hooks/pre-connect.sample @@ -0,0 +1,47 @@ +#!/usr/bin/env ruby + +# A sample pre-connect check +# +# Warms DNS before connecting to hosts in parallel +# +# These environment variables are available: +# KAMAL_RECORDED_AT +# KAMAL_PERFORMER +# KAMAL_VERSION +# KAMAL_HOSTS +# KAMAL_ROLE (if set) +# KAMAL_DESTINATION (if set) +# KAMAL_RUNTIME + +hosts = ENV["KAMAL_HOSTS"].split(",") +results = nil +max = 3 + +elapsed = Benchmark.realtime do + results = hosts.map do |host| + Thread.new do + tries = 1 + + begin + Socket.getaddrinfo(host, 0, Socket::AF_UNSPEC, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME) + rescue SocketError + if tries < max + puts "Retrying DNS warmup: #{host}" + tries += 1 + sleep rand + retry + else + puts "DNS warmup failed: #{host}" + host + end + end + + tries + end + end.map(&:value) +end + +retries = results.sum - hosts.size +nopes = results.count { |r| r == max } + +puts "Prewarmed %d DNS lookups in %.2f sec: %d retries, %d failures" % [ hosts.size, elapsed, retries, nopes ] diff --git a/.kamal/hooks/pre-deploy.sample b/.kamal/hooks/pre-deploy.sample new file mode 100755 index 0000000..1b280c7 --- /dev/null +++ b/.kamal/hooks/pre-deploy.sample @@ -0,0 +1,109 @@ +#!/usr/bin/env ruby + +# A sample pre-deploy hook +# +# Checks the Github status of the build, waiting for a pending build to complete for up to 720 seconds. +# +# Fails unless the combined status is "success" +# +# These environment variables are available: +# KAMAL_RECORDED_AT +# KAMAL_PERFORMER +# KAMAL_VERSION +# KAMAL_HOSTS +# KAMAL_COMMAND +# KAMAL_SUBCOMMAND +# KAMAL_ROLE (if set) +# KAMAL_DESTINATION (if set) + +# Only check the build status for production deployments +if ENV["KAMAL_COMMAND"] == "rollback" || ENV["KAMAL_DESTINATION"] != "production" + exit 0 +end + +require "bundler/inline" + +# true = install gems so this is fast on repeat invocations +gemfile(true, quiet: true) do + source "https://rubygems.org" + + gem "octokit" + gem "faraday-retry" +end + +MAX_ATTEMPTS = 72 +ATTEMPTS_GAP = 10 + +def exit_with_error(message) + $stderr.puts message + exit 1 +end + +class GithubStatusChecks + attr_reader :remote_url, :git_sha, :github_client, :combined_status + + def initialize + @remote_url = `git config --get remote.origin.url`.strip.delete_prefix("https://github.com/") + @git_sha = `git rev-parse HEAD`.strip + @github_client = Octokit::Client.new(access_token: ENV["GITHUB_TOKEN"]) + refresh! + end + + def refresh! + @combined_status = github_client.combined_status(remote_url, git_sha) + end + + def state + combined_status[:state] + end + + def first_status_url + first_status = combined_status[:statuses].find { |status| status[:state] == state } + first_status && first_status[:target_url] + end + + def complete_count + combined_status[:statuses].count { |status| status[:state] != "pending"} + end + + def total_count + combined_status[:statuses].count + end + + def current_status + if total_count > 0 + "Completed #{complete_count}/#{total_count} checks, see #{first_status_url} ..." + else + "Build not started..." + end + end +end + + +$stdout.sync = true + +puts "Checking build status..." +attempts = 0 +checks = GithubStatusChecks.new + +begin + loop do + case checks.state + when "success" + puts "Checks passed, see #{checks.first_status_url}" + exit 0 + when "failure" + exit_with_error "Checks failed, see #{checks.first_status_url}" + when "pending" + attempts += 1 + end + + exit_with_error "Checks are still pending, gave up after #{MAX_ATTEMPTS * ATTEMPTS_GAP} seconds" if attempts == MAX_ATTEMPTS + + puts checks.current_status + sleep(ATTEMPTS_GAP) + checks.refresh! + end +rescue Octokit::NotFound + exit_with_error "Build status could not be found" +end diff --git a/.kamal/hooks/pre-proxy-reboot.sample b/.kamal/hooks/pre-proxy-reboot.sample new file mode 100755 index 0000000..061f805 --- /dev/null +++ b/.kamal/hooks/pre-proxy-reboot.sample @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "Rebooting kamal-proxy on $KAMAL_HOSTS..." diff --git a/.kamal/secrets b/.kamal/secrets new file mode 100644 index 0000000..9a771a3 --- /dev/null +++ b/.kamal/secrets @@ -0,0 +1,17 @@ +# Secrets defined here are available for reference under registry/password, env/secret, builder/secrets, +# and accessories/*/env/secret in config/deploy.yml. All secrets should be pulled from either +# password manager, ENV, or a file. DO NOT ENTER RAW CREDENTIALS HERE! This file needs to be safe for git. + +# Example of extracting secrets from 1password (or another compatible pw manager) +# SECRETS=$(kamal secrets fetch --adapter 1password --account your-account --from Vault/Item KAMAL_REGISTRY_PASSWORD RAILS_MASTER_KEY) +# KAMAL_REGISTRY_PASSWORD=$(kamal secrets extract KAMAL_REGISTRY_PASSWORD ${SECRETS}) +# RAILS_MASTER_KEY=$(kamal secrets extract RAILS_MASTER_KEY ${SECRETS}) + +# Use a GITHUB_TOKEN if private repositories are needed for the image +# GITHUB_TOKEN=$(gh config get -h github.com oauth_token) + +# Grab the registry password from ENV +KAMAL_REGISTRY_PASSWORD=$KAMAL_REGISTRY_PASSWORD + +# Improve security by using a password manager. Never check config/master.key into git! +RAILS_MASTER_KEY=$(cat config/master.key) diff --git a/.node-version b/.node-version new file mode 100644 index 0000000..7d7a070 --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +23.10.0 diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..10d237a --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,32 @@ +# Omakase Ruby styling for Rails +inherit_gem: { rubocop-rails-omakase: rubocop.yml } + +# Overwrite or add rules to create your own house style +# +# # Use `[a, [b, c]]` not `[ a, [ b, c ] ]` +# Layout/SpaceInsideArrayLiteralBrackets: +# Enabled: false + +inherit_from: + - ./.rubocop_bundler.yml + - ./.rubocop_gemspec.yml + - ./.rubocop_layout.yml + - ./.rubocop_lint.yml + - ./.rubocop_metrics.yml + - ./.rubocop_migration.yml + - ./.rubocop_naming.yml + - ./.rubocop_performance.yml + - ./.rubocop_rails.yml + - ./.rubocop_security.yml + - ./.rubocop_style.yml + +AllCops: + Exclude: + - 'test/**/*' + - 'db/seeds.rb' + +require: + - .rubocop_custom_layout_space_inside_percent_literal_brackets + +Layout/SpaceInsidePercentLiteralBrackets: + Enabled: true diff --git a/.rubocop_bundler.yml b/.rubocop_bundler.yml new file mode 100644 index 0000000..48133ff --- /dev/null +++ b/.rubocop_bundler.yml @@ -0,0 +1,89 @@ +# Department 'Bundler' (7): 수정 +Bundler/DuplicatedGem: + Description: Checks for duplicate gem entries in Gemfile. + Enabled: false + Severity: warning + VersionAdded: '0.46' + VersionChanged: '1.40' + Include: + - "**/*.gemfile" + - "**/Gemfile" + - "**/gems.rb" + +Bundler/DuplicatedGroup: + Description: Checks for duplicate group entries in Gemfile. + Enabled: true + Severity: warning + VersionAdded: '1.56' + Include: + - "**/*.gemfile" + - "**/Gemfile" + - "**/gems.rb" + +Bundler/GemComment: + Description: Add a comment describing each gem. + Enabled: false + VersionAdded: '0.59' + VersionChanged: '0.85' + Include: + - "**/*.gemfile" + - "**/Gemfile" + - "**/gems.rb" + IgnoredGems: [] + OnlyFor: [] + +Bundler/GemFilename: + Description: Enforces the filename for managing gems. + Enabled: false + VersionAdded: '1.20' + EnforcedStyle: Gemfile + SupportedStyles: + - Gemfile + - gems.rb + Include: + - "**/Gemfile" + - "**/gems.rb" + - "**/Gemfile.lock" + - "**/gems.locked" + +Bundler/GemVersion: + Description: Requires or forbids specifying gem versions. + Enabled: false + VersionAdded: '1.14' + EnforcedStyle: required + SupportedStyles: + - required + - forbidden + Include: + - "**/*.gemfile" + - "**/Gemfile" + - "**/gems.rb" + AllowedGems: [] + +# Supports --autocorrect +Bundler/InsecureProtocolSource: + Description: The source `:gemcutter`, `:rubygems` and `:rubyforge` are deprecated + because HTTP requests are insecure. Please change your source to 'https://rubygems.org' + if possible, or 'http://rubygems.org' if not. + Enabled: false + Severity: warning + VersionAdded: '0.50' + VersionChanged: '1.40' + AllowHttpProtocol: true + Include: + - "**/*.gemfile" + - "**/Gemfile" + - "**/gems.rb" + +# Supports --autocorrect +Bundler/OrderedGems: + Description: Gems within groups in the Gemfile should be alphabetically sorted. + Enabled: true + VersionAdded: '0.46' + VersionChanged: '0.47' + TreatCommentsAsGroupSeparators: true + ConsiderPunctuation: false + Include: + - "**/*.gemfile" + - "**/Gemfile" + - "**/gems.rb" \ No newline at end of file diff --git a/.rubocop_custom_layout_space_inside_percent_literal_brackets.rb b/.rubocop_custom_layout_space_inside_percent_literal_brackets.rb new file mode 100644 index 0000000..304c31e --- /dev/null +++ b/.rubocop_custom_layout_space_inside_percent_literal_brackets.rb @@ -0,0 +1,22 @@ +module RuboCop + module Cop + module Layout + class SpaceInsidePercentLiteralBrackets < Base + MSG = 'Use spaces inside `%w[ first second ]`.' + + def on_array(node) + return unless node.percent_literal? && node.loc.expression.source =~ /^%w\[(.+)\]$/ + + space_inside = node.loc.expression.source =~ /\[%s+/ + add_offense(node, message: MSG) unless space_inside + end + + def autocorrect(node) + lambda do |corrector| + corrector.replace(node.loc.expression, node.loc.expression.source.gsub('%w[', '%w[ ').gsub(']', ' ]')) + end + end + end + end + end +end diff --git a/.rubocop_gemspec.yml b/.rubocop_gemspec.yml new file mode 100644 index 0000000..31e15b5 --- /dev/null +++ b/.rubocop_gemspec.yml @@ -0,0 +1,102 @@ +# Department 'Gemspec' (9): 미수정 +# Supports --autocorrect +Gemspec/AddRuntimeDependency: + Description: Prefer `add_dependency` over `add_runtime_dependency`. + StyleGuide: "#add_dependency_vs_add_runtime_dependency" + Reference: https://github.com/rubygems/rubygems/issues/7799#issuecomment-2192720316 + Enabled: false + VersionAdded: '1.65' + Include: + - "**/*.gemspec" + +Gemspec/DependencyVersion: + Description: Requires or forbids specifying gem dependency versions. + Enabled: false + VersionAdded: '1.29' + EnforcedStyle: required + SupportedStyles: + - required + - forbidden + Include: + - "**/*.gemspec" + AllowedGems: [] + +# Supports --autocorrect +Gemspec/DeprecatedAttributeAssignment: + Description: Checks that deprecated attribute assignments are not set in a gemspec + file. + Enabled: false + Severity: warning + VersionAdded: '1.30' + VersionChanged: '1.40' + Include: + - "**/*.gemspec" + +Gemspec/DevelopmentDependencies: + Description: Checks that development dependencies are specified in Gemfile rather + than gemspec. + Enabled: false + VersionAdded: '1.44' + EnforcedStyle: Gemfile + SupportedStyles: + - Gemfile + - gems.rb + - gemspec + AllowedGems: [] + Include: + - "**/*.gemspec" + - "**/Gemfile" + - "**/gems.rb" + +Gemspec/DuplicatedAssignment: + Description: An attribute assignment method calls should be listed only once in a + gemspec. + Enabled: false + Severity: warning + VersionAdded: '0.52' + VersionChanged: '1.40' + Include: + - "**/*.gemspec" + +# Supports --autocorrect +Gemspec/OrderedDependencies: + Description: Dependencies in the gemspec should be alphabetically sorted. + Enabled: false + VersionAdded: '0.51' + TreatCommentsAsGroupSeparators: true + ConsiderPunctuation: false + Include: + - "**/*.gemspec" + +# Supports --autocorrect +Gemspec/RequireMFA: + Description: Checks that the gemspec has metadata to require Multi-Factor Authentication + from RubyGems. + Enabled: false + Severity: warning + VersionAdded: '1.23' + VersionChanged: '1.40' + Reference: + - https://guides.rubygems.org/mfa-requirement-opt-in/ + Include: + - "**/*.gemspec" + +Gemspec/RequiredRubyVersion: + Description: Checks that `required_ruby_version` of gemspec is specified and equal + to `TargetRubyVersion` of .rubocop.yml. + Enabled: false + Severity: warning + VersionAdded: '0.52' + VersionChanged: '1.40' + Include: + - "**/*.gemspec" + +Gemspec/RubyVersionGlobalsUsage: + Description: Checks usage of RUBY_VERSION in gemspec. + StyleGuide: "#no-ruby-version-in-the-gemspec" + Enabled: false + Severity: warning + VersionAdded: '0.72' + VersionChanged: '1.40' + Include: + - "**/*.gemspec" \ No newline at end of file diff --git a/.rubocop_layout.yml b/.rubocop_layout.yml new file mode 100644 index 0000000..ef9cbc7 --- /dev/null +++ b/.rubocop_layout.yml @@ -0,0 +1,1009 @@ +# Department 'Layout' (99): 수정 +# Supports --autocorrect +Layout/AccessModifierIndentation: + Description: Check indentation of private/protected visibility modifiers. + StyleGuide: "#indent-public-private-protected" + Enabled: true + VersionAdded: '0.49' + EnforcedStyle: indent + SupportedStyles: + - outdent + - indent + IndentationWidth: + +# Supports --autocorrect +Layout/ArgumentAlignment: + Description: Align the arguments of a method call if they span more than one line. + StyleGuide: "#no-double-indent" + Enabled: true + VersionAdded: '0.68' + VersionChanged: '0.77' + EnforcedStyle: with_first_argument + SupportedStyles: + - with_first_argument + - with_fixed_indentation + IndentationWidth: + +# Supports --autocorrect +Layout/ArrayAlignment: + Description: Align the elements of an array literal if they span more than one line. + StyleGuide: "#no-double-indent" + Enabled: true + VersionAdded: '0.49' + VersionChanged: '0.77' + EnforcedStyle: with_first_element + SupportedStyles: + - with_first_element + - with_fixed_indentation + IndentationWidth: + +# Supports --autocorrect +Layout/AssignmentIndentation: + Description: Checks the indentation of the first line of the right-hand-side of a + multi-line assignment. + Enabled: true + VersionAdded: '0.49' + VersionChanged: '1.45' + IndentationWidth: + +# Supports --autocorrect +Layout/BeginEndAlignment: + Description: Align ends corresponding to begins correctly. + Enabled: true + VersionAdded: '0.91' + EnforcedStyleAlignWith: start_of_line + SupportedStylesAlignWith: + - start_of_line + - begin + Severity: warning + +# Supports --autocorrect +Layout/BlockAlignment: + Description: Align block ends correctly. + Enabled: true + VersionAdded: '0.53' + EnforcedStyleAlignWith: start_of_line + SupportedStylesAlignWith: + - either + - start_of_block + - start_of_line + +# Supports --autocorrect +Layout/BlockEndNewline: + Description: Put end statement of multiline block on its own line. + Enabled: true + VersionAdded: '0.49' + +# Supports --autocorrect +Layout/CaseIndentation: + Description: Indentation of when in a case/(when|in)/[else/]end. + StyleGuide: "#indent-when-to-case" + Enabled: true + VersionAdded: '0.49' + VersionChanged: '1.16' + EnforcedStyle: end + SupportedStyles: + - case + - end + IndentOneStep: false + IndentationWidth: + +# Supports --autocorrect +Layout/ClassStructure: + Description: Enforces a configured order of definitions within a class body. + StyleGuide: "#consistent-classes" + Enabled: false + SafeAutoCorrect: false + VersionAdded: '0.52' + VersionChanged: '1.53' + Categories: + module_inclusion: + - include + - prepend + - extend + ExpectedOrder: + - module_inclusion + - constants + - public_class_methods + - initializer + - public_methods + - protected_methods + - private_methods + +# Supports --autocorrect +Layout/ClosingHeredocIndentation: + Description: Checks the indentation of here document closings. + Enabled: true + VersionAdded: '0.57' + +# Supports --autocorrect +Layout/ClosingParenthesisIndentation: + Description: Checks the indentation of hanging closing parentheses. + Enabled: true + VersionAdded: '0.49' + +# Supports --autocorrect +Layout/CommentIndentation: + Description: Indentation of comments. + Enabled: true + AllowForAlignment: false + VersionAdded: '0.49' + VersionChanged: '1.24' + +# Supports --autocorrect +Layout/ConditionPosition: + Description: Checks for condition placed in a confusing position relative to the keyword. + StyleGuide: "#same-line-condition" + Enabled: true + VersionAdded: '0.53' + VersionChanged: '0.83' + +# Supports --autocorrect +Layout/DefEndAlignment: + Description: Align ends corresponding to defs correctly. + Enabled: true + VersionAdded: '0.53' + EnforcedStyleAlignWith: start_of_line + SupportedStylesAlignWith: + - start_of_line + - def + Severity: warning + +# Supports --autocorrect +Layout/DotPosition: + Description: Checks the position of the dot in multi-line method calls. + StyleGuide: "#consistent-multi-line-chains" + Enabled: true + VersionAdded: '0.49' + EnforcedStyle: leading + SupportedStyles: + - leading + - trailing + +# Supports --autocorrect +Layout/ElseAlignment: + Description: Align elses and elsifs correctly. + Enabled: true + VersionAdded: '0.49' + +# Supports --autocorrect +Layout/EmptyComment: + Description: Checks empty comment. + Enabled: true + AutoCorrect: contextual + VersionAdded: '0.53' + VersionChanged: '1.61' + AllowBorderComment: true + AllowMarginComment: true + +# Supports --autocorrect +Layout/EmptyLineAfterGuardClause: + Description: Add empty line after guard clause. + Enabled: false + VersionAdded: '0.56' + VersionChanged: '0.59' + +# Supports --autocorrect +Layout/EmptyLineAfterMagicComment: + Description: Add an empty line after magic comments to separate them from code. + StyleGuide: "#separate-magic-comments-from-code" + Enabled: true + VersionAdded: '0.49' + +# Supports --autocorrect +Layout/EmptyLineAfterMultilineCondition: + Description: Enforces empty line after multiline condition. + Enabled: true + VersionAdded: '0.90' + Reference: + - https://github.com/airbnb/ruby#multiline-if-newline + +# Supports --autocorrect +Layout/EmptyLineBetweenDefs: + Description: Use empty lines between class/module/method defs. + StyleGuide: "#empty-lines-between-methods" + Enabled: true + VersionAdded: '0.49' + VersionChanged: '1.23' + EmptyLineBetweenMethodDefs: true + EmptyLineBetweenClassDefs: true + EmptyLineBetweenModuleDefs: true + DefLikeMacros: [] + AllowAdjacentOneLineDefs: true + NumberOfEmptyLines: 1 + +# Supports --autocorrect +Layout/EmptyLines: + Description: Don't use several empty lines in a row. + StyleGuide: "#two-or-more-empty-lines" + Enabled: true + VersionAdded: '0.49' + +# Supports --autocorrect +Layout/EmptyLinesAroundAccessModifier: + Description: Keep blank lines around access modifiers. + StyleGuide: "#empty-lines-around-access-modifier" + Enabled: true + VersionAdded: '0.49' + EnforcedStyle: only_before + SupportedStyles: + - around + - only_before + Reference: + - https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions + +# Supports --autocorrect +Layout/EmptyLinesAroundArguments: + Description: Keeps track of empty lines around method arguments. + Enabled: true + VersionAdded: '0.52' + +# Supports --autocorrect +Layout/EmptyLinesAroundAttributeAccessor: + Description: Keep blank lines around attribute accessors. + StyleGuide: "#empty-lines-around-attribute-accessor" + Enabled: true + VersionAdded: '0.83' + VersionChanged: '0.84' + AllowAliasSyntax: true + AllowedMethods: + - alias_method + - public + - protected + - private + +# Supports --autocorrect +Layout/EmptyLinesAroundBeginBody: + Description: Keeps track of empty lines around begin-end bodies. + StyleGuide: "#empty-lines-around-bodies" + Enabled: true + VersionAdded: '0.49' + +# Supports --autocorrect +Layout/EmptyLinesAroundBlockBody: + Description: Keeps track of empty lines around block bodies. + StyleGuide: "#empty-lines-around-bodies" + Enabled: true + VersionAdded: '0.49' + EnforcedStyle: no_empty_lines + SupportedStyles: + - empty_lines + - no_empty_lines + +# Supports --autocorrect +Layout/EmptyLinesAroundClassBody: + Description: Keeps track of empty lines around class bodies. + StyleGuide: "#empty-lines-around-bodies" + Enabled: true + VersionAdded: '0.49' + VersionChanged: '0.53' + EnforcedStyle: no_empty_lines + SupportedStyles: + - empty_lines + - empty_lines_except_namespace + - empty_lines_special + - no_empty_lines + - beginning_only + - ending_only + +# Supports --autocorrect +Layout/EmptyLinesAroundExceptionHandlingKeywords: + Description: Keeps track of empty lines around exception handling keywords. + StyleGuide: "#empty-lines-around-bodies" + Enabled: true + VersionAdded: '0.49' + +# Supports --autocorrect +Layout/EmptyLinesAroundMethodBody: + Description: Keeps track of empty lines around method bodies. + StyleGuide: "#empty-lines-around-bodies" + Enabled: true + VersionAdded: '0.49' + +# Supports --autocorrect +Layout/EmptyLinesAroundModuleBody: + Description: Keeps track of empty lines around module bodies. + StyleGuide: "#empty-lines-around-bodies" + Enabled: true + VersionAdded: '0.49' + EnforcedStyle: no_empty_lines + SupportedStyles: + - empty_lines + - empty_lines_except_namespace + - empty_lines_special + - no_empty_lines + +# Supports --autocorrect +Layout/EndAlignment: + Description: Align ends correctly. + Enabled: true + VersionAdded: '0.53' + EnforcedStyleAlignWith: variable + SupportedStylesAlignWith: + - keyword + - variable + - start_of_line + Severity: warning + AutoCorrect: true + +Layout/EndOfLine: + Description: Use Unix-style line endings. + StyleGuide: "#crlf" + Enabled: true + VersionAdded: '0.49' + EnforcedStyle: native + SupportedStyles: + - native + - lf + - crlf + +# Supports --autocorrect +Layout/ExtraSpacing: + Description: Do not use unnecessary spacing. + Enabled: true + VersionAdded: '0.49' + AllowForAlignment: true + AllowBeforeTrailingComments: false + ForceEqualSignAlignment: false + +# Supports --autocorrect +Layout/FirstArgumentIndentation: + Description: Checks the indentation of the first argument in a method call. + Enabled: true + VersionAdded: '0.68' + VersionChanged: '0.77' + EnforcedStyle: special_for_inner_method_call_in_parentheses + SupportedStyles: + - consistent + - consistent_relative_to_receiver + - special_for_inner_method_call + - special_for_inner_method_call_in_parentheses + IndentationWidth: + +# Supports --autocorrect +Layout/FirstArrayElementIndentation: + Description: Checks the indentation of the first element in an array literal. + Enabled: true + VersionAdded: '0.68' + VersionChanged: '0.77' + EnforcedStyle: special_inside_parentheses + SupportedStyles: + - special_inside_parentheses + - consistent + - align_brackets + IndentationWidth: + +# Supports --autocorrect +Layout/FirstArrayElementLineBreak: + Description: Checks for a line break before the first element in a multi-line array. + Enabled: true + VersionAdded: '0.49' + AllowMultilineFinalElement: false + +# Supports --autocorrect +Layout/FirstHashElementIndentation: + Description: Checks the indentation of the first key in a hash literal. + Enabled: true + VersionAdded: '0.68' + VersionChanged: '0.77' + EnforcedStyle: consistent + SupportedStyles: + - special_inside_parentheses + - consistent + - align_braces + IndentationWidth: + +# Supports --autocorrect +Layout/FirstHashElementLineBreak: + Description: Checks for a line break before the first element in a multi-line hash. + Enabled: true + VersionAdded: '0.49' + AllowMultilineFinalElement: false + +# Supports --autocorrect +Layout/FirstMethodArgumentLineBreak: + Description: Checks for a line break before the first argument in a multi-line method + call. + Enabled: true + VersionAdded: '0.49' + AllowMultilineFinalElement: false + +# Supports --autocorrect +Layout/FirstMethodParameterLineBreak: + Description: Checks for a line break before the first parameter in a multi-line method + parameter definition. + Enabled: true + VersionAdded: '0.49' + AllowMultilineFinalElement: false + +# Supports --autocorrect +Layout/FirstParameterIndentation: + Description: Checks the indentation of the first parameter in a method definition. + Enabled: true + VersionAdded: '0.49' + VersionChanged: '0.77' + EnforcedStyle: consistent + SupportedStyles: + - consistent + - align_parentheses + IndentationWidth: + +# Supports --autocorrect +Layout/HashAlignment: + Description: Align the elements of a hash literal if they span more than one line. + Enabled: true + AllowMultipleStyles: true + VersionAdded: '0.49' + VersionChanged: '1.16' + EnforcedHashRocketStyle: table + SupportedHashRocketStyles: + - key + - separator + - table + EnforcedColonStyle: table + SupportedColonStyles: + - key + - separator + - table + EnforcedLastArgumentHashStyle: always_inspect + SupportedLastArgumentHashStyles: + - always_inspect + - always_ignore + - ignore_implicit + - ignore_explicit + +# Supports --autocorrect +Layout/HeredocArgumentClosingParenthesis: + Description: Checks for the placement of the closing parenthesis in a method call + that passes a HEREDOC string as an argument. + Enabled: true + StyleGuide: "#heredoc-argument-closing-parentheses" + VersionAdded: '0.68' + +# Supports --autocorrect +Layout/HeredocIndentation: + Description: Checks the indentation of the here document bodies. + StyleGuide: "#squiggly-heredocs" + Enabled: true + VersionAdded: '0.49' + VersionChanged: '0.85' + +# Supports --autocorrect +Layout/IndentationConsistency: + Description: Keep indentation straight. + StyleGuide: "#spaces-indentation" + Enabled: true + VersionAdded: '0.49' + EnforcedStyle: normal + SupportedStyles: + - normal + - indented_internal_methods + Reference: + - https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions + +# Supports --autocorrect +Layout/IndentationStyle: + Description: Consistent indentation either with tabs only or spaces only. + StyleGuide: "#spaces-indentation" + Enabled: true + VersionAdded: '0.49' + VersionChanged: '0.82' + IndentationWidth: + EnforcedStyle: spaces + SupportedStyles: + - spaces + - tabs + +# Supports --autocorrect +Layout/IndentationWidth: + Description: Use 2 spaces for indentation. + StyleGuide: "#spaces-indentation" + Enabled: true + VersionAdded: '0.49' + Width: 2 + AllowedPatterns: [] + +# Supports --autocorrect +Layout/InitialIndentation: + Description: Checks the indentation of the first non-blank non-comment line in a file. + Enabled: true + VersionAdded: '0.49' + +# Supports --autocorrect +Layout/LeadingCommentSpace: + Description: Comments should start with a space. + StyleGuide: "#hash-space" + Enabled: true + VersionAdded: '0.49' + VersionChanged: '0.73' + AllowDoxygenCommentStyle: false + AllowGemfileRubyComment: false + +# Supports --autocorrect +Layout/LeadingEmptyLines: + Description: Check for unnecessary blank lines at the beginning of a file. + Enabled: true + VersionAdded: '0.57' + VersionChanged: '0.77' + +# Supports --autocorrect +Layout/LineContinuationLeadingSpace: + Description: Use trailing spaces instead of leading spaces in strings broken over + multiple lines (by a backslash). + Enabled: true + VersionAdded: '1.31' + VersionChanged: '1.45' + EnforcedStyle: trailing + SupportedStyles: + - leading + - trailing + +# Supports --autocorrect +Layout/LineContinuationSpacing: + Description: Checks the spacing in front of backslash in line continuations. + Enabled: true + VersionAdded: '1.31' + EnforcedStyle: space + SupportedStyles: + - space + - no_space + +# Supports --autocorrect +Layout/LineEndStringConcatenationIndentation: + Description: Checks the indentation of the next line after a line that ends with a + string literal and a backslash. + Enabled: true + VersionAdded: '1.18' + EnforcedStyle: aligned + SupportedStyles: + - aligned + - indented + IndentationWidth: + +# Supports --autocorrect +Layout/LineLength: + Description: Checks that line length does not exceed the configured limit. + StyleGuide: "#max-line-length" + Enabled: true + VersionAdded: '0.25' + VersionChanged: '1.4' + Max: 200 + AllowHeredoc: true + AllowURI: true + URISchemes: + - http + - https + IgnoreCopDirectives: true + AllowedPatterns: ['^(\s*#)'] + +# Supports --autocorrect +Layout/MultilineArrayBraceLayout: + Description: Checks that the closing brace in an array literal is either on the same + line as the last array element, or a new line. + Enabled: true + VersionAdded: '0.49' + EnforcedStyle: new_line + SupportedStyles: + - symmetrical + - new_line + - same_line + +# Supports --autocorrect +Layout/MultilineArrayLineBreaks: + Description: Checks that each item in a multi-line array literal starts on a separate + line. + Enabled: true + VersionAdded: '0.67' + AllowMultilineFinalElement: false + +# Supports --autocorrect +Layout/MultilineAssignmentLayout: + Description: Check for a newline after the assignment operator in multi-line assignments. + StyleGuide: "#indent-conditional-assignment" + Enabled: true + VersionAdded: '0.49' + SupportedTypes: + - block + - case + - class + - if + - kwbegin + - module + EnforcedStyle: same_line + SupportedStyles: + - same_line + - new_line + +# Supports --autocorrect +Layout/MultilineBlockLayout: + Description: Ensures newlines after multiline block do statements. + Enabled: true + VersionAdded: '0.49' + +# Supports --autocorrect +Layout/MultilineHashBraceLayout: + Description: Checks that the closing brace in a hash literal is either on the same + line as the last hash element, or a new line. + Enabled: true + VersionAdded: '0.49' + EnforcedStyle: new_line + SupportedStyles: + - symmetrical + - new_line + - same_line + +# Supports --autocorrect +Layout/MultilineHashKeyLineBreaks: + Description: Checks that each item in a multi-line hash literal starts on a separate + line. + Enabled: true + VersionAdded: '0.67' + AllowMultilineFinalElement: false + +# Supports --autocorrect +Layout/MultilineMethodArgumentLineBreaks: + Description: Checks that each argument in a multi-line method call starts on a separate + line. + Enabled: true + VersionAdded: '0.67' + AllowMultilineFinalElement: false + +# Supports --autocorrect +Layout/MultilineMethodCallBraceLayout: + Description: Checks that the closing brace in a method call is either on the same + line as the last method argument, or a new line. + Enabled: true + VersionAdded: '0.49' + EnforcedStyle: new_line + SupportedStyles: + - symmetrical + - new_line + - same_line + +# Supports --autocorrect +Layout/MultilineMethodCallIndentation: + Description: Checks indentation of method calls with the dot operator that span more + than one line. + Enabled: true + VersionAdded: '0.49' + EnforcedStyle: aligned + SupportedStyles: + - aligned + - indented + - indented_relative_to_receiver + IndentationWidth: + +# Supports --autocorrect +Layout/MultilineMethodDefinitionBraceLayout: + Description: Checks that the closing brace in a method definition is either on the + same line as the last method parameter, or a new line. + Enabled: true + VersionAdded: '0.49' + EnforcedStyle: same_line + SupportedStyles: + - symmetrical + - new_line + - same_line + +# Supports --autocorrect +Layout/MultilineMethodParameterLineBreaks: + Description: Checks that each parameter in a multi-line method definition starts on + a separate line. + Enabled: true + VersionAdded: '1.32' + AllowMultilineFinalElement: false + +# Supports --autocorrect +Layout/MultilineOperationIndentation: + Description: Checks indentation of binary operations that span more than one line. + Enabled: true + VersionAdded: '0.49' + EnforcedStyle: aligned + SupportedStyles: + - aligned + - indented + IndentationWidth: + +# Supports --autocorrect +Layout/ParameterAlignment: + Description: Align the parameters of a method definition if they span more than one + line. + StyleGuide: "#no-double-indent" + Enabled: true + VersionAdded: '0.49' + VersionChanged: '0.77' + EnforcedStyle: with_first_parameter + SupportedStyles: + - with_first_parameter + - with_fixed_indentation + IndentationWidth: + +# Supports --autocorrect +Layout/RedundantLineBreak: + Description: Do not break up an expression into multiple lines when it fits on a single + line. + Enabled: false + InspectBlocks: false + VersionAdded: '1.13' + +# Supports --autocorrect +Layout/RescueEnsureAlignment: + Description: Align rescues and ensures correctly. + Enabled: true + VersionAdded: '0.49' + +# Supports --autocorrect +Layout/SingleLineBlockChain: + Description: Put method call on a separate line if chained to a single line block. + Enabled: true + VersionAdded: '1.14' + +# Supports --autocorrect +Layout/SpaceAfterColon: + Description: Use spaces after colons. + StyleGuide: "#spaces-operators" + Enabled: true + VersionAdded: '0.49' + +# Supports --autocorrect +Layout/SpaceAfterComma: + Description: Use spaces after commas. + StyleGuide: "#spaces-operators" + Enabled: true + VersionAdded: '0.49' + +# Supports --autocorrect +Layout/SpaceAfterMethodName: + Description: Do not put a space between a method name and the opening parenthesis + in a method definition. + StyleGuide: "#parens-no-spaces" + Enabled: true + VersionAdded: '0.49' + +# Supports --autocorrect +Layout/SpaceAfterNot: + Description: Tracks redundant space after the ! operator. + StyleGuide: "#no-space-bang" + Enabled: true + VersionAdded: '0.49' + +# Supports --autocorrect +Layout/SpaceAfterSemicolon: + Description: Use spaces after semicolons. + StyleGuide: "#spaces-operators" + Enabled: true + VersionAdded: '0.49' + +# Supports --autocorrect +Layout/SpaceAroundBlockParameters: + Description: Checks the spacing inside and after block parameters pipes. + Enabled: true + VersionAdded: '0.49' + EnforcedStyleInsidePipes: no_space + SupportedStylesInsidePipes: + - space + - no_space + +# Supports --autocorrect +Layout/SpaceAroundEqualsInParameterDefault: + Description: Checks that the equals signs in parameter default assignments have or + don't have surrounding space depending on configuration. + StyleGuide: "#spaces-around-equals" + Enabled: true + VersionAdded: '0.49' + EnforcedStyle: space + SupportedStyles: + - space + - no_space + +# Supports --autocorrect +Layout/SpaceAroundKeyword: + Description: Use a space around keywords if appropriate. + Enabled: true + VersionAdded: '0.49' + +# Supports --autocorrect +Layout/SpaceAroundMethodCallOperator: + Description: Checks method call operators to not have spaces around them. + Enabled: true + VersionAdded: '0.82' + +# Supports --autocorrect +Layout/SpaceAroundOperators: + Description: Use a single space around operators. + StyleGuide: "#spaces-operators" + Enabled: true + VersionAdded: '0.49' + AllowForAlignment: true + EnforcedStyleForExponentOperator: no_space + SupportedStylesForExponentOperator: + - space + - no_space + EnforcedStyleForRationalLiterals: no_space + SupportedStylesForRationalLiterals: + - space + - no_space + +# Supports --autocorrect +Layout/SpaceBeforeBlockBraces: + Description: Checks that the left block brace has or doesn't have space before it. + Enabled: true + VersionAdded: '0.49' + EnforcedStyle: space + SupportedStyles: + - space + - no_space + EnforcedStyleForEmptyBraces: space + SupportedStylesForEmptyBraces: + - space + - no_space + VersionChanged: '0.52' + +# Supports --autocorrect +Layout/SpaceBeforeBrackets: + Description: Checks for receiver with a space before the opening brackets. + StyleGuide: "#space-in-brackets-access" + Enabled: true + VersionAdded: '1.7' + +# Supports --autocorrect +Layout/SpaceBeforeComma: + Description: No spaces before commas. + Enabled: true + VersionAdded: '0.49' + +# Supports --autocorrect +Layout/SpaceBeforeComment: + Description: Checks for missing space between code and a comment on the same line. + Enabled: true + VersionAdded: '0.49' + +# Supports --autocorrect +Layout/SpaceBeforeFirstArg: + Description: Checks that exactly one space is used between a method name and the first + argument for method calls without parentheses. + Enabled: true + VersionAdded: '0.49' + AllowForAlignment: true + +# Supports --autocorrect +Layout/SpaceBeforeSemicolon: + Description: No spaces before semicolons. + Enabled: true + VersionAdded: '0.49' + +# Supports --autocorrect +Layout/SpaceInLambdaLiteral: + Description: Checks for spaces in lambda literals. + Enabled: true + VersionAdded: '0.49' + EnforcedStyle: require_no_space + SupportedStyles: + - require_no_space + - require_space + +# Supports --autocorrect +Layout/SpaceInsideArrayLiteralBrackets: + Description: Checks the spacing inside array literal brackets. + Enabled: true + VersionAdded: '0.52' + EnforcedStyle: space + SupportedStyles: + - space + - no_space + - compact + EnforcedStyleForEmptyBrackets: no_space + SupportedStylesForEmptyBrackets: + - space + - no_space + +# Supports --autocorrect +Layout/SpaceInsideArrayPercentLiteral: + Description: No unnecessary additional spaces between elements in %i/%w literals. + Enabled: true + VersionAdded: '0.49' + +# Supports --autocorrect +Layout/SpaceInsideBlockBraces: + Description: Checks that block braces have or don't have surrounding space. For blocks + taking parameters, checks that the left brace has or doesn't have trailing space. + Enabled: true + VersionAdded: '0.49' + EnforcedStyle: space + SupportedStyles: + - space + - no_space + EnforcedStyleForEmptyBraces: space + SupportedStylesForEmptyBraces: + - space + - no_space + SpaceBeforeBlockParameters: true + +# Supports --autocorrect +Layout/SpaceInsideHashLiteralBraces: + Description: Use spaces inside hash literal braces - or don't. + StyleGuide: "#spaces-braces" + Enabled: true + VersionAdded: '0.49' + EnforcedStyle: space + SupportedStyles: + - space + - no_space + - compact + EnforcedStyleForEmptyBraces: no_space + SupportedStylesForEmptyBraces: + - space + - no_space + +# Supports --autocorrect +Layout/SpaceInsideParens: + Description: No spaces after ( or before ). + StyleGuide: "#spaces-braces" + Enabled: true + VersionAdded: '0.49' + VersionChanged: '1.22' + EnforcedStyle: no_space + SupportedStyles: + - space + - compact + - no_space + +# Supports --autocorrect +Layout/SpaceInsidePercentLiteralDelimiters: + Description: No unnecessary spaces inside delimiters of %i/%w/%x literals. + Enabled: false + VersionAdded: '0.49' + +# Supports --autocorrect +Layout/SpaceInsideRangeLiteral: + Description: No spaces inside range literals. + StyleGuide: "#no-space-inside-range-literals" + Enabled: true + VersionAdded: '0.49' + +# Supports --autocorrect +Layout/SpaceInsideReferenceBrackets: + Description: Checks the spacing inside referential brackets. + Enabled: true + VersionAdded: '0.52' + VersionChanged: '0.53' + EnforcedStyle: no_space + SupportedStyles: + - space + - no_space + EnforcedStyleForEmptyBrackets: no_space + SupportedStylesForEmptyBrackets: + - space + - no_space + +# Supports --autocorrect +Layout/SpaceInsideStringInterpolation: + Description: Checks for padding/surrounding spaces inside string interpolation. + StyleGuide: "#string-interpolation" + Enabled: true + VersionAdded: '0.49' + EnforcedStyle: no_space + SupportedStyles: + - space + - no_space + +# Supports --autocorrect +Layout/TrailingEmptyLines: + Description: Checks trailing blank lines and final newline. + StyleGuide: "#newline-eof" + Enabled: true + VersionAdded: '0.49' + VersionChanged: '0.77' + EnforcedStyle: final_newline + SupportedStyles: + - final_newline + - final_blank_line + +# Supports --autocorrect +Layout/TrailingWhitespace: + Description: Avoid trailing whitespace. + StyleGuide: "#no-trailing-whitespace" + Enabled: true + VersionAdded: '0.49' + VersionChanged: '1.0' + AllowInHeredoc: false \ No newline at end of file diff --git a/.rubocop_lint.yml b/.rubocop_lint.yml new file mode 100644 index 0000000..1d02bd3 --- /dev/null +++ b/.rubocop_lint.yml @@ -0,0 +1,1079 @@ +# Department 'Lint' (138): 수정 +Lint/AmbiguousAssignment: + Description: Checks for mistyped shorthand assignments. + Enabled: true + VersionAdded: '1.7' + +# Supports --autocorrect +Lint/AmbiguousBlockAssociation: + Description: Checks for ambiguous block association with method when param passed + without parentheses. + Enabled: true + VersionAdded: '0.48' + VersionChanged: '1.13' + AllowedMethods: [] + AllowedPatterns: [] + +# Supports --autocorrect +Lint/AmbiguousOperator: + Description: Checks for ambiguous operators in the first argument of a method invocation + without parentheses. + StyleGuide: "#method-invocation-parens" + Enabled: true + VersionAdded: '0.17' + VersionChanged: '0.83' + +# Supports --autocorrect +Lint/AmbiguousOperatorPrecedence: + Description: Checks for expressions containing multiple binary operations with ambiguous + precedence. + Enabled: true + VersionAdded: '1.21' + +# Supports --autocorrect +Lint/AmbiguousRange: + Description: Checks for ranges with ambiguous boundaries. + Enabled: true + VersionAdded: '1.19' + SafeAutoCorrect: false + RequireParenthesesForMethodChains: false + +# Supports --autocorrect +Lint/AmbiguousRegexpLiteral: + Description: Checks for ambiguous regexp literals in the first argument of a method + invocation without parentheses. + Enabled: true + VersionAdded: '0.17' + VersionChanged: '0.83' + +# Supports --autocorrect +Lint/AssignmentInCondition: + Description: Don't use assignment in conditions. + StyleGuide: "#safe-assignment-in-condition" + Enabled: true + SafeAutoCorrect: false + VersionAdded: '0.9' + VersionChanged: '1.45' + AllowSafeAssignment: true + +# Supports --autocorrect +Lint/BigDecimalNew: + Description: "`BigDecimal.new()` is deprecated. Use `BigDecimal()` instead." + Enabled: true + VersionAdded: '0.53' + +Lint/BinaryOperatorWithIdenticalOperands: + Description: Checks for places where binary operator has identical operands. + Enabled: true + Safe: false + VersionAdded: '0.89' + VersionChanged: '1.7' + +# Supports --autocorrect +Lint/BooleanSymbol: + Description: Check for `:true` and `:false` symbols. + Enabled: true + SafeAutoCorrect: false + VersionAdded: '0.50' + VersionChanged: '1.22' + +Lint/CircularArgumentReference: + Description: Default values in optional keyword arguments and optional ordinal arguments + should not refer back to the name of the argument. + Enabled: true + VersionAdded: '0.33' + +Lint/ConstantDefinitionInBlock: + Description: Do not define constants within a block. + StyleGuide: "#no-constant-definition-in-block" + Enabled: true + VersionAdded: '0.91' + VersionChanged: '1.3' + AllowedMethods: + - enums + +# Supports --autocorrect +Lint/ConstantOverwrittenInRescue: + Description: Checks for overwriting an exception with an exception result by use `rescue + =>`. + Enabled: true + VersionAdded: '1.31' + +Lint/ConstantResolution: + Description: Check that constants are fully qualified with `::`. + Enabled: false + VersionAdded: '0.86' + Only: [] + Ignore: [] + +Lint/Debugger: + Description: Check for debugger calls. + Enabled: true + VersionAdded: '0.14' + VersionChanged: '1.63' + DebuggerMethods: + Kernel: + - binding.irb + - Kernel.binding.irb + Byebug: + - byebug + - remote_byebug + - Kernel.byebug + - Kernel.remote_byebug + Capybara: + - page.save_and_open_page + - page.save_and_open_screenshot + - page.save_page + - page.save_screenshot + - save_and_open_page + - save_and_open_screenshot + - save_page + - save_screenshot + debug.rb: + - binding.b + - binding.break + - Kernel.binding.b + - Kernel.binding.break + Pry: + - binding.pry + - binding.remote_pry + - binding.pry_remote + - Kernel.binding.pry + - Kernel.binding.remote_pry + - Kernel.binding.pry_remote + - Pry.rescue + - pry + Rails: + - debugger + - Kernel.debugger + RubyJard: + - jard + WebConsole: + - binding.console + DebuggerRequires: + debug.rb: + - debug/open + - debug/start + +# Supports --autocorrect +Lint/DeprecatedClassMethods: + Description: Check for deprecated class method calls. + Enabled: true + VersionAdded: '0.19' + +# Supports --autocorrect +Lint/DeprecatedConstants: + Description: Checks for deprecated constants. + Enabled: true + VersionAdded: '1.8' + VersionChanged: '1.40' + DeprecatedConstants: + NIL: + Alternative: nil + DeprecatedVersion: '2.4' + 'TRUE': + Alternative: 'true' + DeprecatedVersion: '2.4' + 'FALSE': + Alternative: 'false' + DeprecatedVersion: '2.4' + Net::HTTPServerException: + Alternative: Net::HTTPClientException + DeprecatedVersion: '2.6' + Random::DEFAULT: + Alternative: Random.new + DeprecatedVersion: '3.0' + Struct::Group: + Alternative: Etc::Group + DeprecatedVersion: '3.0' + Struct::Passwd: + Alternative: Etc::Passwd + DeprecatedVersion: '3.0' + +# Supports --autocorrect +Lint/DeprecatedOpenSSLConstant: + Description: Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`. + Enabled: true + VersionAdded: '0.84' + +# Supports --autocorrect +Lint/DisjunctiveAssignmentInConstructor: + Description: In constructor, plain assignment is preferred over disjunctive. + Enabled: true + Safe: false + VersionAdded: '0.62' + VersionChanged: '0.88' + +Lint/DuplicateBranch: + Description: Checks that there are no repeated bodies within `if/unless`, `case-when` + and `rescue` constructs. + Enabled: true + VersionAdded: '1.3' + VersionChanged: '1.7' + IgnoreLiteralBranches: false + IgnoreConstantBranches: false + +Lint/DuplicateCaseCondition: + Description: Do not repeat values in case conditionals. + Enabled: true + VersionAdded: '0.45' + +Lint/DuplicateElsifCondition: + Description: Do not repeat conditions used in if `elsif`. + Enabled: true + VersionAdded: '0.88' + +Lint/DuplicateHashKey: + Description: Check for duplicate keys in hash literals. + Enabled: true + VersionAdded: '0.34' + VersionChanged: '0.77' + +# Supports --autocorrect +Lint/DuplicateMagicComment: + Description: Check for duplicated magic comments. + Enabled: true + VersionAdded: '1.37' + +Lint/DuplicateMatchPattern: + Description: Do not repeat patterns in `in` keywords. + Enabled: true + VersionAdded: '1.50' + +Lint/DuplicateMethods: + Description: Check for duplicate method definitions. + Enabled: true + VersionAdded: '0.29' + +# Supports --autocorrect +Lint/DuplicateRegexpCharacterClassElement: + Description: Checks for duplicate elements in Regexp character classes. + Enabled: true + VersionAdded: '1.1' + +# Supports --autocorrect +Lint/DuplicateRequire: + Description: Check for duplicate `require`s and `require_relative`s. + Enabled: true + SafeAutoCorrect: false + VersionAdded: '0.90' + VersionChanged: '1.28' + +Lint/DuplicateRescueException: + Description: Checks that there are no repeated exceptions used in `rescue` expressions. + Enabled: true + VersionAdded: '0.89' + +Lint/EachWithObjectArgument: + Description: Check for immutable argument given to each_with_object. + Enabled: true + VersionAdded: '0.31' + +# Supports --autocorrect +Lint/ElseLayout: + Description: Check for odd code arrangement in an else block. + Enabled: true + VersionAdded: '0.17' + VersionChanged: '1.2' + +Lint/EmptyBlock: + Description: Checks for blocks without a body. + Enabled: true + VersionAdded: '1.1' + VersionChanged: '1.15' + AllowComments: true + AllowEmptyLambdas: true + +Lint/EmptyClass: + Description: Checks for classes and metaclasses without a body. + Enabled: true + VersionAdded: '1.3' + AllowComments: false + +# Supports --autocorrect +Lint/EmptyConditionalBody: + Description: Checks for the presence of `if`, `elsif` and `unless` branches without + a body. + Enabled: true + AutoCorrect: contextual + AllowComments: true + VersionAdded: '0.89' + VersionChanged: '1.61' + +# Supports --autocorrect +Lint/EmptyEnsure: + Description: Checks for empty ensure block. + Enabled: true + AutoCorrect: contextual + VersionAdded: '0.10' + VersionChanged: '1.61' + +Lint/EmptyExpression: + Description: Checks for empty expressions. + Enabled: true + VersionAdded: '0.45' + +Lint/EmptyFile: + Description: Enforces that Ruby source files are not empty. + Enabled: true + AllowComments: true + VersionAdded: '0.90' + +Lint/EmptyInPattern: + Description: Checks for the presence of `in` pattern branches without a body. + Enabled: true + AllowComments: true + VersionAdded: '1.16' + +# Supports --autocorrect +Lint/EmptyInterpolation: + Description: Checks for empty string interpolation. + Enabled: true + AutoCorrect: contextual + VersionAdded: '0.20' + VersionChanged: '1.61' + +Lint/EmptyWhen: + Description: Checks for `when` branches with empty bodies. + Enabled: true + AllowComments: true + VersionAdded: '0.45' + VersionChanged: '0.83' + +# Supports --autocorrect +Lint/EnsureReturn: + Description: Do not use return in an ensure block. + StyleGuide: "#no-return-ensure" + Enabled: true + VersionAdded: '0.9' + VersionChanged: '0.83' + +# Supports --autocorrect +Lint/ErbNewArguments: + Description: Use `:trim_mode` and `:eoutvar` keyword arguments to `ERB.new`. + Enabled: true + VersionAdded: '0.56' + +Lint/FlipFlop: + Description: Checks for flip-flops. + StyleGuide: "#no-flip-flops" + Enabled: true + VersionAdded: '0.16' + +Lint/FloatComparison: + Description: Checks for the presence of precise comparison of floating point numbers. + StyleGuide: "#float-comparison" + Enabled: true + VersionAdded: '0.89' + +Lint/FloatOutOfRange: + Description: Catches floating-point literals too large or small for Ruby to represent. + Enabled: true + VersionAdded: '0.36' + +Lint/FormatParameterMismatch: + Description: The number of parameters to format/sprint must match the fields. + Enabled: true + VersionAdded: '0.33' + +Lint/HashCompareByIdentity: + Description: Prefer using `Hash#compare_by_identity` than using `object_id` for keys. + StyleGuide: "#identity-comparison" + Enabled: true + Safe: false + VersionAdded: '0.93' + +# Supports --autocorrect +Lint/HeredocMethodCallPosition: + Description: Checks for the ordering of a method call where the receiver of the call + is a HEREDOC. + Enabled: true + StyleGuide: "#heredoc-method-calls" + VersionAdded: '0.68' + +# Supports --autocorrect +Lint/IdentityComparison: + Description: Prefer `equal?` over `==` when comparing `object_id`. + Enabled: true + StyleGuide: "#identity-comparison" + VersionAdded: '0.91' + +# Supports --autocorrect +Lint/ImplicitStringConcatenation: + Description: Checks for adjacent string literals on the same line, which could better + be represented as a single string literal. + Enabled: true + VersionAdded: '0.36' + +# Supports --autocorrect +Lint/IncompatibleIoSelectWithFiberScheduler: + Description: Checks for `IO.select` that is incompatible with Fiber Scheduler. + Enabled: true + SafeAutoCorrect: false + VersionAdded: '1.21' + VersionChanged: '1.24' + +Lint/IneffectiveAccessModifier: + Description: Checks for attempts to use `private` or `protected` to set the visibility + of a class method, which does not work. + Enabled: true + VersionAdded: '0.36' + +# Supports --autocorrect +Lint/InheritException: + Description: Avoid inheriting from the `Exception` class. + Enabled: true + SafeAutoCorrect: false + VersionAdded: '0.41' + VersionChanged: '1.26' + EnforcedStyle: standard_error + SupportedStyles: + - standard_error + - runtime_error + +# Supports --autocorrect +Lint/InterpolationCheck: + Description: Checks for interpolation in a single quoted string. + Enabled: true + SafeAutoCorrect: false + VersionAdded: '0.50' + VersionChanged: '1.40' + +Lint/ItWithoutArgumentsInBlock: + Description: Checks uses of `it` calls without arguments in block. + Reference: https://bugs.ruby-lang.org/issues/18980 + Enabled: true + VersionAdded: '1.59' + +# Supports --autocorrect +Lint/LambdaWithoutLiteralBlock: + Description: Checks uses of lambda without a literal block. + Enabled: true + VersionAdded: '1.8' + +Lint/LiteralAsCondition: + Description: Checks of literals used in conditions. + Enabled: true + VersionAdded: '0.51' + +Lint/LiteralAssignmentInCondition: + Description: Checks for literal assignments in the conditions. + Enabled: true + VersionAdded: '1.58' + +# Supports --autocorrect +Lint/LiteralInInterpolation: + Description: Checks for literals used in interpolation. + Enabled: true + VersionAdded: '0.19' + VersionChanged: '0.32' + +# Supports --autocorrect +Lint/Loop: + Description: Use Kernel#loop with break rather than begin/end/until or begin/end/while + for post-loop tests. + StyleGuide: "#loop-with-break" + Enabled: true + VersionAdded: '0.9' + VersionChanged: '1.3' + Safe: false + +Lint/MissingCopEnableDirective: + Description: Checks for a `# rubocop:enable` after `# rubocop:disable`. + Enabled: true + VersionAdded: '0.52' + MaximumRangeSize: .inf + +Lint/MissingSuper: + Description: Checks for the presence of constructors and lifecycle callbacks without + calls to `super`. + Enabled: true + AllowedParentClasses: [] + VersionAdded: '0.89' + VersionChanged: '1.4' + +# Supports --autocorrect +Lint/MixedCaseRange: + Description: Checks for mixed-case character ranges since they include likely unintended + characters. + Enabled: true + SafeAutoCorrect: false + VersionAdded: '1.53' + +Lint/MixedRegexpCaptureTypes: + Description: Do not mix named captures and numbered captures in a Regexp literal. + Enabled: true + VersionAdded: '0.85' + +# Supports --autocorrect +Lint/MultipleComparison: + Description: Use `&&` operator to compare multiple values. + Enabled: true + VersionAdded: '0.47' + VersionChanged: '1.1' + +Lint/NestedMethodDefinition: + Description: Do not use nested method definitions. + StyleGuide: "#no-nested-methods" + Enabled: true + AllowedMethods: [] + AllowedPatterns: [] + VersionAdded: '0.32' + +Lint/NestedPercentLiteral: + Description: Checks for nested percent literals. + Enabled: true + VersionAdded: '0.52' + +Lint/NextWithoutAccumulator: + Description: Do not omit the accumulator when calling `next` in a `reduce`/`inject` + block. + Enabled: true + VersionAdded: '0.36' + +Lint/NoReturnInBeginEndBlocks: + Description: Do not `return` inside `begin..end` blocks in assignment contexts. + Enabled: true + VersionAdded: '1.2' + +# Supports --autocorrect +Lint/NonAtomicFileOperation: + Description: Checks for non-atomic file operations. + StyleGuide: "#atomic-file-operations" + Enabled: true + VersionAdded: '1.31' + SafeAutoCorrect: false + +# Supports --autocorrect +Lint/NonDeterministicRequireOrder: + Description: Always sort arrays returned by Dir.glob when requiring files. + Enabled: true + VersionAdded: '0.78' + Safe: false + +Lint/NonLocalExitFromIterator: + Description: Do not use return in iterator to cause non-local exit. + Enabled: true + VersionAdded: '0.30' + +# Supports --autocorrect +Lint/NumberConversion: + Description: Checks unsafe usage of number conversion methods. + Enabled: false + VersionAdded: '0.53' + VersionChanged: '1.1' + SafeAutoCorrect: false + AllowedMethods: + - ago + - from_now + - second + - seconds + - minute + - minutes + - hour + - hours + - day + - days + - week + - weeks + - fortnight + - fortnights + - in_milliseconds + AllowedPatterns: [] + IgnoredClasses: + - Time + - DateTime + +Lint/NumberedParameterAssignment: + Description: Checks for uses of numbered parameter assignment. + Enabled: true + VersionAdded: '1.9' + +# Supports --autocorrect +Lint/OrAssignmentToConstant: + Description: Checks unintended or-assignment to constant. + Enabled: true + Safe: false + VersionAdded: '1.9' + +# Supports --autocorrect +Lint/OrderedMagicComments: + Description: Checks the proper ordering of magic comments and whether a magic comment + is not placed before a shebang. + Enabled: true + SafeAutoCorrect: false + VersionAdded: '0.53' + VersionChanged: '1.37' + +Lint/OutOfRangeRegexpRef: + Description: Checks for out of range reference for Regexp because it always returns + nil. + Enabled: true + Safe: false + VersionAdded: '0.89' + +# Supports --autocorrect +Lint/ParenthesesAsGroupedExpression: + Description: Checks for method calls with a space before the opening parenthesis. + StyleGuide: "#parens-no-spaces" + Enabled: true + VersionAdded: '0.12' + VersionChanged: '0.83' + +# Supports --autocorrect +Lint/PercentStringArray: + Description: Checks for unwanted commas and quotes in %w/%W literals. + Enabled: true + Safe: false + VersionAdded: '0.41' + +# Supports --autocorrect +Lint/PercentSymbolArray: + Description: Checks for unwanted commas and colons in %i/%I literals. + Enabled: true + VersionAdded: '0.41' + +# Supports --autocorrect +Lint/RaiseException: + Description: Checks for `raise` or `fail` statements which are raising `Exception` + class. + StyleGuide: "#raise-exception" + Enabled: true + Safe: false + VersionAdded: '0.81' + VersionChanged: '0.86' + AllowedImplicitNamespaces: + - Gem + +Lint/RandOne: + Description: Checks for `rand(1)` calls. Such calls always return `0` and most likely + a mistake. + Enabled: true + VersionAdded: '0.36' + +# Supports --autocorrect +Lint/RedundantCopDisableDirective: + Description: 'Checks for rubocop:disable comments that can be removed. Note: this + cop is not disabled when disabling all cops. It must be explicitly disabled.' + Enabled: true + VersionAdded: '0.76' + +# Supports --autocorrect +Lint/RedundantCopEnableDirective: + Description: Checks for rubocop:enable comments that can be removed. + Enabled: true + VersionAdded: '0.76' + +# Supports --autocorrect +Lint/RedundantDirGlobSort: + Description: Checks for redundant `sort` method to `Dir.glob` and `Dir[]`. + Enabled: true + VersionAdded: '1.8' + VersionChanged: '1.26' + SafeAutoCorrect: false + +# Supports --autocorrect +Lint/RedundantRegexpQuantifiers: + Description: Checks for redundant quantifiers in Regexps. + Enabled: true + VersionAdded: '1.53' + +# Supports --autocorrect +Lint/RedundantRequireStatement: + Description: Checks for unnecessary `require` statement. + Enabled: true + VersionAdded: '0.76' + VersionChanged: '1.57' + +# Supports --autocorrect +Lint/RedundantSafeNavigation: + Description: Checks for redundant safe navigation calls. + Enabled: true + VersionAdded: '0.93' + AllowedMethods: + - instance_of? + - kind_of? + - is_a? + - eql? + - respond_to? + - equal? + - presence + - present? + Safe: false + +# Supports --autocorrect +Lint/RedundantSplatExpansion: + Description: Checks for splat unnecessarily being called on literals. + Enabled: true + VersionAdded: '0.76' + VersionChanged: '1.7' + AllowPercentLiteralArrayArgument: true + +# Supports --autocorrect +Lint/RedundantStringCoercion: + Description: Checks for Object#to_s usage in string interpolation. + StyleGuide: "#no-to-s" + Enabled: true + VersionAdded: '0.19' + VersionChanged: '0.77' + +# Supports --autocorrect +Lint/RedundantWithIndex: + Description: Checks for redundant `with_index`. + Enabled: true + VersionAdded: '0.50' + +# Supports --autocorrect +Lint/RedundantWithObject: + Description: Checks for redundant `with_object`. + Enabled: true + VersionAdded: '0.51' + +Lint/RefinementImportMethods: + Description: Use `Refinement#import_methods` when using `include` or `prepend` in + `refine` block. + Enabled: true + SafeAutoCorrect: false + VersionAdded: '1.27' + +# Supports --autocorrect +Lint/RegexpAsCondition: + Description: Do not use regexp literal as a condition. The regexp literal matches + `$_` implicitly. + Enabled: true + VersionAdded: '0.51' + VersionChanged: '0.86' + +Lint/RequireParentheses: + Description: Use parentheses in the method call to avoid confusion about precedence. + Enabled: true + VersionAdded: '0.18' + +Lint/RequireRangeParentheses: + Description: Checks that a range literal is enclosed in parentheses when the end of + the range is at a line break. + Enabled: true + VersionAdded: '1.32' + +# Supports --autocorrect +Lint/RequireRelativeSelfPath: + Description: Checks for uses a file requiring itself with `require_relative`. + Enabled: true + VersionAdded: '1.22' + +Lint/RescueException: + Description: Avoid rescuing the Exception class. + StyleGuide: "#no-blind-rescues" + Enabled: true + VersionAdded: '0.9' + VersionChanged: '0.27' + +# Supports --autocorrect +Lint/RescueType: + Description: Avoid rescuing from non constants that could result in a `TypeError`. + Enabled: true + VersionAdded: '0.49' + +Lint/ReturnInVoidContext: + Description: Checks for return in void context. + Enabled: true + VersionAdded: '0.50' + +# Supports --autocorrect +Lint/SafeNavigationChain: + Description: Do not chain ordinary method call after safe navigation operator. + Enabled: true + VersionAdded: '0.47' + VersionChanged: '0.77' + AllowedMethods: + - present? + - blank? + - presence + - presence_in + - try + - try! + - in? + +# Supports --autocorrect +Lint/SafeNavigationConsistency: + Description: Check to make sure that if safe navigation is used for a method call + in an `&&` or `||` condition that safe navigation is used for all method calls on + that same object. + Enabled: true + VersionAdded: '0.55' + VersionChanged: '0.77' + AllowedMethods: + - present? + - blank? + - presence + - try + - try! + +# Supports --autocorrect +Lint/SafeNavigationWithEmpty: + Description: Avoid `foo&.empty?` in conditionals. + Enabled: true + VersionAdded: '0.62' + VersionChanged: '0.87' + +# Supports --autocorrect +Lint/ScriptPermission: + Description: Grant script file execute permission. + Enabled: true + VersionAdded: '0.49' + VersionChanged: '0.50' + +Lint/SelfAssignment: + Description: Checks for self-assignments. + Enabled: true + VersionAdded: '0.89' + +# Supports --autocorrect +Lint/SendWithMixinArgument: + Description: Checks for `send` method when using mixin. + Enabled: true + VersionAdded: '0.75' + +Lint/ShadowedArgument: + Description: Avoid reassigning arguments before they were used. + Enabled: true + VersionAdded: '0.52' + IgnoreImplicitReferences: false + +Lint/ShadowedException: + Description: Avoid rescuing a higher level exception before a lower level exception. + Enabled: true + VersionAdded: '0.41' + +Lint/ShadowingOuterLocalVariable: + Description: Do not use the same name as outer local variable for block arguments + or block local variables. + Enabled: true + VersionAdded: '0.9' + +Lint/StructNewOverride: + Description: Disallow overriding the `Struct` built-in methods via `Struct.new`. + Enabled: true + VersionAdded: '0.81' + +Lint/SuppressedException: + Description: Don't suppress exceptions. + StyleGuide: "#dont-hide-exceptions" + Enabled: true + AllowComments: true + AllowNil: true + VersionAdded: '0.9' + VersionChanged: '1.12' + +# Supports --autocorrect +Lint/SymbolConversion: + Description: Checks for unnecessary symbol conversions. + Enabled: true + VersionAdded: '1.9' + VersionChanged: '1.16' + EnforcedStyle: strict + SupportedStyles: + - strict + - consistent + +#Lint/Syntax: +# Description: Checks for syntax errors. +# Enabled: true +# VersionAdded: '0.9' + +Lint/ToEnumArguments: + Description: Ensures that `to_enum`/`enum_for`, called for the current method, has + correct arguments. + Enabled: true + VersionAdded: '1.1' + +# Supports --autocorrect +Lint/ToJSON: + Description: 'Ensure #to_json includes an optional argument.' + Enabled: true + VersionAdded: '0.66' + +# Supports --autocorrect +Lint/TopLevelReturnWithArgument: + Description: Detects top level return statements with argument. + Enabled: true + VersionAdded: '0.89' + Exclude: + - "/Users/rubyon/Desktop/liaf-rails/**/*.jb" + +# Supports --autocorrect +Lint/TrailingCommaInAttributeDeclaration: + Description: Checks for trailing commas in attribute declarations. + Enabled: true + AutoCorrect: contextual + VersionAdded: '0.90' + VersionChanged: '1.61' + +# Supports --autocorrect +Lint/TripleQuotes: + Description: Checks for useless triple quote constructs. + Enabled: true + VersionAdded: '1.9' + +Lint/UnderscorePrefixedVariableName: + Description: Do not use prefix `_` for a variable that is used. + Enabled: true + VersionAdded: '0.21' + AllowKeywordBlockArguments: false + +Lint/UnexpectedBlockArity: + Description: Looks for blocks that have fewer arguments that the calling method expects. + Enabled: true + Safe: false + VersionAdded: '1.5' + Methods: + chunk_while: 2 + each_with_index: 2 + each_with_object: 2 + inject: 2 + max: 2 + min: 2 + minmax: 2 + reduce: 2 + slice_when: 2 + sort: 2 + +# Supports --autocorrect +Lint/UnifiedInteger: + Description: Use Integer instead of Fixnum or Bignum. + Enabled: true + VersionAdded: '0.43' + +Lint/UnmodifiedReduceAccumulator: + Description: Checks for `reduce` or `inject` blocks that do not update the accumulator + each iteration. + Enabled: true + VersionAdded: '1.1' + VersionChanged: '1.5' + +Lint/UnreachableCode: + Description: Unreachable code. + Enabled: true + VersionAdded: '0.9' + +Lint/UnreachableLoop: + Description: Checks for loops that will have at most one iteration. + Enabled: true + VersionAdded: '0.89' + VersionChanged: '1.7' + AllowedPatterns: + - !ruby/regexp /(exactly|at_least|at_most)\(\d+\)\.times/ + +# Supports --autocorrect +Lint/UnusedBlockArgument: + Description: Checks for unused block arguments. + StyleGuide: "#underscore-unused-vars" + Enabled: true + AutoCorrect: contextual + VersionAdded: '0.21' + VersionChanged: '1.61' + IgnoreEmptyBlocks: true + AllowUnusedKeywordArguments: false + +# Supports --autocorrect +Lint/UnusedMethodArgument: + Description: Checks for unused method arguments. + StyleGuide: "#underscore-unused-vars" + Enabled: true + AutoCorrect: contextual + VersionAdded: '0.21' + VersionChanged: '1.61' + AllowUnusedKeywordArguments: false + IgnoreEmptyMethods: true + IgnoreNotImplementedMethods: true + +Lint/UriEscapeUnescape: + Description: "`URI.escape` method is obsolete and should not be used. Instead, use + `CGI.escape`, `URI.encode_www_form` or `URI.encode_www_form_component` depending + on your specific use case. Also `URI.unescape` method is obsolete and should not + be used. Instead, use `CGI.unescape`, `URI.decode_www_form` or `URI.decode_www_form_component` + depending on your specific use case." + Enabled: true + VersionAdded: '0.50' + +# Supports --autocorrect +Lint/UriRegexp: + Description: Use `URI::DEFAULT_PARSER.make_regexp` instead of `URI.regexp`. + Enabled: true + VersionAdded: '0.50' + +# Supports --autocorrect +Lint/UselessAccessModifier: + Description: Checks for useless access modifiers. + Enabled: true + AutoCorrect: contextual + VersionAdded: '0.20' + VersionChanged: '1.61' + ContextCreatingMethods: [] + MethodCreatingMethods: [] + +# Supports --autocorrect +Lint/UselessAssignment: + Description: Checks for useless assignment to a local variable. + StyleGuide: "#underscore-unused-vars" + Enabled: true + AutoCorrect: contextual + VersionAdded: '0.11' + VersionChanged: '1.66' + +Lint/UselessElseWithoutRescue: + Description: Checks for useless `else` in `begin..end` without `rescue`. + Enabled: true + VersionAdded: '0.17' + VersionChanged: '1.31' + +# Supports --autocorrect +Lint/UselessMethodDefinition: + Description: Checks for useless method definitions. + Enabled: true + AutoCorrect: contextual + VersionAdded: '0.90' + VersionChanged: '1.61' + Safe: false + +# Supports --autocorrect +Lint/UselessNumericOperation: + Description: Checks for useless numeric operations. + Enabled: true + VersionAdded: '1.66' + +Lint/UselessRescue: + Description: Checks for useless `rescue`s. + Enabled: true + VersionAdded: '1.43' + +Lint/UselessRuby2Keywords: + Description: Finds unnecessary uses of `ruby2_keywords`. + Enabled: true + VersionAdded: '1.23' + +# Supports --autocorrect +Lint/UselessSetterCall: + Description: Checks for useless setter call to a local variable. + Enabled: true + Safe: false + VersionAdded: '0.13' + VersionChanged: '1.2' + +# Supports --autocorrect +Lint/UselessTimes: + Description: Checks for useless `Integer#times` calls. + Enabled: true + Safe: false + AutoCorrect: contextual + VersionAdded: '0.91' + VersionChanged: '1.61' + +# Supports --autocorrect +Lint/Void: + Description: Possible use of operator/literal/variable in void context. + Enabled: true + AutoCorrect: contextual + VersionAdded: '0.9' + VersionChanged: '1.61' + CheckForMethodsWithNoSideEffects: false \ No newline at end of file diff --git a/.rubocop_metrics.yml b/.rubocop_metrics.yml new file mode 100644 index 0000000..14a91e7 --- /dev/null +++ b/.rubocop_metrics.yml @@ -0,0 +1,103 @@ +# Department 'Metrics' (10): 미수정 +Metrics/AbcSize: + Description: A calculated magnitude based on number of assignments, branches, and + conditions. + Reference: + - http://c2.com/cgi/wiki?AbcMetric + - https://en.wikipedia.org/wiki/ABC_Software_Metric + Enabled: false + VersionAdded: '0.27' + VersionChanged: '1.5' + AllowedMethods: [] + AllowedPatterns: [] + CountRepeatedAttributes: true + Max: 17 + +Metrics/BlockLength: + Description: Avoid long blocks with many lines. + Enabled: false + VersionAdded: '0.44' + VersionChanged: '1.5' + CountComments: false + Max: 25 + CountAsOne: [] + AllowedMethods: + - refine + AllowedPatterns: [] + Exclude: + - "/Users/rubyon/Desktop/liaf-rails/**/*.gemspec" + +Metrics/BlockNesting: + Description: Avoid excessive block nesting. + StyleGuide: "#three-is-the-number-thou-shalt-count" + Enabled: false + VersionAdded: '0.25' + VersionChanged: '1.65' + CountBlocks: false + CountModifierForms: false + Max: 3 + +Metrics/ClassLength: + Description: Avoid classes longer than 100 lines of code. + Enabled: false + VersionAdded: '0.25' + VersionChanged: '0.87' + CountComments: false + Max: 100 + CountAsOne: [] + +Metrics/CollectionLiteralLength: + Description: Checks for `Array` or `Hash` literals with many entries. + Enabled: false + VersionAdded: '1.47' + LengthThreshold: 250 + +Metrics/CyclomaticComplexity: + Description: A complexity metric that is strongly correlated to the number of test + cases needed to validate a method. + Enabled: false + VersionAdded: '0.25' + VersionChanged: '0.81' + AllowedMethods: [] + AllowedPatterns: [] + Max: 7 + +Metrics/MethodLength: + Description: Avoid methods longer than 10 lines of code. + StyleGuide: "#short-methods" + Enabled: false + VersionAdded: '0.25' + VersionChanged: '1.5' + CountComments: false + Max: 10 + CountAsOne: [] + AllowedMethods: [] + AllowedPatterns: [] + +Metrics/ModuleLength: + Description: Avoid modules longer than 100 lines of code. + Enabled: false + VersionAdded: '0.31' + VersionChanged: '0.87' + CountComments: false + Max: 100 + CountAsOne: [] + +Metrics/ParameterLists: + Description: Avoid parameter lists longer than three or four parameters. + StyleGuide: "#too-many-params" + Enabled: false + VersionAdded: '0.25' + VersionChanged: '1.5' + Max: 5 + CountKeywordArgs: true + MaxOptionalParameters: 3 + +Metrics/PerceivedComplexity: + Description: A complexity metric geared towards measuring complexity for a human reader. + Enabled: false + VersionAdded: '0.25' + VersionChanged: '0.81' + AllowedMethods: [] + AllowedPatterns: [] + Max: 8 \ No newline at end of file diff --git a/.rubocop_migration.yml b/.rubocop_migration.yml new file mode 100644 index 0000000..9e3a0b7 --- /dev/null +++ b/.rubocop_migration.yml @@ -0,0 +1,7 @@ +# Department 'Migration' (1): 수정 +# Supports --autocorrect +Migration/DepartmentName: + Description: Check that cop names in rubocop:disable (etc) comments are given with + department name. + Enabled: true + VersionAdded: '0.75' \ No newline at end of file diff --git a/.rubocop_minitest.yml b/.rubocop_minitest.yml new file mode 100644 index 0000000..27be4be --- /dev/null +++ b/.rubocop_minitest.yml @@ -0,0 +1,414 @@ +# Department 'Minitest' (55): 미수정 +# Supports --autocorrect +Minitest/AssertEmpty: + Description: This cop enforces the test to use `assert_empty` instead of using `assert(object.empty?)`. + StyleGuide: https://minitest.rubystyle.guide#assert-empty + Enabled: false + VersionAdded: '0.2' + +# Supports --autocorrect +Minitest/AssertEmptyLiteral: + Description: This cop enforces the test to use `assert_empty` instead of using `assert_equal([], + object)`. + Enabled: false + VersionAdded: '0.5' + VersionChanged: '0.11' + +# Supports --autocorrect +Minitest/AssertEqual: + Description: This cop enforces the test to use `assert_equal` instead of using `assert(expected + == actual)`. + StyleGuide: https://minitest.rubystyle.guide#assert-equal-arguments-order + Enabled: false + VersionAdded: '0.4' + +# Supports --autocorrect +Minitest/AssertInDelta: + Description: This cop enforces the test to use `assert_in_delta` instead of using + `assert_equal` to compare floats. + StyleGuide: https://minitest.rubystyle.guide/#assert-in-delta + Enabled: false + VersionAdded: '0.10' + +# Supports --autocorrect +Minitest/AssertIncludes: + Description: This cop enforces the test to use `assert_includes` instead of using + `assert(collection.include?(object))`. + StyleGuide: https://minitest.rubystyle.guide#assert-includes + Enabled: false + VersionAdded: '0.2' + +# Supports --autocorrect +Minitest/AssertInstanceOf: + Description: This cop enforces the test to use `assert_instance_of(Class, object)` + over `assert(object.instance_of?(Class))` + StyleGuide: https://minitest.rubystyle.guide#assert-instance-of + Enabled: false + VersionAdded: '0.4' + +# Supports --autocorrect +Minitest/AssertKindOf: + Description: This cop enforces the test to use `assert_kind_of(Class, object)` over + `assert(object.kind_of?(Class))` + StyleGuide: https://github.com/rubocop/minitest-style-guide#assert-kind-of + Enabled: false + VersionAdded: '0.10' + VersionChanged: '0.34' + +# Supports --autocorrect +Minitest/AssertMatch: + Description: This cop enforces the test to use `assert_match` instead of using `assert(matcher.match(object))`. + StyleGuide: https://minitest.rubystyle.guide#assert-match + Enabled: false + VersionAdded: '0.6' + +# Supports --autocorrect +Minitest/AssertNil: + Description: This cop enforces the test to use `assert_nil` instead of using `assert_equal(nil, + something)` or `assert(something.nil?)`. + StyleGuide: https://minitest.rubystyle.guide#assert-nil + Enabled: false + VersionAdded: '0.1' + +# Supports --autocorrect +Minitest/AssertOperator: + Description: This cop enforces the use of `assert_operator(expected, :<, actual)` + over `assert(expected < actual)`. + StyleGuide: https://minitest.rubystyle.guide#assert-operator + Enabled: false + VersionAdded: '0.32' + +Minitest/AssertOutput: + Description: This cop checks for opportunities to use `assert_output`. + StyleGuide: https://minitest.rubystyle.guide/#assert-output + Enabled: false + VersionAdded: '0.10' + +# Supports --autocorrect +Minitest/AssertPathExists: + Description: This cop enforces the test to use `assert_path_exists` instead of using + `assert(File.exist?(path))`. + StyleGuide: https://minitest.rubystyle.guide/#assert-path-exists + Enabled: false + VersionAdded: '0.10' + +# Supports --autocorrect +Minitest/AssertPredicate: + Description: This cop enforces the test to use `assert_predicate` instead of using + `assert(obj.a_predicate_method?)`. + StyleGuide: https://minitest.rubystyle.guide/#assert-predicate + Enabled: false + VersionAdded: '0.18' + +Minitest/AssertRaisesCompoundBody: + Description: This cop enforces the block body of `assert_raises { ... }` to be reduced + to only the raising code. + Enabled: false + VersionAdded: '0.21' + +Minitest/AssertRaisesWithRegexpArgument: + Description: This cop enforces checks for regular expression literals passed to `assert_raises`. + Enabled: false + Severity: warning + VersionAdded: '0.22' + VersionChanged: '0.26' + +# Supports --autocorrect +Minitest/AssertRespondTo: + Description: This cop enforces the test to use `assert_respond_to(object, :do_something)` + over `assert(object.respond_to?(:do_something))`. + StyleGuide: https://minitest.rubystyle.guide#assert-responds-to-method + Enabled: false + VersionAdded: '0.3' + +# Supports --autocorrect +Minitest/AssertSame: + Description: Enforces the use of `assert_same(expected, actual)` over `assert(expected.equal?(actual))`. + StyleGuide: https://minitest.rubystyle.guide#assert-same + Enabled: false + VersionAdded: '0.26' + +# Supports --autocorrect +Minitest/AssertSilent: + Description: This cop enforces the test to use `assert_silent { ... }` instead of + using `assert_output('', '') { ... }`. + StyleGuide: https://github.com/rubocop/minitest-style-guide#assert-silent + Enabled: false + VersionAdded: '0.10' + +# Supports --autocorrect +Minitest/AssertTruthy: + Description: This cop enforces the test to use `assert(actual)` instead of using `assert_equal(true, + actual)`. + StyleGuide: https://minitest.rubystyle.guide#assert-truthy + Enabled: false + Safe: false + VersionAdded: '0.2' + VersionChanged: '0.27' + +Minitest/AssertWithExpectedArgument: + Description: This cop tries to detect when a user accidentally used `assert` when + they meant to use `assert_equal`. + Enabled: false + Severity: warning + Safe: false + VersionAdded: '0.11' + VersionChanged: '0.26' + +Minitest/AssertionInLifecycleHook: + Description: This cop checks for usage of assertions in lifecycle hooks. + Enabled: false + VersionAdded: '0.10' + +Minitest/DuplicateTestRun: + Description: This cop detects duplicate test runs caused by one test class inheriting + from another. + StyleGuide: https://minitest.rubystyle.guide/#subclassing-test-cases + Enabled: false + VersionAdded: '0.19' + +# Supports --autocorrect +Minitest/EmptyLineBeforeAssertionMethods: + Description: Add empty line before assertion methods. + Enabled: false + VersionAdded: '0.23' + +# Supports --autocorrect +Minitest/Focus: + Description: Checks for focused tests. + Enabled: false + AutoCorrect: contextual + VersionAdded: '0.35' + +# Supports --autocorrect +Minitest/GlobalExpectations: + Description: This cop checks for deprecated global expectations. + StyleGuide: https://minitest.rubystyle.guide#global-expectations + Enabled: false + Severity: warning + EnforcedStyle: any + Include: + - "**/test/**/*" + - "**/*_test.rb" + - "**/spec/**/*" + - "**/*_spec.rb" + SupportedStyles: + - _ + - any + - expect + - value + VersionAdded: '0.7' + VersionChanged: '0.26' + +# Supports --autocorrect +Minitest/LifecycleHooksOrder: + Description: Checks that lifecycle hooks are declared in the order in which they will + be executed. + StyleGuide: https://minitest.rubystyle.guide/#hooks-ordering + Enabled: false + VersionAdded: '0.28' + +# Supports --autocorrect +Minitest/LiteralAsActualArgument: + Description: This cop enforces correct order of `expected` and `actual` arguments + for `assert_equal`. + StyleGuide: https://minitest.rubystyle.guide/#assert-equal-arguments-order + Enabled: false + VersionAdded: '0.10' + +Minitest/MultipleAssertions: + Description: This cop checks if test cases contain too many assertion calls. + Enabled: false + VersionAdded: '0.10' + Max: 3 + +Minitest/NoAssertions: + Description: This cop checks for at least one assertion (or flunk) in tests. + Enabled: false + VersionAdded: '0.12' + +Minitest/NoTestCases: + Description: Checks if test class contains any test cases. + Enabled: false + VersionAdded: '0.30' + +Minitest/NonExecutableTestMethod: + Description: Checks uses of test methods outside test class. + Enabled: false + Severity: warning + VersionAdded: '0.34' + +Minitest/NonPublicTestMethod: + Description: Detects non `public` (marked as `private` or `protected`) test methods. + Enabled: false + Severity: warning + VersionAdded: '0.27' + +# Supports --autocorrect +Minitest/RedundantMessageArgument: + Description: Detects redundant message argument in assertion methods. + Enabled: false + VersionAdded: '0.34' + +# Supports --autocorrect +Minitest/RefuteEmpty: + Description: This cop enforces to use `refute_empty` instead of using `refute(object.empty?)`. + StyleGuide: https://minitest.rubystyle.guide#refute-empty + Enabled: false + VersionAdded: '0.3' + +# Supports --autocorrect +Minitest/RefuteEqual: + Description: Check if your test uses `refute_equal` instead of `assert(expected != + object)` or `assert(! expected == object))`. + StyleGuide: https://minitest.rubystyle.guide#refute-equal + Enabled: false + VersionAdded: '0.3' + +# Supports --autocorrect +Minitest/RefuteFalse: + Description: Check if your test uses `refute(actual)` instead of `assert_equal(false, + actual)`. + StyleGuide: https://minitest.rubystyle.guide#refute-false + Enabled: false + Safe: false + VersionAdded: '0.3' + VersionChanged: '0.27' + +# Supports --autocorrect +Minitest/RefuteInDelta: + Description: This cop enforces the test to use `refute_in_delta` instead of using + `refute_equal` to compare floats. + StyleGuide: https://minitest.rubystyle.guide/#refute-in-delta + Enabled: false + VersionAdded: '0.10' + +# Supports --autocorrect +Minitest/RefuteIncludes: + Description: This cop enforces the test to use `refute_includes` instead of using + `refute(collection.include?(object))`. + StyleGuide: https://minitest.rubystyle.guide#refute-includes + Enabled: false + VersionAdded: '0.3' + +# Supports --autocorrect +Minitest/RefuteInstanceOf: + Description: This cop enforces the test to use `refute_instance_of(Class, object)` + over `refute(object.instance_of?(Class))`. + StyleGuide: https://minitest.rubystyle.guide#refute-instance-of + Enabled: false + VersionAdded: '0.4' + +# Supports --autocorrect +Minitest/RefuteKindOf: + Description: This cop enforces the test to use `refute_kind_of(Class, object)` over + `refute(object.kind_of?(Class))`. + StyleGuide: https://github.com/rubocop/minitest-style-guide#refute-kind-of + Enabled: false + VersionAdded: '0.10' + VersionChanged: '0.34' + +# Supports --autocorrect +Minitest/RefuteMatch: + Description: This cop enforces the test to use `refute_match` instead of using `refute(matcher.match(object))`. + StyleGuide: https://minitest.rubystyle.guide#refute-match + Enabled: false + VersionAdded: '0.6' + +# Supports --autocorrect +Minitest/RefuteNil: + Description: This cop enforces the test to use `refute_nil` instead of using `refute_equal(nil, + something)` or `refute(something.nil?)`. + StyleGuide: https://minitest.rubystyle.guide#refute-nil + Enabled: false + VersionAdded: '0.2' + +# Supports --autocorrect +Minitest/RefuteOperator: + Description: This cop enforces the use of `refute_operator(expected, :<, actual)` + over `refute(expected < actual)`. + StyleGuide: https://minitest.rubystyle.guide#refute-operator + Enabled: false + VersionAdded: '0.32' + +# Supports --autocorrect +Minitest/RefutePathExists: + Description: This cop enforces the test to use `refute_path_exists` instead of using + `refute(File.exist?(path))`. + StyleGuide: https://minitest.rubystyle.guide/#refute-path-exists + Enabled: false + VersionAdded: '0.10' + +# Supports --autocorrect +Minitest/RefutePredicate: + Description: This cop enforces the test to use `refute_predicate` instead of using + `refute(obj.a_predicate_method?)`. + StyleGuide: https://minitest.rubystyle.guide/#refute-predicate + Enabled: false + VersionAdded: '0.18' + +# Supports --autocorrect +Minitest/RefuteRespondTo: + Description: This cop enforces the test to use `refute_respond_to(object, :do_something)` + over `refute(object.respond_to?(:do_something))`. + StyleGuide: https://minitest.rubystyle.guide#refute-respond-to + Enabled: false + VersionAdded: '0.4' + +# Supports --autocorrect +Minitest/RefuteSame: + Description: Enforces the use of `refute_same(expected, actual)` over `refute(expected.equal?(actual))`. + StyleGuide: https://minitest.rubystyle.guide#refute-same + Enabled: false + VersionAdded: '0.26' + +# Supports --autocorrect +Minitest/ReturnInTestMethod: + Description: Enforces the use of `skip` instead of `return` in test methods. + StyleGuide: https://minitest.rubystyle.guide/#skipping-runnable-methods + Enabled: false + VersionAdded: '0.31' + +Minitest/SkipEnsure: + Description: Checks that `ensure` call even if `skip`. + Enabled: false + Severity: warning + VersionAdded: '0.20' + VersionChanged: '0.26' + +Minitest/SkipWithoutReason: + Description: Checks for skipped tests missing the skipping reason. + Enabled: false + VersionAdded: '0.24' + +Minitest/TestFileName: + Description: Checks if test file names start with `test_` or end with `_test.rb`. + StyleGuide: https://minitest.rubystyle.guide/#file-naming + Enabled: false + VersionAdded: '0.26' + +# Supports --autocorrect +Minitest/TestMethodName: + Description: This cop enforces that test method names start with `test_` prefix. + Enabled: false + VersionAdded: '0.10' + +Minitest/UnreachableAssertion: + Description: This cop checks for an `assert_raises` block containing any unreachable + assertions. + Enabled: false + Severity: warning + VersionAdded: '0.14' + VersionChanged: '0.26' + +Minitest/UnspecifiedException: + Description: This cop checks for a specified error in `assert_raises`. + StyleGuide: https://minitest.rubystyle.guide#unspecified-exception + Enabled: false + VersionAdded: '0.10' + +Minitest/UselessAssertion: + Description: Detects useless assertions (assertions that either always pass or always + fail). + Enabled: false + VersionAdded: '0.26' \ No newline at end of file diff --git a/.rubocop_naming.yml b/.rubocop_naming.yml new file mode 100644 index 0000000..967bb67 --- /dev/null +++ b/.rubocop_naming.yml @@ -0,0 +1,286 @@ +# Department 'Naming' (18): 수정 +Naming/AccessorMethodName: + Description: Check the naming of accessor methods for get_/set_. + StyleGuide: "#accessor_mutator_method_names" + Enabled: true + VersionAdded: '0.50' + +Naming/AsciiIdentifiers: + Description: Use only ascii symbols in identifiers and constants. + StyleGuide: "#english-identifiers" + Enabled: true + VersionAdded: '0.50' + VersionChanged: '0.87' + AsciiConstants: true + +# Supports --autocorrect +Naming/BinaryOperatorParameterName: + Description: When defining binary operators, name the argument other. + StyleGuide: "#other-arg" + Enabled: true + VersionAdded: '0.50' + VersionChanged: '1.2' + +# Supports --autocorrect +Naming/BlockForwarding: + Description: Use anonymous block forwarding. + StyleGuide: "#block-forwarding" + Enabled: true + VersionAdded: '1.24' + EnforcedStyle: anonymous + SupportedStyles: + - anonymous + - explicit + BlockForwardingName: block + +Naming/BlockParameterName: + Description: Checks for block parameter names that contain capital letters, end in + numbers, or do not meet a minimal length. + Enabled: true + VersionAdded: '0.53' + VersionChanged: '0.77' + MinNameLength: 1 + AllowNamesEndingInNumbers: true + AllowedNames: [] + ForbiddenNames: [] + +Naming/ClassAndModuleCamelCase: + Description: Use CamelCase for classes and modules. + StyleGuide: "#camelcase-classes" + Enabled: true + VersionAdded: '0.50' + VersionChanged: '0.85' + AllowedNames: + - module_parent + +Naming/ConstantName: + Description: Constants should use SCREAMING_SNAKE_CASE. + StyleGuide: "#screaming-snake-case" + Enabled: true + VersionAdded: '0.50' + +Naming/FileName: + Description: Use snake_case for source file names. + StyleGuide: "#snake-case-files" + Enabled: true + VersionAdded: '0.50' + VersionChanged: '1.23' + Exclude: + - "/Users/rubyon/Desktop/liaf-rails/Rakefile.rb" + ExpectMatchingDefinition: false + CheckDefinitionPathHierarchy: true + CheckDefinitionPathHierarchyRoots: + - lib + - spec + - test + - src + Regex: + IgnoreExecutableScripts: true + AllowedAcronyms: + - CLI + - DSL + - ACL + - API + - ASCII + - CPU + - CSS + - DNS + - EOF + - GUID + - HTML + - HTTP + - HTTPS + - ID + - IP + - JSON + - LHS + - QPS + - RAM + - RHS + - RPC + - SLA + - SMTP + - SQL + - SSH + - TCP + - TLS + - TTL + - UDP + - UI + - UID + - UUID + - URI + - URL + - UTF8 + - VM + - XML + - XMPP + - XSRF + - XSS + +# Supports --autocorrect +Naming/HeredocDelimiterCase: + Description: Use configured case for heredoc delimiters. + StyleGuide: "#heredoc-delimiters" + Enabled: true + VersionAdded: '0.50' + VersionChanged: '1.2' + EnforcedStyle: uppercase + SupportedStyles: + - lowercase + - uppercase + +Naming/HeredocDelimiterNaming: + Description: Use descriptive heredoc delimiters. + StyleGuide: "#heredoc-delimiters" + Enabled: true + VersionAdded: '0.50' + ForbiddenDelimiters: + - !ruby/regexp /(^|\s)(EO[A-Z]{1}|END)(\s|$)/i + +# Supports --autocorrect +Naming/InclusiveLanguage: + Description: Recommend the use of inclusive language instead of problematic terms. + Enabled: false + VersionAdded: '1.18' + VersionChanged: '1.49' + CheckIdentifiers: true + CheckConstants: true + CheckVariables: true + CheckStrings: false + CheckSymbols: true + CheckComments: true + CheckFilepaths: true + FlaggedTerms: + whitelist: + Regex: !ruby/regexp /white[-_\s]?list/ + Suggestions: + - allowlist + - permit + blacklist: + Regex: !ruby/regexp /black[-_\s]?list/ + Suggestions: + - denylist + - block + slave: + WholeWord: true + Suggestions: + - replica + - secondary + - follower + +# Supports --autocorrect +Naming/MemoizedInstanceVariableName: + Description: Memoized method name should match memo instance variable name. + Enabled: true + VersionAdded: '0.53' + VersionChanged: '1.2' + EnforcedStyleForLeadingUnderscores: disallowed + SupportedStylesForLeadingUnderscores: + - disallowed + - required + - optional + Safe: false + +Naming/MethodName: + Description: Use the configured style when naming methods. + StyleGuide: "#snake-case-symbols-methods-vars" + Enabled: true + VersionAdded: '0.50' + EnforcedStyle: snake_case + SupportedStyles: + - snake_case + - camelCase + AllowedPatterns: [] + +Naming/MethodParameterName: + Description: Checks for method parameter names that contain capital letters, end in + numbers, or do not meet a minimal length. + Enabled: true + VersionAdded: '0.53' + VersionChanged: '0.77' + MinNameLength: 3 + AllowNamesEndingInNumbers: true + AllowedNames: + - as + - at + - by + - cc + - db + - id + - if + - in + - io + - ip + - of + - 'on' + - os + - pp + - to + ForbiddenNames: [] + +Naming/PredicateName: + Description: Check the names of predicate methods. + StyleGuide: "#bool-methods-qmark" + Enabled: false + VersionAdded: '0.50' + VersionChanged: '0.77' + NamePrefix: + - is_ + - has_ + - have_ + ForbiddenPrefixes: + - is_ + - has_ + - have_ + AllowedMethods: + - is_a? + MethodDefinitionMacros: + - define_method + - define_singleton_method + Exclude: + - "/Users/rubyon/Desktop/liaf-rails/spec/**/*" + +# Supports --autocorrect +Naming/RescuedExceptionsVariableName: + Description: Use consistent rescued exceptions variables naming. + Enabled: true + VersionAdded: '0.67' + VersionChanged: '0.68' + PreferredName: e + +Naming/VariableName: + Description: Use the configured style when naming variables. + StyleGuide: "#snake-case-symbols-methods-vars" + Enabled: true + VersionAdded: '0.50' + VersionChanged: '1.8' + EnforcedStyle: snake_case + SupportedStyles: + - snake_case + - camelCase + AllowedIdentifiers: [] + AllowedPatterns: [] + +Naming/VariableNumber: + Description: Use the configured style when numbering symbols, methods and variables. + StyleGuide: "#snake-case-symbols-methods-vars-with-numbers" + Enabled: true + VersionAdded: '0.50' + VersionChanged: '1.4' + EnforcedStyle: normalcase + SupportedStyles: + - snake_case + - normalcase + - non_integer + CheckMethodNames: true + CheckSymbols: true + AllowedIdentifiers: + - capture3 + - iso8601 + - rfc1123_date + - rfc822 + - rfc2822 + - rfc3339 + - x86_64 + AllowedPatterns: [] \ No newline at end of file diff --git a/.rubocop_performance.yml b/.rubocop_performance.yml new file mode 100644 index 0000000..b5e280f --- /dev/null +++ b/.rubocop_performance.yml @@ -0,0 +1,377 @@ +# Department 'Performance' (50): 미수정 +# Supports --autocorrect +Performance/AncestorsInclude: + Description: Use `A <= B` instead of `A.ancestors.include?(B)`. + Reference: https://github.com/fastruby/fast-ruby#ancestorsinclude-vs--code + Enabled: false + Safe: false + VersionAdded: '1.7' + +# Supports --autocorrect +Performance/ArraySemiInfiniteRangeSlice: + Description: Identifies places where slicing arrays with semi-infinite ranges can + be replaced by `Array#take` and `Array#drop`. + Enabled: false + Safe: false + VersionAdded: '1.9' + +# Supports --autocorrect +Performance/BigDecimalWithNumericArgument: + Description: Convert numeric literal to string and pass it to `BigDecimal`. + Enabled: false + VersionAdded: '1.7' + +# Supports --autocorrect +Performance/BindCall: + Description: Use `bind_call(obj, args, ...)` instead of `bind(obj).call(args, ...)`. + Enabled: false + VersionAdded: '1.6' + +# Supports --autocorrect +Performance/BlockGivenWithExplicitBlock: + Description: Check block argument explicitly instead of using `block_given?`. + Enabled: false + VersionAdded: '1.9' + +# Supports --autocorrect +Performance/Caller: + Description: Use `caller(n..n)` instead of `caller`. + Enabled: false + VersionAdded: '0.49' + VersionChanged: '1.9' + +# Supports --autocorrect +Performance/CaseWhenSplat: + Description: Reordering `when` conditions with a splat to the end of the `when` branches + can improve performance. + Enabled: false + SafeAutoCorrect: false + VersionAdded: '0.34' + VersionChanged: '1.13' + +# Supports --autocorrect +Performance/Casecmp: + Description: Use `casecmp` rather than `downcase ==`, `upcase ==`, `== downcase`, + or `== upcase`.. + Reference: https://github.com/fastruby/fast-ruby#stringcasecmp-vs--stringcasecmp-vs-stringdowncase---code + Enabled: false + Safe: false + VersionAdded: '0.36' + VersionChanged: '1.21' + +Performance/ChainArrayAllocation: + Description: Instead of chaining array methods that allocate new arrays, mutate an + existing array. + Reference: https://twitter.com/schneems/status/1034123879978029057 + Enabled: false + VersionAdded: '0.59' + +Performance/CollectionLiteralInLoop: + Description: Extract Array and Hash literals outside of loops into local variables + or constants. + Enabled: false + VersionAdded: '1.8' + MinSize: 1 + +# Supports --autocorrect +Performance/CompareWithBlock: + Description: Use `sort_by(&:foo)` instead of `sort { |a, b| a.foo <=> b.foo }`. + Enabled: false + VersionAdded: '0.46' + +# Supports --autocorrect +Performance/ConcurrentMonotonicTime: + Description: Use `Process.clock_gettime(Process::CLOCK_MONOTONIC)` instead of `Concurrent.monotonic_time`. + Reference: https://github.com/rails/rails/pull/43502 + Enabled: false + VersionAdded: '1.12' + +# Supports --autocorrect +Performance/ConstantRegexp: + Description: Finds regular expressions with dynamic components that are all constants. + Enabled: false + VersionAdded: '1.9' + VersionChanged: '1.10' + +# Supports --autocorrect +Performance/Count: + Description: Use `count` instead of `{select,find_all,filter,reject}...{size,count,length}`. + SafeAutoCorrect: false + Enabled: false + VersionAdded: '0.31' + VersionChanged: '1.8' + +# Supports --autocorrect +Performance/DeletePrefix: + Description: Use `delete_prefix` instead of `gsub`. + Enabled: false + Safe: false + SafeMultiline: true + VersionAdded: '1.6' + VersionChanged: '1.11' + +# Supports --autocorrect +Performance/DeleteSuffix: + Description: Use `delete_suffix` instead of `gsub`. + Enabled: false + Safe: false + SafeMultiline: true + VersionAdded: '1.6' + VersionChanged: '1.11' + +# Supports --autocorrect +Performance/Detect: + Description: Use `detect` instead of `select.first`, `find_all.first`, `filter.first`, + `select.last`, `find_all.last`, and `filter.last`. + Reference: https://github.com/fastruby/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code + SafeAutoCorrect: false + Enabled: false + VersionAdded: '0.30' + VersionChanged: '1.8' + +# Supports --autocorrect +Performance/DoubleStartEndWith: + Description: Use `str.{start,end}_with?(x, ..., y, ...)` instead of `str.{start,end}_with?(x, + ...) || str.{start,end}_with?(y, ...)`. + Enabled: false + VersionAdded: '0.36' + VersionChanged: '0.48' + IncludeActiveSupportAliases: false + +# Supports --autocorrect +Performance/EndWith: + Description: Use `end_with?` instead of a regex match anchored to the end of a string. + Reference: https://github.com/fastruby/fast-ruby#stringmatch-vs-stringmatch-vs-stringstart_withstringend_with-code-start-code-end + SafeAutoCorrect: false + Enabled: false + SafeMultiline: true + VersionAdded: '0.36' + VersionChanged: '1.10' + +Performance/FixedSize: + Description: Do not compute the size of statically sized objects except in constants. + Enabled: false + VersionAdded: '0.35' + +# Supports --autocorrect +Performance/FlatMap: + Description: Use `Enumerable#flat_map` instead of `Enumerable#map...Array#flatten(1)` + or `Enumerable#collect..Array#flatten(1)`. + Reference: https://github.com/fastruby/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code + Enabled: true + VersionAdded: '0.30' + EnabledForFlattenWithoutParams: false + +# Supports --autocorrect +Performance/InefficientHashSearch: + Description: Use `key?` or `value?` instead of `keys.include?` or `values.include?`. + Reference: https://github.com/fastruby/fast-ruby#hashkey-instead-of-hashkeysinclude-code + Enabled: false + VersionAdded: '0.56' + Safe: false + +# Supports --autocorrect +Performance/IoReadlines: + Description: Use `IO.each_line` (`IO#each_line`) instead of `IO.readlines` (`IO#readlines`). + Reference: https://docs.gitlab.com/ee/development/performance.html#reading-from-files-and-other-data-sources + Enabled: false + VersionAdded: '1.7' + +# Supports --autocorrect +Performance/MapCompact: + Description: Use `filter_map` instead of `collection.map(&:do_something).compact`. + Enabled: false + SafeAutoCorrect: false + VersionAdded: '1.11' + +Performance/MapMethodChain: + Description: Checks if the `map` method is used in a chain. + Enabled: false + Safe: false + VersionAdded: '1.19' + +Performance/MethodObjectAsBlock: + Description: Use block explicitly instead of block-passing a method object. + Reference: https://github.com/fastruby/fast-ruby#normal-way-to-apply-method-vs-method-code + Enabled: false + VersionAdded: '1.9' + +Performance/OpenStruct: + Description: Use `Struct` instead of `OpenStruct`. + Enabled: false + VersionAdded: '0.61' + Safe: false + +# Supports --autocorrect +Performance/RangeInclude: + Description: Use `Range#cover?` instead of `Range#include?` (or `Range#member?`). + Reference: https://github.com/fastruby/fast-ruby#cover-vs-include-code + Enabled: false + VersionAdded: '0.36' + VersionChanged: '1.7' + Safe: false + +# Supports --autocorrect +Performance/RedundantBlockCall: + Description: Use `yield` instead of `block.call`. + Reference: https://github.com/fastruby/fast-ruby#proccall-and-block-arguments-vs-yieldcode + Enabled: false + VersionAdded: '0.36' + +# Supports --autocorrect +Performance/RedundantEqualityComparisonBlock: + Description: Checks for uses `Enumerable#all?`, `Enumerable#any?`, `Enumerable#one?`, + or `Enumerable#none?` are compared with `===` or similar methods in block. + Reference: https://github.com/rails/rails/pull/41363 + Enabled: false + Safe: false + AllowRegexpMatch: true + VersionAdded: '1.10' + +# Supports --autocorrect +Performance/RedundantMatch: + Description: Use `=~` instead of `String#match` or `Regexp#match` in a context where + the returned `MatchData` is not needed. + Enabled: false + VersionAdded: '0.36' + +# Supports --autocorrect +Performance/RedundantMerge: + Description: Use Hash#[]=, rather than Hash#merge! with a single key-value pair. + Reference: https://github.com/fastruby/fast-ruby#hashmerge-vs-hash-code + Enabled: false + Safe: false + VersionAdded: '0.36' + VersionChanged: '1.11' + MaxKeyValuePairs: 2 + +# Supports --autocorrect +Performance/RedundantSortBlock: + Description: Use `sort` instead of `sort { |a, b| a <=> b }`. + Enabled: false + VersionAdded: '1.7' + +# Supports --autocorrect +Performance/RedundantSplitRegexpArgument: + Description: Identifies places where `split` argument can be replaced from a deterministic + regexp to a string. + Enabled: false + VersionAdded: '1.10' + +# Supports --autocorrect +Performance/RedundantStringChars: + Description: Checks for redundant `String#chars`. + Enabled: false + VersionAdded: '1.7' + +# Supports --autocorrect +Performance/RegexpMatch: + Description: Use `match?` instead of `Regexp#match`, `String#match`, `Symbol#match`, + `Regexp#===`, or `=~` when `MatchData` is not used. + Reference: https://github.com/fastruby/fast-ruby#regexp-vs-regexpmatch-vs-regexpmatch-vs-stringmatch-vs-string-vs-stringmatch-code- + Enabled: false + VersionAdded: '0.47' + +# Supports --autocorrect +Performance/ReverseEach: + Description: Use `reverse_each` instead of `reverse.each`. + Reference: https://github.com/fastruby/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code + Enabled: false + VersionAdded: '0.30' + +# Supports --autocorrect +Performance/ReverseFirst: + Description: Use `last(n).reverse` instead of `reverse.first(n)`. + Enabled: false + VersionAdded: '1.7' + +Performance/SelectMap: + Description: Use `filter_map` instead of `ary.select(&:foo).map(&:bar)`. + Enabled: false + VersionAdded: '1.11' + +# Supports --autocorrect +Performance/Size: + Description: Use `size` instead of `count` for counting the number of elements in + `Array` and `Hash`. + Reference: https://github.com/fastruby/fast-ruby#arraylength-vs-arraysize-vs-arraycount-code + Enabled: false + VersionAdded: '0.30' + +# Supports --autocorrect +Performance/SortReverse: + Description: Use `sort.reverse` instead of `sort { |a, b| b <=> a }`. + Enabled: false + VersionAdded: '1.7' + +# Supports --autocorrect +Performance/Squeeze: + Description: Use `squeeze('a')` instead of `gsub(/a+/, 'a')`. + Reference: https://github.com/fastruby/fast-ruby#remove-extra-spaces-or-other-contiguous-characters-code + Enabled: false + VersionAdded: '1.7' + +# Supports --autocorrect +Performance/StartWith: + Description: Use `start_with?` instead of a regex match anchored to the beginning + of a string. + Reference: https://github.com/fastruby/fast-ruby#stringmatch-vs-stringmatch-vs-stringstart_withstringend_with-code-start-code-end + SafeAutoCorrect: false + Enabled: false + SafeMultiline: true + VersionAdded: '0.36' + VersionChanged: '1.10' + +# Supports --autocorrect +Performance/StringIdentifierArgument: + Description: Use symbol identifier argument instead of string identifier argument. + Enabled: false + VersionAdded: '1.13' + +# Supports --autocorrect +Performance/StringInclude: + Description: Use `String#include?` instead of a regex match with literal-only pattern. + Enabled: false + SafeAutoCorrect: false + VersionAdded: '1.7' + VersionChanged: '1.12' + +# Supports --autocorrect +Performance/StringReplacement: + Description: Use `tr` instead of `gsub` when you are replacing the same number of + characters. Use `delete` instead of `gsub` when you are deleting characters. + Reference: https://github.com/fastruby/fast-ruby#stringgsub-vs-stringtr-code + Enabled: false + VersionAdded: '0.33' + +# Supports --autocorrect +Performance/Sum: + Description: Use `sum` instead of a custom array summation. + SafeAutoCorrect: false + Reference: https://blog.bigbinary.com/2016/11/02/ruby-2-4-introduces-enumerable-sum.html + Enabled: false + VersionAdded: '1.8' + VersionChanged: '1.13' + OnlySumOrWithInitialValue: false + +# Supports --autocorrect +Performance/TimesMap: + Description: Checks for .times.map calls. + Enabled: false + SafeAutoCorrect: false + VersionAdded: '0.36' + VersionChanged: '1.13' + +# Supports --autocorrect +Performance/UnfreezeString: + Description: Use unary plus to get an unfrozen string literal. + Enabled: true + SafeAutoCorrect: false + VersionAdded: '0.50' + VersionChanged: '1.9' + +# Supports --autocorrect +Performance/UriDefaultParser: + Description: Use `URI::DEFAULT_PARSER` instead of `URI::Parser.new`. + Enabled: false + VersionAdded: '0.50' \ No newline at end of file diff --git a/.rubocop_rails.yml b/.rubocop_rails.yml new file mode 100644 index 0000000..b7b9dea --- /dev/null +++ b/.rubocop_rails.yml @@ -0,0 +1,1215 @@ +# Department 'Rails' (131): 미수정 +# Supports --autocorrect +Rails/ActionControllerFlashBeforeRender: + Description: Use `flash.now` instead of `flash` before `render`. + Enabled: false + SafeAutoCorrect: false + VersionAdded: '2.16' + +# Supports --autocorrect +Rails/ActionControllerTestCase: + Description: Use `ActionDispatch::IntegrationTest` instead of `ActionController::TestCase`. + StyleGuide: https://rails.rubystyle.guide/#integration-testing + Reference: https://api.rubyonrails.org/classes/ActionController/TestCase.html + Enabled: false + SafeAutoCorrect: false + VersionAdded: '2.14' + Include: + - "**/test/**/*.rb" + +# Supports --autocorrect +Rails/ActionFilter: + Description: Enforces consistent use of action filter methods. + Enabled: false + VersionAdded: '0.19' + VersionChanged: '2.22' + EnforcedStyle: action + SupportedStyles: + - action + - filter + Include: + - app/controllers/**/*.rb + - app/mailers/**/*.rb + +# Supports --autocorrect +Rails/ActionOrder: + Description: Enforce consistent ordering of controller actions. + Enabled: false + VersionAdded: '2.17' + ExpectedOrder: + - index + - show + - new + - edit + - create + - update + - destroy + Include: + - app/controllers/**/*.rb + +# Supports --autocorrect +Rails/ActiveRecordAliases: + Description: 'Avoid Active Record aliases: Use `update` instead of `update_attributes`. + Use `update!` instead of `update_attributes!`.' + Enabled: false + VersionAdded: '0.53' + SafeAutoCorrect: false + +# Supports --autocorrect +Rails/ActiveRecordCallbacksOrder: + Description: Order callback declarations in the order in which they will be executed. + StyleGuide: https://rails.rubystyle.guide/#callbacks-order + Enabled: false + VersionAdded: '2.7' + Include: + - app/models/**/*.rb + +Rails/ActiveRecordOverride: + Description: Check for overriding Active Record methods instead of using callbacks. + Enabled: false + Severity: warning + VersionAdded: '0.67' + VersionChanged: '2.18' + Include: + - app/models/**/*.rb + +# Supports --autocorrect +Rails/ActiveSupportAliases: + Description: 'Avoid ActiveSupport aliases of standard ruby methods: `String#starts_with?`, + `String#ends_with?`, `Array#append`, `Array#prepend`.' + Enabled: false + VersionAdded: '0.48' + +# Supports --autocorrect +Rails/ActiveSupportOnLoad: + Description: Use `ActiveSupport.on_load(...)` to patch Rails framework classes. + Enabled: false + Reference: + - https://api.rubyonrails.org/classes/ActiveSupport/LazyLoadHooks.html + - https://guides.rubyonrails.org/engines.html#available-load-hooks + SafeAutoCorrect: false + VersionAdded: '2.16' + VersionChanged: '2.24' + +# Supports --autocorrect +Rails/AddColumnIndex: + Description: Rails migrations don't make use of a given `index` key, but also doesn't + given an error when it's used, so it makes it seem like an index might be used. + Enabled: false + VersionAdded: '2.11' + VersionChanged: '2.20' + Include: + - db/**/*.rb + +Rails/AfterCommitOverride: + Description: Enforces that there is only one call to `after_commit` (and its aliases + - `after_create_commit`, `after_update_commit`, and `after_destroy_commit`) with + the same callback name per model. + Enabled: false + VersionAdded: '2.8' + +# Supports --autocorrect +Rails/ApplicationController: + Description: Check that controllers subclass ApplicationController. + Enabled: false + SafeAutoCorrect: false + VersionAdded: '2.4' + VersionChanged: '2.5' + +# Supports --autocorrect +Rails/ApplicationJob: + Description: Check that jobs subclass ApplicationJob. + Enabled: false + SafeAutoCorrect: false + VersionAdded: '0.49' + VersionChanged: '2.5' + +# Supports --autocorrect +Rails/ApplicationMailer: + Description: Check that mailers subclass ApplicationMailer. + Enabled: false + SafeAutoCorrect: false + VersionAdded: '2.4' + VersionChanged: '2.5' + +# Supports --autocorrect +Rails/ApplicationRecord: + Description: Check that models subclass ApplicationRecord. + Enabled: false + SafeAutoCorrect: false + VersionAdded: '0.49' + VersionChanged: '2.26' + Exclude: + - "/Users/rubyon/Desktop/liaf-rails/db/**/*.rb" + +# Supports --autocorrect +Rails/ArelStar: + Description: Enforces `Arel.star` instead of `"*"` for expanded columns. + Enabled: false + SafeAutoCorrect: false + VersionAdded: '2.9' + +# Supports --autocorrect +Rails/AssertNot: + Description: Use `assert_not` instead of `assert !`. + Enabled: true + VersionAdded: '0.56' + Include: + - test/**/* + +# Supports --autocorrect +Rails/AttributeDefaultBlockValue: + Description: Pass method call in block for attribute option `default`. + Enabled: false + VersionAdded: '2.9' + Include: + - app/models/**/* + +# Supports --autocorrect +Rails/BelongsTo: + Description: 'Use `optional: true` instead of `required: false` for `belongs_to` relations.' + Reference: + - https://guides.rubyonrails.org/5_0_release_notes.html + - https://github.com/rails/rails/pull/18937 + Enabled: false + VersionAdded: '0.62' + +# Supports --autocorrect +Rails/Blank: + Description: Enforces use of `blank?`. + Enabled: false + SafeAutoCorrect: false + VersionAdded: '0.48' + VersionChanged: '2.10' + NilOrEmpty: true + NotPresent: true + UnlessPresent: true + +Rails/BulkChangeTable: + Description: Check whether alter queries are combinable. + Reference: + - https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-change_table + - https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/Table.html + Enabled: false + VersionAdded: '0.57' + VersionChanged: '2.20' + Database: + SupportedDatabases: + - mysql + - postgresql + Include: + - db/**/*.rb + +# Supports --autocorrect +Rails/CompactBlank: + Description: Checks if collection can be blank-compacted with `compact_blank`. + Enabled: false + Safe: false + VersionAdded: '2.13' + +# Supports --autocorrect +Rails/ContentTag: + Description: Use `tag.something` instead of `tag(:something)`. + Reference: + - https://github.com/rubocop/rubocop-rails/issues/260 + - https://github.com/rails/rails/issues/25195 + - https://api.rubyonrails.org/classes/ActionView/Helpers/TagHelper.html#method-i-content_tag + Enabled: false + VersionAdded: '2.6' + VersionChanged: '2.12' + Exclude: + - "/Users/rubyon/Desktop/liaf-rails/app/models/**/*.rb" + - "/Users/rubyon/Desktop/liaf-rails/config/**/*.rb" + +Rails/CreateTableWithTimestamps: + Description: Checks the migration for which timestamps are not included when creating + a new table. + Enabled: false + VersionAdded: '0.52' + VersionChanged: '2.20' + Include: + - db/**/*.rb + Exclude: + - "/Users/rubyon/Desktop/liaf-rails/db/**/*_create_active_storage_tables.active_storage.rb" + - "/Users/rubyon/Desktop/liaf-rails/db/**/*_create_active_storage_variant_records.active_storage.rb" + +Rails/DangerousColumnNames: + Description: Avoid dangerous column names. + Enabled: false + Severity: warning + VersionAdded: '2.21' + Include: + - db/**/*.rb + +# Supports --autocorrect +Rails/Date: + Description: Checks the correct usage of date aware methods, such as Date.today, Date.current + etc. + Enabled: false + SafeAutoCorrect: false + VersionAdded: '0.30' + VersionChanged: '2.11' + EnforcedStyle: flexible + SupportedStyles: + - strict + - flexible + AllowToTime: true + +Rails/DefaultScope: + Description: Avoid use of `default_scope`. + Enabled: false + VersionAdded: '2.7' + +# Supports --autocorrect +Rails/Delegate: + Description: Prefer delegate method for delegations. + Enabled: false + VersionAdded: '0.21' + VersionChanged: '0.50' + EnforceForPrefixed: true + +# Supports --autocorrect +Rails/DelegateAllowBlank: + Description: Do not use allow_blank as an option to delegate. + Enabled: false + VersionAdded: '0.44' + +# Supports --autocorrect +Rails/DeprecatedActiveModelErrorsMethods: + Description: Avoid manipulating ActiveModel errors hash directly. + Enabled: false + Severity: warning + Safe: false + VersionAdded: '2.14' + VersionChanged: '2.18' + +# Supports --autocorrect +Rails/DotSeparatedKeys: + Description: Enforces the use of dot-separated keys instead of `:scope` options in + `I18n` translation methods. + StyleGuide: https://rails.rubystyle.guide/#dot-separated-keys + Enabled: false + VersionAdded: '2.15' + +# Supports --autocorrect +Rails/DuplicateAssociation: + Description: Don't repeat associations in a model. + Enabled: false + Severity: warning + VersionAdded: '2.14' + VersionChanged: '2.18' + +Rails/DuplicateScope: + Description: Multiple scopes share this same where clause. + Enabled: false + Severity: warning + VersionAdded: '2.14' + VersionChanged: '2.18' + +# Supports --autocorrect +Rails/DurationArithmetic: + Description: Do not use duration as arithmetic operand with `Time.current`. + StyleGuide: https://rails.rubystyle.guide#duration-arithmetic + Enabled: false + VersionAdded: '2.13' + +# Supports --autocorrect +Rails/DynamicFindBy: + Description: Use `find_by` instead of dynamic `find_by_*`. + StyleGuide: https://rails.rubystyle.guide#find_by + Enabled: false + Safe: false + VersionAdded: '0.44' + VersionChanged: '2.10' + Whitelist: + - find_by_sql + - find_by_token_for + AllowedMethods: + - find_by_sql + - find_by_token_for + AllowedReceivers: + - Gem::Specification + - page + +# Supports --autocorrect +Rails/EagerEvaluationLogMessage: + Description: Checks that blocks are used for interpolated strings passed to `Rails.logger.debug`. + Reference: https://guides.rubyonrails.org/debugging_rails_applications.html#impact-of-logs-on-performance + Enabled: false + VersionAdded: '2.11' + +# Supports --autocorrect +Rails/EnumHash: + Description: Prefer hash syntax over array syntax when defining enums. + StyleGuide: https://rails.rubystyle.guide#enums + Enabled: false + VersionAdded: '2.3' + Include: + - app/models/**/*.rb + +# Supports --autocorrect +Rails/EnumSyntax: + Description: Use positional arguments over keyword arguments when defining enums. + Enabled: false + Severity: warning + VersionAdded: '2.26' + Include: + - app/models/**/*.rb + +Rails/EnumUniqueness: + Description: Avoid duplicate integers in hash-syntax `enum` declaration. + Enabled: false + VersionAdded: '0.46' + Include: + - app/models/**/*.rb + +# Supports --autocorrect +Rails/EnvLocal: + Description: Use `Rails.env.local?` instead of `Rails.env.development? || Rails.env.test?`. + Enabled: false + VersionAdded: '2.22' + +# Supports --autocorrect +Rails/EnvironmentComparison: + Description: Favor `Rails.env.production?` over `Rails.env == 'production'`. + Enabled: false + VersionAdded: '0.52' + +Rails/EnvironmentVariableAccess: + Description: Do not access `ENV` directly after initialization. + Enabled: false + VersionAdded: '2.10' + VersionChanged: '2.24' + Include: + - app/**/*.rb + - config/initializers/**/*.rb + - lib/**/*.rb + Exclude: + - "/Users/rubyon/Desktop/liaf-rails/lib/**/*.rake" + AllowReads: false + AllowWrites: false + +Rails/Exit: + Description: Favor `fail`, `break`, `return`, etc. over `exit` in application or library + code outside of Rake files to avoid exits during unit testing or running in production. + Enabled: false + VersionAdded: '0.41' + Include: + - app/**/*.rb + - config/**/*.rb + - lib/**/*.rb + Exclude: + - "/Users/rubyon/Desktop/liaf-rails/lib/**/*.rake" + +# Supports --autocorrect +Rails/ExpandedDateRange: + Description: Checks for expanded date range. + StyleGuide: https://rails.rubystyle.guide/#date-time-range + Enabled: false + VersionAdded: '2.11' + +# Supports --autocorrect +Rails/FilePath: + Description: Use `Rails.root.join` for file path joining. + Enabled: false + VersionAdded: '0.47' + VersionChanged: '2.4' + EnforcedStyle: slashes + SupportedStyles: + - slashes + - arguments + +# Supports --autocorrect +Rails/FindBy: + Description: Prefer find_by over where.first. + StyleGuide: https://rails.rubystyle.guide#find_by + Enabled: false + VersionAdded: '0.30' + VersionChanged: '2.21' + IgnoreWhereFirst: true + +# Supports --autocorrect +Rails/FindById: + Description: Favor the use of `find` over `where.take!`, `find_by!`, and `find_by_id!` + when you need to retrieve a single record by primary key when you expect it to be + found. + StyleGuide: https://rails.rubystyle.guide/#find + Enabled: false + VersionAdded: '2.7' + +# Supports --autocorrect +Rails/FindEach: + Description: Prefer all.find_each over all.each. + StyleGuide: https://rails.rubystyle.guide#find-each + Enabled: false + Safe: false + VersionAdded: '0.30' + VersionChanged: '2.21' + AllowedMethods: + - order + - limit + - select + - lock + AllowedPatterns: [] + +# Supports --autocorrect +Rails/FreezeTime: + Description: Prefer `freeze_time` over `travel_to` with an argument of the current + time. + StyleGuide: https://rails.rubystyle.guide/#freeze-time + Enabled: false + VersionAdded: '2.16' + SafeAutoCorrect: false + +Rails/HasAndBelongsToMany: + Description: Prefer has_many :through to has_and_belongs_to_many. + StyleGuide: https://rails.rubystyle.guide#has-many-through + Enabled: false + VersionAdded: '0.12' + Include: + - app/models/**/*.rb + +Rails/HasManyOrHasOneDependent: + Description: Define the dependent option to the has_many and has_one associations. + StyleGuide: https://rails.rubystyle.guide#has_many-has_one-dependent-option + Enabled: false + VersionAdded: '0.50' + Include: + - app/models/**/*.rb + +Rails/HelperInstanceVariable: + Description: Do not use instance variables in helpers. + Enabled: false + VersionAdded: '2.0' + Include: + - app/helpers/**/*.rb + +# Supports --autocorrect +Rails/HttpPositionalArguments: + Description: Use keyword arguments instead of positional arguments in http method + calls. + Enabled: false + VersionAdded: '0.44' + Include: + - spec/**/* + - test/**/* + +# Supports --autocorrect +Rails/HttpStatus: + Description: Enforces use of symbolic or numeric value to define HTTP status. + Enabled: false + VersionAdded: '0.54' + VersionChanged: '2.11' + EnforcedStyle: symbolic + SupportedStyles: + - numeric + - symbolic + +# Supports --autocorrect +Rails/I18nLazyLookup: + Description: Checks for places where I18n "lazy" lookup can be used. + StyleGuide: https://rails.rubystyle.guide/#lazy-lookup + Reference: https://guides.rubyonrails.org/i18n.html#lazy-lookup + Enabled: false + VersionAdded: '2.14' + EnforcedStyle: lazy + SupportedStyles: + - lazy + - explicit + Include: + - app/controllers/**/*.rb + +Rails/I18nLocaleAssignment: + Description: Prefer the usage of `I18n.with_locale` instead of manually updating `I18n.locale` + value. + Enabled: false + VersionAdded: '2.11' + Include: + - spec/**/*.rb + - test/**/*.rb + +Rails/I18nLocaleTexts: + Description: Enforces use of I18n and locale files instead of locale specific strings. + StyleGuide: https://rails.rubystyle.guide/#locale-texts + Enabled: false + VersionAdded: '2.14' + +# Supports --autocorrect +Rails/IgnoredColumnsAssignment: + Description: Looks for assignments of `ignored_columns` that override previous assignments. + StyleGuide: https://rails.rubystyle.guide/#append-ignored-columns + Enabled: false + SafeAutoCorrect: false + VersionAdded: '2.17' + +# Supports --autocorrect +Rails/IgnoredSkipActionFilterOption: + Description: Checks that `if` and `only` (or `except`) are not used together as options + of `skip_*` action filter. + Reference: https://api.rubyonrails.org/classes/AbstractController/Callbacks/ClassMethods.html#method-i-_normalize_callback_options + Enabled: false + VersionAdded: '0.63' + Include: + - app/controllers/**/*.rb + - app/mailers/**/*.rb + +# Supports --autocorrect +Rails/IndexBy: + Description: Prefer `index_by` over `each_with_object`, `to_h`, or `map`. + Enabled: false + VersionAdded: '2.5' + VersionChanged: '2.8' + +# Supports --autocorrect +Rails/IndexWith: + Description: Prefer `index_with` over `each_with_object`, `to_h`, or `map`. + Enabled: false + VersionAdded: '2.5' + VersionChanged: '2.8' + +Rails/Inquiry: + Description: Prefer Ruby's comparison operators over Active Support's `Array#inquiry` + and `String#inquiry`. + StyleGuide: https://rails.rubystyle.guide/#inquiry + Enabled: false + VersionAdded: '2.7' + +Rails/InverseOf: + Description: Checks for associations where the inverse cannot be determined automatically. + Reference: + - https://guides.rubyonrails.org/association_basics.html#bi-directional-associations + - https://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#module-ActiveRecord::Associations::ClassMethods-label-Setting+Inverses + Enabled: false + VersionAdded: '0.52' + IgnoreScopes: false + Include: + - app/models/**/*.rb + +Rails/LexicallyScopedActionFilter: + Description: Checks that methods specified in the filter's `only` or `except` options + are explicitly defined in the class. + StyleGuide: https://rails.rubystyle.guide#lexically-scoped-action-filter + Enabled: false + Safe: false + VersionAdded: '0.52' + Include: + - app/controllers/**/*.rb + - app/mailers/**/*.rb + +# Supports --autocorrect +Rails/LinkToBlank: + Description: 'Checks that `link_to` with a `target: "_blank"` have a `rel: "noopener"` + option passed to them.' + Reference: + - https://mathiasbynens.github.io/rel-noopener/ + - https://html.spec.whatwg.org/multipage/links.html#link-type-noopener + - https://html.spec.whatwg.org/multipage/links.html#link-type-noreferrer + Enabled: false + VersionAdded: '0.62' + +# Supports --autocorrect +Rails/MailerName: + Description: Mailer should end with `Mailer` suffix. + StyleGuide: https://rails.rubystyle.guide/#mailer-name + Enabled: false + SafeAutoCorrect: false + VersionAdded: '2.7' + Include: + - app/mailers/**/*.rb + +# Supports --autocorrect +Rails/MatchRoute: + Description: Don't use `match` to define any routes unless there is a need to map + multiple request types among [:get, :post, :patch, :put, :delete] to a single action + using the `:via` option. + StyleGuide: https://rails.rubystyle.guide/#no-match-routes + Enabled: false + VersionAdded: '2.7' + Include: + - config/routes.rb + - config/routes/**/*.rb + +# Supports --autocorrect +Rails/MigrationClassName: + Description: The class name of the migration should match its file name. + Enabled: false + VersionAdded: '2.14' + VersionChanged: '2.20' + Include: + - db/**/*.rb + +# Supports --autocorrect +Rails/NegateInclude: + Description: Prefer `collection.exclude?(obj)` over `!collection.include?(obj)`. + StyleGuide: https://rails.rubystyle.guide#exclude + Enabled: false + Safe: false + VersionAdded: '2.7' + VersionChanged: '2.9' + +Rails/NotNullColumn: + Description: Do not add a NOT NULL column without a default value to existing tables. + Enabled: false + VersionAdded: '0.43' + VersionChanged: '2.20' + Database: + SupportedDatabases: + - mysql + Include: + - db/**/*.rb + +Rails/OrderById: + Description: Do not use the `id` column for ordering. Use a timestamp column to order + chronologically. + StyleGuide: https://rails.rubystyle.guide/#order-by-id + Enabled: false + VersionAdded: '2.8' + +# Supports --autocorrect +Rails/Output: + Description: Checks for calls to puts, print, etc. + Enabled: false + SafeAutoCorrect: false + VersionAdded: '0.15' + VersionChanged: '0.19' + Include: + - app/**/*.rb + - config/**/*.rb + - db/**/*.rb + - lib/**/*.rb + +Rails/OutputSafety: + Description: The use of `html_safe` or `raw` may be a security risk. + Enabled: false + VersionAdded: '0.41' + +# Supports --autocorrect +Rails/Pick: + Description: Prefer `pick` over `pluck(...).first`. + StyleGuide: https://rails.rubystyle.guide#pick + Enabled: false + Safe: false + VersionAdded: '2.6' + +# Supports --autocorrect +Rails/Pluck: + Description: Prefer `pluck` over `map { ... }`. + StyleGuide: https://rails.rubystyle.guide#pluck + Enabled: false + Safe: false + VersionAdded: '2.7' + VersionChanged: '2.18' + +# Supports --autocorrect +Rails/PluckId: + Description: Use `ids` instead of `pluck(:id)` or `pluck(primary_key)`. + StyleGuide: https://rails.rubystyle.guide/#ids + Enabled: false + Safe: false + VersionAdded: '2.7' + +# Supports --autocorrect +Rails/PluckInWhere: + Description: Use `select` instead of `pluck` in `where` query methods. + Enabled: false + Safe: false + VersionAdded: '2.7' + VersionChanged: '2.8' + EnforcedStyle: conservative + SupportedStyles: + - conservative + - aggressive + +# Supports --autocorrect +Rails/PluralizationGrammar: + Description: Checks for incorrect grammar when using methods like `3.day.ago`. + Enabled: false + VersionAdded: '0.35' + +# Supports --autocorrect +Rails/Presence: + Description: Checks code that can be written more easily using `Object#presence` defined + by Active Support. + Enabled: false + VersionAdded: '0.52' + +# Supports --autocorrect +Rails/Present: + Description: Enforces use of `present?`. + Enabled: false + VersionAdded: '0.48' + VersionChanged: '0.67' + NotNilAndNotEmpty: true + NotBlank: true + UnlessBlank: true + +# Supports --autocorrect +Rails/RakeEnvironment: + Description: Include `:environment` as a dependency for all Rake tasks. + Enabled: false + Safe: false + VersionAdded: '2.4' + VersionChanged: '2.6' + Include: + - "**/Rakefile" + - "**/*.rake" + Exclude: + - "/Users/rubyon/Desktop/liaf-rails/lib/capistrano/tasks/**/*.rake" + +# Supports --autocorrect +Rails/ReadWriteAttribute: + Description: Checks for read_attribute(:attr) and write_attribute(:attr, val). + StyleGuide: https://rails.rubystyle.guide#read-attribute + Enabled: false + VersionAdded: '0.20' + VersionChanged: '0.29' + Include: + - app/models/**/*.rb + +# Supports --autocorrect +Rails/RedundantActiveRecordAllMethod: + Description: Detect redundant `all` used as a receiver for Active Record query methods. + StyleGuide: https://rails.rubystyle.guide/#redundant-all + Enabled: false + Safe: false + AllowedReceivers: + - ActionMailer::Preview + - ActiveSupport::TimeZone + VersionAdded: '2.21' + +# Supports --autocorrect +Rails/RedundantAllowNil: + Description: Finds redundant use of `allow_nil` when `allow_blank` is set to certain + values in model validations. + Enabled: false + VersionAdded: '0.67' + Include: + - app/models/**/*.rb + +# Supports --autocorrect +Rails/RedundantForeignKey: + Description: Checks for associations where the `:foreign_key` option is redundant. + Enabled: false + VersionAdded: '2.6' + +# Supports --autocorrect +Rails/RedundantPresenceValidationOnBelongsTo: + Description: Checks for redundant presence validation on belongs_to association. + Enabled: false + SafeAutoCorrect: false + VersionAdded: '2.13' + +# Supports --autocorrect +Rails/RedundantReceiverInWithOptions: + Description: Checks for redundant receiver in `with_options`. + Enabled: false + VersionAdded: '0.52' + +# Supports --autocorrect +Rails/RedundantTravelBack: + Description: Checks for redundant `travel_back` calls. + Enabled: false + VersionAdded: '2.12' + Include: + - spec/**/*.rb + - test/**/*.rb + +# Supports --autocorrect +Rails/ReflectionClassName: + Description: Use a string for `class_name` option value in the definition of a reflection. + Enabled: false + Safe: false + VersionAdded: '0.64' + VersionChanged: '2.10' + +# Supports --autocorrect +Rails/RefuteMethods: + Description: Use `assert_not` methods instead of `refute` methods. + Enabled: true + VersionAdded: '0.56' + EnforcedStyle: assert_not + SupportedStyles: + - assert_not + - refute + Include: + - test/**/* + +# Supports --autocorrect +Rails/RelativeDateConstant: + Description: Do not assign relative date to constants. + Enabled: false + SafeAutoCorrect: false + VersionAdded: '0.48' + VersionChanged: '2.13' + +Rails/RenderInline: + Description: Prefer using a template over inline rendering. + StyleGuide: https://rails.rubystyle.guide/#inline-rendering + Enabled: false + VersionAdded: '2.7' + +# Supports --autocorrect +Rails/RenderPlainText: + Description: Prefer `render plain:` over `render text:`. + StyleGuide: https://rails.rubystyle.guide/#plain-text-rendering + Enabled: false + VersionAdded: '2.7' + ContentTypeCompatibility: true + +# Supports --autocorrect +Rails/RequestReferer: + Description: Use consistent syntax for request.referer. + Enabled: false + VersionAdded: '0.41' + EnforcedStyle: referer + SupportedStyles: + - referer + - referrer + +Rails/RequireDependency: + Description: Do not use `require_dependency` when running in Zeitwerk mode. `require_dependency` + is for autoloading in classic mode. + Reference: https://guides.rubyonrails.org/autoloading_and_reloading_constants.html + Enabled: false + VersionAdded: '2.10' + +# Supports --autocorrect +Rails/ResponseParsedBody: + Description: Prefer `response.parsed_body` to custom parsing logic for `response.body`. + Enabled: false + Safe: false + VersionAdded: '2.18' + VersionChanged: '2.19' + Include: + - spec/controllers/**/*.rb + - spec/requests/**/*.rb + - test/controllers/**/*.rb + - test/integration/**/*.rb + +Rails/ReversibleMigration: + Description: Checks whether the change method of the migration file is reversible. + StyleGuide: https://rails.rubystyle.guide#reversible-migration + Reference: https://api.rubyonrails.org/classes/ActiveRecord/Migration/CommandRecorder.html + Enabled: false + VersionAdded: '0.47' + VersionChanged: '2.13' + Include: + - db/**/*.rb + +Rails/ReversibleMigrationMethodDefinition: + Description: Checks whether the migration implements either a `change` method or both + an `up` and a `down` method. + Enabled: false + VersionAdded: '2.10' + VersionChanged: '2.13' + Include: + - db/**/*.rb + +# Supports --autocorrect +Rails/RootJoinChain: + Description: Use a single `#join` instead of chaining on `Rails.root` or `Rails.public_path`. + Enabled: false + VersionAdded: '2.13' + +# Supports --autocorrect +Rails/RootPathnameMethods: + Description: Use `Rails.root` IO methods instead of passing it to `File`. + Enabled: false + SafeAutoCorrect: false + VersionAdded: '2.16' + +# Supports --autocorrect +Rails/RootPublicPath: + Description: Favor `Rails.public_path` over `Rails.root` with `'public'`. + Enabled: false + VersionAdded: '2.15' + +# Supports --autocorrect +Rails/SafeNavigation: + Description: Use Ruby's safe navigation operator (`&.`) instead of `try!`. + Enabled: false + VersionAdded: '0.43' + ConvertTry: false + +# Supports --autocorrect +Rails/SafeNavigationWithBlank: + Description: Avoid `foo&.blank?` in conditionals. + Enabled: false + VersionAdded: '2.4' + SafeAutoCorrect: false + +# Supports --autocorrect +Rails/SaveBang: + Description: Identifies possible cases where Active Record save! or related should + be used. + StyleGuide: https://rails.rubystyle.guide#save-bang + Enabled: false + VersionAdded: '0.42' + VersionChanged: '0.59' + AllowImplicitReturn: true + AllowedReceivers: [] + SafeAutoCorrect: false + +Rails/SchemaComment: + Description: Enforces the use of the `comment` option when adding a new table or column + to the database during a migration. + Enabled: false + VersionAdded: '2.13' + +# Supports --autocorrect +Rails/ScopeArgs: + Description: Checks the arguments of ActiveRecord scopes. + Enabled: false + VersionAdded: '0.19' + VersionChanged: '2.12' + Include: + - app/models/**/*.rb + +# Supports --autocorrect +Rails/SelectMap: + Description: Checks for uses of `select(:column_name)` with `map(&:column_name)`. + Enabled: false + Safe: false + VersionAdded: '2.21' + +# Supports --autocorrect +Rails/ShortI18n: + Description: 'Use the short form of the I18n methods: `t` instead of `translate` and + `l` instead of `localize`.' + StyleGuide: https://rails.rubystyle.guide/#short-i18n + Enabled: false + VersionAdded: '2.7' + EnforcedStyle: conservative + SupportedStyles: + - conservative + - aggressive + +Rails/SkipsModelValidations: + Description: Use methods that skips model validations with caution. See reference + for more information. + Reference: https://guides.rubyonrails.org/active_record_validations.html#skipping-validations + Enabled: false + Safe: false + VersionAdded: '0.47' + VersionChanged: '2.25' + ForbiddenMethods: + - decrement! + - decrement_counter + - increment! + - increment_counter + - insert + - insert! + - insert_all + - insert_all! + - toggle! + - touch + - touch_all + - update_all + - update_attribute + - update_column + - update_columns + - update_counters + - upsert + - upsert_all + AllowedMethods: [] + +# Supports --autocorrect +Rails/SquishedSQLHeredocs: + Description: Checks SQL heredocs to use `.squish`. + StyleGuide: https://rails.rubystyle.guide/#squished-heredocs + Enabled: false + VersionAdded: '2.8' + VersionChanged: '2.9' + SafeAutoCorrect: false + +# Supports --autocorrect +Rails/StripHeredoc: + Description: Enforces the use of squiggly heredoc over `strip_heredoc`. + StyleGuide: https://rails.rubystyle.guide/#prefer-squiggly-heredoc + Enabled: false + VersionAdded: '2.15' + +Rails/TableNameAssignment: + Description: Do not use `self.table_name =`. Use Inflections or `table_name_prefix` + instead. + StyleGuide: https://rails.rubystyle.guide/#keep-ar-defaults + Enabled: false + VersionAdded: '2.14' + Include: + - app/models/**/*.rb + +Rails/ThreeStateBooleanColumn: + Description: Add a default value and a `NOT NULL` constraint to boolean columns. + StyleGuide: https://rails.rubystyle.guide/#three-state-boolean + Enabled: false + VersionAdded: '2.19' + Include: + - db/**/*.rb + +# Supports --autocorrect +Rails/TimeZone: + Description: Checks the correct usage of time zone aware methods. + StyleGuide: https://rails.rubystyle.guide#time + Reference: http://danilenko.org/2012/7/6/rails_timezones + Enabled: false + SafeAutoCorrect: false + VersionAdded: '0.30' + VersionChanged: '2.13' + EnforcedStyle: flexible + SupportedStyles: + - strict + - flexible + Exclude: + - "/Users/rubyon/Desktop/liaf-rails/**/*.gemspec" + +Rails/TimeZoneAssignment: + Description: Prefer the usage of `Time.use_zone` instead of manually updating `Time.zone` + value. + Reference: https://thoughtbot.com/blog/its-about-time-zones + Enabled: false + VersionAdded: '2.10' + Include: + - spec/**/*.rb + - test/**/*.rb + +# Supports --autocorrect +Rails/ToFormattedS: + Description: Checks for consistent uses of `to_fs` or `to_formatted_s`. + StyleGuide: https://rails.rubystyle.guide/#prefer-to-fs + Enabled: false + EnforcedStyle: to_fs + SupportedStyles: + - to_fs + - to_formatted_s + VersionAdded: '2.15' + +# Supports --autocorrect +Rails/ToSWithArgument: + Description: Identifies passing any argument to `#to_s`. + Enabled: false + Safe: false + VersionAdded: '2.16' + +# Supports --autocorrect +Rails/TopLevelHashWithIndifferentAccess: + Description: Identifies top-level `HashWithIndifferentAccess`. + Reference: https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#top-level-hashwithindifferentaccess-is-soft-deprecated + Enabled: false + Severity: warning + VersionAdded: '2.16' + VersionChanged: '2.18' + +Rails/TransactionExitStatement: + Description: Avoid the usage of `return`, `break` and `throw` in transaction blocks. + Reference: + - https://github.com/rails/rails/commit/15aa4200e083 + Enabled: false + VersionAdded: '2.14' + TransactionMethods: [] + +# Supports --autocorrect +Rails/UniqBeforePluck: + Description: Prefer the use of uniq or distinct before pluck. + Enabled: false + VersionAdded: '0.40' + VersionChanged: '2.13' + EnforcedStyle: conservative + SupportedStyles: + - conservative + - aggressive + SafeAutoCorrect: false + +Rails/UniqueValidationWithoutIndex: + Description: Uniqueness validation should have a unique index on the database column. + Enabled: false + VersionAdded: '2.5' + Include: + - app/models/**/*.rb + +Rails/UnknownEnv: + Description: Use correct environment name. + Enabled: false + Severity: warning + VersionAdded: '0.51' + VersionChanged: '2.18' + Environments: + - development + - test + - production + +Rails/UnusedIgnoredColumns: + Description: Remove a column that does not exist from `ignored_columns`. + Enabled: false + VersionAdded: '2.11' + VersionChanged: '2.25' + Include: + - app/models/**/*.rb + +Rails/UnusedRenderContent: + Description: Do not specify body content for a response with a non-content status + code. + Enabled: false + Severity: warning + VersionAdded: '2.21' + +# Supports --autocorrect +Rails/Validation: + Description: Use validates :attribute, hash of validations. + Enabled: false + VersionAdded: '0.9' + VersionChanged: '0.41' + Include: + - app/models/**/*.rb + +# Supports --autocorrect +Rails/WhereEquals: + Description: Pass conditions to `where` and `where.not` as a hash instead of manually + constructing SQL. + StyleGuide: https://rails.rubystyle.guide/#hash-conditions + Enabled: false + SafeAutoCorrect: false + VersionAdded: '2.9' + VersionChanged: '2.26' + +# Supports --autocorrect +Rails/WhereExists: + Description: Prefer `exists?(...)` over `where(...).exists?`. + Enabled: false + SafeAutoCorrect: false + EnforcedStyle: exists + SupportedStyles: + - exists + - where + VersionAdded: '2.7' + VersionChanged: '2.10' + +# Supports --autocorrect +Rails/WhereMissing: + Description: Use `where.missing(...)` to find missing relationship records. + StyleGuide: https://rails.rubystyle.guide/#finding-missing-relationship-records + Enabled: false + VersionAdded: '2.16' + +# Supports --autocorrect +Rails/WhereNot: + Description: Use `where.not(...)` instead of manually constructing negated SQL in + `where`. + StyleGuide: https://rails.rubystyle.guide/#hash-conditions + Enabled: false + VersionAdded: '2.8' + +Rails/WhereNotWithMultipleConditions: + Description: Do not use `where.not(...)` with multiple conditions. + StyleGuide: https://rails.rubystyle.guide/#where-not-with-multiple-attributes + Enabled: false + Severity: warning + VersionAdded: '2.17' + VersionChanged: '2.18' + +# Supports --autocorrect +Rails/WhereRange: + Description: Use ranges in `where` instead of manually constructing SQL. + StyleGuide: https://rails.rubystyle.guide/#where-ranges + Enabled: false + SafeAutoCorrect: false + VersionAdded: '2.25' \ No newline at end of file diff --git a/.rubocop_security.yml b/.rubocop_security.yml new file mode 100644 index 0000000..e167a02 --- /dev/null +++ b/.rubocop_security.yml @@ -0,0 +1,55 @@ +# Department 'Security' (7): 수정 +Security/CompoundHash: + Description: When overwriting Object#hash to combine values, prefer delegating to + Array#hash over writing a custom implementation. + Enabled: true + Safe: false + VersionAdded: '1.28' + VersionChanged: '1.51' + +Security/Eval: + Description: The use of eval represents a serious security risk. + Enabled: true + VersionAdded: '0.47' + +# Supports --autocorrect +Security/IoMethods: + Description: Checks for the first argument to `IO.read`, `IO.binread`, `IO.write`, + `IO.binwrite`, `IO.foreach`, and `IO.readlines`. + Enabled: true + Safe: false + VersionAdded: '1.22' + +# Supports --autocorrect +Security/JSONLoad: + Description: Prefer usage of `JSON.parse` over `JSON.load` due to potential security + issues. See reference for more information. + Reference: https://ruby-doc.org/stdlib-2.7.0/libdoc/json/rdoc/JSON.html#method-i-load + Enabled: true + VersionAdded: '0.43' + VersionChanged: '1.22' + SafeAutoCorrect: false + +Security/MarshalLoad: + Description: Avoid using of `Marshal.load` or `Marshal.restore` due to potential security + issues. See reference for more information. + Reference: https://ruby-doc.org/core-2.7.0/Marshal.html#module-Marshal-label-Security+considerations + Enabled: true + VersionAdded: '0.47' + +Security/Open: + Description: The use of `Kernel#open` and `URI.open` represent a serious security + risk. + Enabled: true + VersionAdded: '0.53' + VersionChanged: '1.0' + Safe: false + +# Supports --autocorrect +Security/YAMLLoad: + Description: Prefer usage of `YAML.safe_load` over `YAML.load` due to potential security + issues. See reference for more information. + Reference: https://ruby-doc.org/stdlib-2.7.0/libdoc/yaml/rdoc/YAML.html#module-YAML-label-Security + Enabled: true + VersionAdded: '0.47' + SafeAutoCorrect: false \ No newline at end of file diff --git a/.rubocop_style.yml b/.rubocop_style.yml new file mode 100644 index 0000000..2746345 --- /dev/null +++ b/.rubocop_style.yml @@ -0,0 +1,2540 @@ +# Department 'Style' (264): 미수정 +# Supports --autocorrect +Style/AccessModifierDeclarations: + Description: Checks style of how access modifiers are used. + Enabled: false + VersionAdded: '0.57' + VersionChanged: '0.81' + EnforcedStyle: group + SupportedStyles: + - inline + - group + AllowModifiersOnSymbols: true + AllowModifiersOnAttrs: true + SafeAutoCorrect: false + +# Supports --autocorrect +Style/AccessorGrouping: + Description: Checks for grouping of accessors in `class` and `module` bodies. + Enabled: false + VersionAdded: '0.87' + EnforcedStyle: grouped + SupportedStyles: + - separated + - grouped + +# Supports --autocorrect +Style/Alias: + Description: Use alias instead of alias_method. + StyleGuide: "#alias-method-lexically" + Enabled: false + VersionAdded: '0.9' + VersionChanged: '0.36' + EnforcedStyle: prefer_alias + SupportedStyles: + - prefer_alias + - prefer_alias_method + +# Supports --autocorrect +Style/AndOr: + Description: Use &&/|| instead of and/or. + StyleGuide: "#no-and-or-or" + Enabled: false + SafeAutoCorrect: false + VersionAdded: '0.9' + VersionChanged: '1.21' + EnforcedStyle: conditionals + SupportedStyles: + - always + - conditionals + +# Supports --autocorrect +Style/ArgumentsForwarding: + Description: Use arguments forwarding. + StyleGuide: "#arguments-forwarding" + Enabled: false + # AllowOnlyRestArgument: true + UseAnonymousForwarding: true + RedundantRestArgumentNames: + - args + - arguments + RedundantKeywordRestArgumentNames: + - kwargs + - options + - opts + RedundantBlockArgumentNames: + - blk + - block + - proc + VersionAdded: '1.1' + VersionChanged: '1.58' + +# Supports --autocorrect +Style/ArrayCoercion: + Description: Use Array() instead of explicit Array check or [*var], when dealing with + a variable you want to treat as an Array, but you're not certain it's an array. + StyleGuide: "#array-coercion" + Safe: false + Enabled: false + VersionAdded: '0.88' + +# Supports --autocorrect +Style/ArrayFirstLast: + Description: Use `arr.first` and `arr.last` instead of `arr[0]` and `arr[-1]`. + Reference: "#first-and-last" + Enabled: false + VersionAdded: '1.58' + Safe: false + +# Supports --autocorrect +Style/ArrayIntersect: + Description: Use `array1.intersect?(array2)` instead of `(array1 & array2).any?`. + Enabled: false + Safe: false + VersionAdded: '1.40' + +# Supports --autocorrect +Style/ArrayJoin: + Description: Use Array#join instead of Array#*. + StyleGuide: "#array-join" + Enabled: false + VersionAdded: '0.20' + VersionChanged: '0.31' + +Style/AsciiComments: + Description: Use only ascii symbols in comments. + StyleGuide: "#english-comments" + Enabled: false + VersionAdded: '0.9' + VersionChanged: '1.21' + AllowedChars: + - "©" + +# Supports --autocorrect +Style/Attr: + Description: Checks for uses of Module#attr. + StyleGuide: "#attr" + Enabled: false + VersionAdded: '0.9' + VersionChanged: '0.12' + +Style/AutoResourceCleanup: + Description: Suggests the usage of an auto resource cleanup version of a method (if + available). + Enabled: false + VersionAdded: '0.30' + +# Supports --autocorrect +Style/BarePercentLiterals: + Description: Checks if usage of %() or %Q() matches configuration. + StyleGuide: "#percent-q-shorthand" + Enabled: false + VersionAdded: '0.25' + EnforcedStyle: bare_percent + SupportedStyles: + - percent_q + - bare_percent + +Style/BeginBlock: + Description: Avoid the use of BEGIN blocks. + StyleGuide: "#no-BEGIN-blocks" + Enabled: false + VersionAdded: '0.9' + +# Supports --autocorrect +Style/BisectedAttrAccessor: + Description: Checks for places where `attr_reader` and `attr_writer` for the same + method can be combined into single `attr_accessor`. + Enabled: false + VersionAdded: '0.87' + +# Supports --autocorrect +Style/BlockComments: + Description: Do not use block comments. + StyleGuide: "#no-block-comments" + Enabled: false + VersionAdded: '0.9' + VersionChanged: '0.23' + +# Supports --autocorrect +Style/BlockDelimiters: + Description: Avoid using {...} for multi-line blocks (multiline chaining is always + ugly). Prefer {...} over do...end for single-line blocks. + StyleGuide: "#single-line-blocks" + Enabled: false + VersionAdded: '0.30' + VersionChanged: '0.35' + EnforcedStyle: line_count_based + SupportedStyles: + - line_count_based + - semantic + - braces_for_chaining + - always_braces + ProceduralMethods: + - benchmark + - bm + - bmbm + - create + - each_with_object + - measure + - new + - realtime + - tap + - with_object + FunctionalMethods: + - let + - let! + - subject + - watch + AllowedMethods: + - lambda + - proc + - it + AllowedPatterns: [] + AllowBracesOnProceduralOneLiners: false + BracesRequiredMethods: [] + +# Supports --autocorrect +Style/CaseEquality: + Description: Avoid explicit use of the case equality operator(===). + StyleGuide: "#no-case-equality" + Enabled: false + VersionAdded: '0.9' + VersionChanged: '0.89' + AllowOnConstant: false + AllowOnSelfClass: false + +# Supports --autocorrect +Style/CaseLikeIf: + Description: Identifies places where `if-elsif` constructions can be replaced with + `case-when`. + StyleGuide: "#case-vs-if-else" + Enabled: false + Safe: false + VersionAdded: '0.88' + VersionChanged: '1.48' + MinBranchesCount: 3 + +# Supports --autocorrect +Style/CharacterLiteral: + Description: Checks for uses of character literals. + StyleGuide: "#no-character-literals" + Enabled: false + VersionAdded: '0.9' + +# Supports --autocorrect +Style/ClassAndModuleChildren: + Description: Checks style of children classes and modules. + StyleGuide: "#namespace-definition" + SafeAutoCorrect: false + Enabled: false + VersionAdded: '0.19' + EnforcedStyle: nested + SupportedStyles: + - nested + - compact + +# Supports --autocorrect +Style/ClassCheck: + Description: Enforces consistent use of `Object#is_a?` or `Object#kind_of?`. + StyleGuide: "#is-a-vs-kind-of" + Enabled: false + VersionAdded: '0.24' + EnforcedStyle: is_a? + SupportedStyles: + - is_a? + - kind_of? + +# Supports --autocorrect +Style/ClassEqualityComparison: + Description: Enforces the use of `Object#instance_of?` instead of class comparison + for equality. + StyleGuide: "#instance-of-vs-class-comparison" + Enabled: false + SafeAutoCorrect: false + VersionAdded: '0.93' + VersionChanged: '1.57' + AllowedMethods: + - "==" + - equal? + - eql? + AllowedPatterns: [] + +# Supports --autocorrect +Style/ClassMethods: + Description: Use self when defining module/class methods. + StyleGuide: "#def-self-class-methods" + Enabled: false + VersionAdded: '0.9' + VersionChanged: '0.20' + +# Supports --autocorrect +Style/ClassMethodsDefinitions: + Description: Enforces using `def self.method_name` or `class << self` to define class + methods. + StyleGuide: "#def-self-class-methods" + Enabled: false + VersionAdded: '0.89' + EnforcedStyle: def_self + SupportedStyles: + - def_self + - self_class + +Style/ClassVars: + Description: Avoid the use of class variables. + StyleGuide: "#no-class-vars" + Enabled: false + VersionAdded: '0.13' + +# Supports --autocorrect +Style/CollectionCompact: + Description: Use `{Array,Hash}#{compact,compact!}` instead of custom logic to reject + nils. + Enabled: false + Safe: false + VersionAdded: '1.2' + VersionChanged: '1.3' + AllowedReceivers: + - params + +# Supports --autocorrect +Style/CollectionMethods: + Description: Preferred collection methods. + StyleGuide: "#map-find-select-reduce-include-size" + Enabled: false + VersionAdded: '0.9' + VersionChanged: '1.7' + Safe: false + PreferredMethods: + collect: map + collect!: map! + collect_concat: flat_map + inject: reduce + detect: find + find_all: select + member?: include? + MethodsAcceptingSymbol: + - inject + - reduce + +# Supports --autocorrect +Style/ColonMethodCall: + Description: 'Do not use :: for method call.' + StyleGuide: "#double-colons" + Enabled: true + VersionAdded: '0.9' + +# Supports --autocorrect +Style/ColonMethodDefinition: + Description: 'Do not use :: for defining class methods.' + StyleGuide: "#colon-method-definition" + Enabled: false + VersionAdded: '0.52' + +# Supports --autocorrect +Style/CombinableLoops: + Description: Checks for places where multiple consecutive loops over the same data + can be combined into a single loop. + Enabled: false + Safe: false + VersionAdded: '0.90' + +# Supports --autocorrect +Style/CommandLiteral: + Description: Use `` or %x around command literals. + StyleGuide: "#percent-x" + Enabled: false + VersionAdded: '0.30' + EnforcedStyle: backticks + SupportedStyles: + - backticks + - percent_x + - mixed + AllowInnerBackticks: false + +# Supports --autocorrect +Style/CommentAnnotation: + Description: Checks formatting of special comments (TODO, FIXME, OPTIMIZE, HACK, REVIEW, + NOTE). + StyleGuide: "#annotate-keywords" + Enabled: false + VersionAdded: '0.10' + VersionChanged: '1.20' + Keywords: + - TODO + - FIXME + - OPTIMIZE + - HACK + - REVIEW + - NOTE + RequireColon: true + +# Supports --autocorrect +Style/CommentedKeyword: + Description: Do not place comments on the same line as certain keywords. + Enabled: false + SafeAutoCorrect: false + VersionAdded: '0.51' + VersionChanged: '1.19' + +# Supports --autocorrect +Style/ComparableClamp: + Description: Enforces the use of `Comparable#clamp` instead of comparison by minimum + and maximum. + Enabled: false + VersionAdded: '1.44' + +# Supports --autocorrect +Style/ConcatArrayLiterals: + Description: Enforces the use of `Array#push(item)` instead of `Array#concat([item])` + to avoid redundant array literals. + Enabled: false + Safe: false + VersionAdded: '1.41' + +# Supports --autocorrect +Style/ConditionalAssignment: + Description: Use the return value of `if` and `case` statements for assignment to + a variable and variable comparison instead of assigning that variable inside of + each branch. + Enabled: false + VersionAdded: '0.36' + VersionChanged: '0.47' + EnforcedStyle: assign_to_condition + SupportedStyles: + - assign_to_condition + - assign_inside_condition + SingleLineConditionsOnly: true + IncludeTernaryExpressions: true + +Style/ConstantVisibility: + Description: Check that class- and module constants have visibility declarations. + Enabled: false + VersionAdded: '0.66' + VersionChanged: '1.10' + IgnoreModules: false + +# Supports --autocorrect +Style/Copyright: + Description: Include a copyright notice in each file before any code. + Enabled: false + VersionAdded: '0.30' + Notice: "^Copyright (\\(c\\) )?2[0-9]{3} .+" + AutocorrectNotice: '' + +# Supports --autocorrect +Style/DataInheritance: + Description: Checks for inheritance from Data.define. + StyleGuide: "#no-extend-data-define" + Enabled: false + SafeAutoCorrect: false + VersionAdded: '1.49' + VersionChanged: '1.51' + +# Supports --autocorrect +Style/DateTime: + Description: Use Time over DateTime. + StyleGuide: "#date-time" + Enabled: false + VersionAdded: '0.51' + VersionChanged: '0.92' + SafeAutoCorrect: false + AllowCoercion: false + +# Supports --autocorrect +Style/DefWithParentheses: + Description: Use def with parentheses when there are arguments. + StyleGuide: "#method-parens" + Enabled: true + VersionAdded: '0.9' + VersionChanged: '0.12' + +# Supports --autocorrect +Style/Dir: + Description: Use the `__dir__` method to retrieve the canonicalized absolute path + to the current file. + Enabled: false + VersionAdded: '0.50' + +# Supports --autocorrect +Style/DirEmpty: + Description: Prefer to use `Dir.empty?('path/to/dir')` when checking if a directory + is empty. + Enabled: false + VersionAdded: '1.48' + +# Supports --autocorrect +Style/DisableCopsWithinSourceCodeDirective: + Description: Forbids disabling/enabling cops within source code. + Enabled: false + VersionAdded: '0.82' + VersionChanged: '1.9' + AllowedCops: [] + +Style/DocumentDynamicEvalDefinition: + Description: When using `class_eval` (or other `eval`) with string interpolation, + add a comment block showing its appearance if interpolated. + StyleGuide: "#eval-comment-docs" + Enabled: false + VersionAdded: '1.1' + VersionChanged: '1.3' + +Style/Documentation: + Description: Document classes and non-namespace modules. + Enabled: false + VersionAdded: '0.9' + AllowedConstants: [] + Exclude: + - "/Users/rubyon/Desktop/liaf-rails/spec/**/*" + - "/Users/rubyon/Desktop/liaf-rails/test/**/*" + +Style/DocumentationMethod: + Description: Checks for missing documentation comment for public methods. + Enabled: false + VersionAdded: '0.43' + AllowedMethods: [] + Exclude: + - "/Users/rubyon/Desktop/liaf-rails/spec/**/*" + - "/Users/rubyon/Desktop/liaf-rails/test/**/*" + RequireForNonPublicMethods: false + +# Supports --autocorrect +Style/DoubleCopDisableDirective: + Description: Checks for double rubocop:disable comments on a single line. + Enabled: false + VersionAdded: '0.73' + +# Supports --autocorrect +Style/DoubleNegation: + Description: Checks for uses of double negation (!!). + StyleGuide: "#no-bang-bang" + Enabled: false + VersionAdded: '0.19' + VersionChanged: '1.2' + EnforcedStyle: allowed_in_returns + SafeAutoCorrect: false + SupportedStyles: + - allowed_in_returns + - forbidden + +# Supports --autocorrect +Style/EachForSimpleLoop: + Description: Use `Integer#times` for a simple loop which iterates a fixed number of + times. + Enabled: false + VersionAdded: '0.41' + +# Supports --autocorrect +Style/EachWithObject: + Description: Prefer `each_with_object` over `inject` or `reduce`. + Enabled: false + VersionAdded: '0.22' + VersionChanged: '0.42' + +# Supports --autocorrect +Style/EmptyBlockParameter: + Description: Omit pipes for empty block parameters. + Enabled: false + VersionAdded: '0.52' + +# Supports --autocorrect +Style/EmptyCaseCondition: + Description: Avoid empty condition in case statements. + Enabled: false + VersionAdded: '0.40' + +# Supports --autocorrect +Style/EmptyElse: + Description: Avoid empty else-clauses. + Enabled: false + AutoCorrect: contextual + VersionAdded: '0.28' + VersionChanged: '1.61' + EnforcedStyle: both + SupportedStyles: + - empty + - nil + - both + AllowComments: false + +# Supports --autocorrect +Style/EmptyHeredoc: + Description: Checks for using empty heredoc to reduce redundancy. + Enabled: false + AutoCorrect: contextual + VersionAdded: '1.32' + VersionChanged: '1.61' + +# Supports --autocorrect +Style/EmptyLambdaParameter: + Description: Omit parens for empty lambda parameters. + Enabled: false + VersionAdded: '0.52' + +# Supports --autocorrect +Style/EmptyLiteral: + Description: Prefer literals to Array.new/Hash.new/String.new. + StyleGuide: "#literal-array-hash" + Enabled: false + VersionAdded: '0.9' + VersionChanged: '0.12' + +# Supports --autocorrect +Style/EmptyMethod: + Description: Checks the formatting of empty method definitions. + StyleGuide: "#no-single-line-methods" + Enabled: false + AutoCorrect: contextual + VersionAdded: '0.46' + VersionChanged: '1.61' + EnforcedStyle: compact + SupportedStyles: + - compact + - expanded + +# Supports --autocorrect +Style/Encoding: + Description: Use UTF-8 as the source file encoding. + StyleGuide: "#utf-8" + Enabled: false + VersionAdded: '0.9' + VersionChanged: '0.50' + +# Supports --autocorrect +Style/EndBlock: + Description: Avoid the use of END blocks. + StyleGuide: "#no-END-blocks" + Enabled: false + VersionAdded: '0.9' + VersionChanged: '0.81' + +# Supports --autocorrect +Style/EndlessMethod: + Description: Avoid the use of multi-lined endless method definitions. + StyleGuide: "#endless-methods" + Enabled: false + VersionAdded: '1.8' + EnforcedStyle: allow_single_line + SupportedStyles: + - allow_single_line + - allow_always + - disallow + +# Supports --autocorrect +Style/EnvHome: + Description: Checks for consistent usage of `ENV['HOME']`. + Enabled: false + Safe: false + VersionAdded: '1.29' + +# Supports --autocorrect +Style/EvalWithLocation: + Description: Pass `__FILE__` and `__LINE__` to `eval` method, as they are used by + backtraces. + Enabled: false + VersionAdded: '0.52' + +# Supports --autocorrect +Style/EvenOdd: + Description: Favor the use of `Integer#even?` && `Integer#odd?`. + StyleGuide: "#predicate-methods" + Enabled: false + VersionAdded: '0.12' + VersionChanged: '0.29' + +# Supports --autocorrect +Style/ExactRegexpMatch: + Description: Checks for exact regexp match inside Regexp literals. + Enabled: false + VersionAdded: '1.51' + +# Supports --autocorrect +Style/ExpandPathArguments: + Description: Use `expand_path(__dir__)` instead of `expand_path('..', __FILE__)`. + Enabled: false + VersionAdded: '0.53' + +# Supports --autocorrect +Style/ExplicitBlockArgument: + Description: Consider using explicit block argument to avoid writing block literal + that just passes its arguments to another block. + StyleGuide: "#block-argument" + Enabled: false + VersionAdded: '0.89' + VersionChanged: '1.8' + +Style/ExponentialNotation: + Description: When using exponential notation, favor a mantissa between 1 (inclusive) + and 10 (exclusive). + StyleGuide: "#exponential-notation" + Enabled: false + VersionAdded: '0.82' + EnforcedStyle: scientific + SupportedStyles: + - scientific + - engineering + - integral + +# Supports --autocorrect +Style/FetchEnvVar: + Description: Suggests `ENV.fetch` for the replacement of `ENV[]`. + Reference: + - https://rubystyle.guide/#hash-fetch-defaults + Enabled: false + VersionAdded: '1.28' + AllowedVars: [] + +# Supports --autocorrect +Style/FileEmpty: + Description: Prefer to use `File.empty?('path/to/file')` when checking if a file is + empty. + Enabled: false + Safe: false + VersionAdded: '1.48' + +# Supports --autocorrect +Style/FileRead: + Description: Favor `File.(bin)read` convenience methods. + StyleGuide: "#file-read" + Enabled: false + VersionAdded: '1.24' + +# Supports --autocorrect +Style/FileWrite: + Description: Favor `File.(bin)write` convenience methods. + StyleGuide: "#file-write" + Enabled: false + VersionAdded: '1.24' + +# Supports --autocorrect +Style/FloatDivision: + Description: For performing float division, coerce one side only. + StyleGuide: "#float-division" + Reference: https://blog.rubystyle.guide/ruby/2019/06/21/float-division.html + Enabled: false + VersionAdded: '0.72' + VersionChanged: '1.9' + Safe: false + EnforcedStyle: single_coerce + SupportedStyles: + - left_coerce + - right_coerce + - single_coerce + - fdiv + +# Supports --autocorrect +Style/For: + Description: Checks use of for or each in multiline loops. + StyleGuide: "#no-for-loops" + Enabled: false + SafeAutoCorrect: false + VersionAdded: '0.13' + VersionChanged: '1.26' + EnforcedStyle: each + SupportedStyles: + - each + - for + +# Supports --autocorrect +Style/FormatString: + Description: Enforce the use of Kernel#sprintf, Kernel#format or String#%. + StyleGuide: "#sprintf" + Enabled: false + VersionAdded: '0.19' + VersionChanged: '0.49' + EnforcedStyle: format + SupportedStyles: + - format + - sprintf + - percent + +# Supports --autocorrect +Style/FormatStringToken: + Description: Use a consistent style for format string tokens. + Enabled: false + EnforcedStyle: annotated + SupportedStyles: + - annotated + - template + - unannotated + MaxUnannotatedPlaceholdersAllowed: 1 + VersionAdded: '0.49' + VersionChanged: '1.0' + AllowedMethods: + - redirect + AllowedPatterns: [] + +# Supports --autocorrect +Style/FrozenStringLiteralComment: + Description: Add the frozen_string_literal comment to the top of files to help transition + to frozen string literals by default. + Enabled: false + VersionAdded: '0.36' + VersionChanged: '0.79' + EnforcedStyle: always + SupportedStyles: + - always + - always_true + - never + SafeAutoCorrect: false + +# Supports --autocorrect +Style/GlobalStdStream: + Description: Enforces the use of `$stdout/$stderr/$stdin` instead of `STDOUT/STDERR/STDIN`. + StyleGuide: "#global-stdout" + Enabled: false + VersionAdded: '0.89' + SafeAutoCorrect: false + +Style/GlobalVars: + Description: Do not introduce global variables. + StyleGuide: "#instance-vars" + Reference: https://www.zenspider.com/ruby/quickref.html + Enabled: false + VersionAdded: '0.13' + AllowedVariables: [] + +# Supports --autocorrect +Style/GuardClause: + Description: Check for conditionals that can be replaced with guard clauses. + StyleGuide: "#no-nested-conditionals" + Enabled: false + VersionAdded: '0.20' + VersionChanged: '1.31' + MinBodyLength: 1 + AllowConsecutiveConditionals: false + +# Supports --autocorrect +Style/HashAsLastArrayItem: + Description: Checks for presence or absence of braces around hash literal as a last + array item depending on configuration. + StyleGuide: "#hash-literal-as-last-array-item" + Enabled: false + VersionAdded: '0.88' + EnforcedStyle: braces + SupportedStyles: + - braces + - no_braces + +# Supports --autocorrect +Style/HashConversion: + Description: Avoid Hash[] in favor of ary.to_h or literal hashes. + StyleGuide: "#avoid-hash-constructor" + Enabled: false + SafeAutoCorrect: false + VersionAdded: '1.10' + VersionChanged: '1.55' + AllowSplatArgument: true + +# Supports --autocorrect +Style/HashEachMethods: + Description: Use Hash#each_key and Hash#each_value. + StyleGuide: "#hash-each" + Enabled: false + Safe: false + VersionAdded: '0.80' + VersionChanged: '1.16' + AllowedReceivers: + - Thread.current + +# Supports --autocorrect +Style/HashExcept: + Description: Checks for usages of `Hash#reject`, `Hash#select`, and `Hash#filter` + methods that can be replaced with `Hash#except` method. + Enabled: false + Safe: false + VersionAdded: '1.7' + VersionChanged: '1.39' + +Style/HashLikeCase: + Description: Checks for places where `case-when` represents a simple 1:1 mapping and + can be replaced with a hash lookup. + Enabled: false + VersionAdded: '0.88' + MinBranchesCount: 3 + +# Supports --autocorrect +Style/HashSyntax: + Description: 'Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax { :a => 1, + :b => 2 }.' + StyleGuide: "#hash-literals" + Enabled: true + VersionAdded: '0.9' + VersionChanged: '1.24' + EnforcedStyle: ruby19 + SupportedStyles: + - ruby19 + - hash_rockets + - no_mixed_keys + - ruby19_no_mixed_keys + EnforcedShorthandSyntax: either + SupportedShorthandSyntax: + - always + - never + - either + - consistent + - either_consistent + UseHashRocketsWithSymbolValues: false + PreferHashRocketsForNonAlnumEndingSymbols: false + +# Supports --autocorrect +Style/HashTransformKeys: + Description: Prefer `transform_keys` over `each_with_object`, `map`, or `to_h`. + Enabled: false + VersionAdded: '0.80' + VersionChanged: '0.90' + Safe: false + +# Supports --autocorrect +Style/HashTransformValues: + Description: Prefer `transform_values` over `each_with_object`, `map`, or `to_h`. + Enabled: false + VersionAdded: '0.80' + VersionChanged: '0.90' + Safe: false + +# Supports --autocorrect +Style/IdenticalConditionalBranches: + Description: Checks that conditional statements do not have an identical line at the + end of each branch, which can validly be moved out of the conditional. + Enabled: false + SafeAutoCorrect: false + VersionAdded: '0.36' + VersionChanged: '1.19' + +# Supports --autocorrect +Style/IfInsideElse: + Description: Finds if nodes inside else, which can be converted to elsif. + Enabled: false + AllowIfModifier: false + VersionAdded: '0.36' + VersionChanged: '1.3' + +# Supports --autocorrect +Style/IfUnlessModifier: + Description: Favor modifier if/unless usage when you have a single-line body. + StyleGuide: "#if-as-a-modifier" + Enabled: false + VersionAdded: '0.9' + VersionChanged: '0.30' + +# Supports --autocorrect +Style/IfUnlessModifierOfIfUnless: + Description: Avoid modifier if/unless usage on conditionals. + Enabled: false + VersionAdded: '0.39' + VersionChanged: '0.87' + +# Supports --autocorrect +Style/IfWithBooleanLiteralBranches: + Description: Checks for redundant `if` with boolean literal branches. + Enabled: false + VersionAdded: '1.9' + SafeAutoCorrect: false + AllowedMethods: + - nonzero? + +# Supports --autocorrect +Style/IfWithSemicolon: + Description: Do not use if x; .... Use the ternary operator instead. + StyleGuide: "#no-semicolon-ifs" + Enabled: false + VersionAdded: '0.9' + VersionChanged: '0.83' + +Style/ImplicitRuntimeError: + Description: Use `raise` or `fail` with an explicit exception class and message, rather + than just a message. + Enabled: false + VersionAdded: '0.41' + +# Supports --autocorrect +Style/InPatternThen: + Description: Checks for `in;` uses in `case` expressions. + StyleGuide: "#no-in-pattern-semicolons" + Enabled: false + VersionAdded: '1.16' + +# Supports --autocorrect +Style/InfiniteLoop: + Description: Use Kernel#loop for infinite loops. This cop is unsafe if the body may + raise a `StopIteration` exception. + Safe: false + StyleGuide: "#infinite-loop" + Enabled: false + VersionAdded: '0.26' + VersionChanged: '0.61' + +Style/InlineComment: + Description: Avoid trailing inline comments. + Enabled: false + VersionAdded: '0.23' + +# Supports --autocorrect +Style/InverseMethods: + Description: Use the inverse method instead of `!.method` if an inverse method is + defined. + Enabled: false + Safe: false + VersionAdded: '0.48' + InverseMethods: + :any?: :none? + :even?: :odd? + :==: :!= + :=~: :!~ + :<: :>= + :>: :<= + InverseBlocks: + :select: :reject + :select!: :reject! + +# Supports --autocorrect +Style/InvertibleUnlessCondition: + Description: Favor `if` with inverted condition over `unless`. + Enabled: false + Safe: false + VersionAdded: '1.44' + VersionChanged: '1.50' + InverseMethods: + :!=: :== + :>: :<= + :<=: :> + :<: :>= + :>=: :< + :!~: :=~ + :zero?: :nonzero? + :nonzero?: :zero? + :any?: :none? + :none?: :any? + :even?: :odd? + :odd?: :even? + :present?: :blank? + :blank?: :present? + :include?: :exclude? + :exclude?: :include? + +Style/IpAddresses: + Description: Don't include literal IP addresses in code. + Enabled: false + VersionAdded: '0.58' + VersionChanged: '0.91' + AllowedAddresses: + - "::" + Exclude: + - "/Users/rubyon/Desktop/liaf-rails/**/*.gemfile" + - "/Users/rubyon/Desktop/liaf-rails/**/Gemfile" + - "/Users/rubyon/Desktop/liaf-rails/**/gems.rb" + - "/Users/rubyon/Desktop/liaf-rails/**/*.gemspec" + +# Supports --autocorrect +Style/KeywordParametersOrder: + Description: Enforces that optional keyword parameters are placed at the end of the + parameters list. + StyleGuide: "#keyword-parameters-order" + Enabled: false + VersionAdded: '0.90' + VersionChanged: '1.7' + +# Supports --autocorrect +Style/Lambda: + Description: Use the new lambda literal syntax for single-line blocks. + StyleGuide: "#lambda-multi-line" + Enabled: false + VersionAdded: '0.9' + VersionChanged: '0.40' + EnforcedStyle: line_count_dependent + SupportedStyles: + - line_count_dependent + - lambda + - literal + +# Supports --autocorrect +Style/LambdaCall: + Description: Use lambda.call(...) instead of lambda.(...). + StyleGuide: "#proc-call" + Enabled: false + VersionAdded: '0.13' + VersionChanged: '0.14' + EnforcedStyle: call + SupportedStyles: + - call + - braces + +# Supports --autocorrect +Style/LineEndConcatenation: + Description: Use \ instead of + or << to concatenate two string literals at line end. + Enabled: false + SafeAutoCorrect: false + VersionAdded: '0.18' + VersionChanged: '0.64' + +# Supports --autocorrect +Style/MagicCommentFormat: + Description: Use a consistent style for magic comments. + Enabled: false + VersionAdded: '1.35' + EnforcedStyle: snake_case + SupportedStyles: + - snake_case + - kebab_case + DirectiveCapitalization: lowercase + ValueCapitalization: + SupportedCapitalizations: + - lowercase + - uppercase + +# Supports --autocorrect +Style/MapCompactWithConditionalBlock: + Description: Prefer `select` or `reject` over `map { ... }.compact`. + Enabled: false + VersionAdded: '1.30' + +# Supports --autocorrect +Style/MapIntoArray: + Description: Checks for usages of `each` with `<<`, `push`, or `append` which can + be replaced by `map`. + StyleGuide: "#functional-code" + Enabled: false + VersionAdded: '1.63' + Safe: false + +# Supports --autocorrect +Style/MapToHash: + Description: Prefer `to_h` with a block over `map.to_h`. + Enabled: false + VersionAdded: '1.24' + Safe: false + +# Supports --autocorrect +Style/MapToSet: + Description: Prefer `to_set` with a block over `map.to_set`. + Enabled: false + Safe: false + VersionAdded: '1.42' + +# Supports --autocorrect +Style/MethodCallWithArgsParentheses: + Description: Use parentheses for method calls with arguments. + StyleGuide: "#method-invocation-parens" + Enabled: false + VersionAdded: '0.47' + VersionChanged: '1.7' + IgnoreMacros: true + AllowedMethods: [] + AllowedPatterns: [] + IncludedMacros: [] + AllowParenthesesInMultilineCall: false + AllowParenthesesInChaining: false + AllowParenthesesInCamelCaseMethod: false + AllowParenthesesInStringInterpolation: false + EnforcedStyle: require_parentheses + SupportedStyles: + - require_parentheses + - omit_parentheses + +# Supports --autocorrect +Style/MethodCallWithoutArgsParentheses: + Description: Do not use parentheses for method calls with no arguments. + StyleGuide: "#method-invocation-parens" + Enabled: false + AllowedMethods: [] + AllowedPatterns: [] + VersionAdded: '0.47' + VersionChanged: '0.55' + +Style/MethodCalledOnDoEndBlock: + Description: Avoid chaining a method call on a do...end block. + StyleGuide: "#single-line-blocks" + Enabled: false + VersionAdded: '0.14' + +# Supports --autocorrect +Style/MethodDefParentheses: + Description: Checks if the method definitions have or don't have parentheses. + StyleGuide: "#method-parens" + Enabled: true + VersionAdded: '0.16' + VersionChanged: '1.7' + EnforcedStyle: require_parentheses + SupportedStyles: + - require_parentheses + - require_no_parentheses + - require_no_parentheses_except_multiline + +# Supports --autocorrect +Style/MinMax: + Description: Use `Enumerable#minmax` instead of `Enumerable#min` and `Enumerable#max` + in conjunction. + Enabled: false + VersionAdded: '0.50' + +# Supports --autocorrect +Style/MinMaxComparison: + Description: Enforces the use of `max` or `min` instead of comparison for greater + or less. + Enabled: false + Safe: false + VersionAdded: '1.42' + +# Supports --autocorrect +Style/MissingElse: + Description: Require if/case expressions to have an else branches. If enabled, it + is recommended that Style/UnlessElse and Style/EmptyElse be enabled. This will conflict + with Style/EmptyElse if Style/EmptyElse is configured to style "both". + Enabled: false + VersionAdded: '0.30' + VersionChanged: '0.38' + EnforcedStyle: both + SupportedStyles: + - if + - case + - both + +Style/MissingRespondToMissing: + Description: Checks if `method_missing` is implemented without implementing `respond_to_missing`. + StyleGuide: "#no-method-missing" + Enabled: false + VersionAdded: '0.56' + +# Supports --autocorrect +Style/MixinGrouping: + Description: Checks for grouping of mixins in `class` and `module` bodies. + StyleGuide: "#mixin-grouping" + Enabled: false + VersionAdded: '0.48' + VersionChanged: '0.49' + EnforcedStyle: separated + SupportedStyles: + - separated + - grouped + +Style/MixinUsage: + Description: Checks that `include`, `extend` and `prepend` exists at the top level. + Enabled: false + VersionAdded: '0.51' + +# Supports --autocorrect +Style/ModuleFunction: + Description: Checks for usage of `extend self` in modules. + StyleGuide: "#module-function" + Enabled: false + VersionAdded: '0.11' + VersionChanged: '0.65' + EnforcedStyle: module_function + SupportedStyles: + - module_function + - extend_self + - forbidden + Autocorrect: false + SafeAutoCorrect: false + +Style/MultilineBlockChain: + Description: Avoid multi-line chains of blocks. + StyleGuide: "#single-line-blocks" + Enabled: false + VersionAdded: '0.13' + +# Supports --autocorrect +Style/MultilineIfModifier: + Description: Only use if/unless modifiers on single line statements. + StyleGuide: "#no-multiline-if-modifiers" + Enabled: false + VersionAdded: '0.45' + +# Supports --autocorrect +Style/MultilineIfThen: + Description: Do not use then for multi-line if/unless. + StyleGuide: "#no-then" + Enabled: false + VersionAdded: '0.9' + VersionChanged: '0.26' + +# Supports --autocorrect +Style/MultilineInPatternThen: + Description: Do not use `then` for multi-line `in` statement. + StyleGuide: "#no-then" + Enabled: false + VersionAdded: '1.16' + +# Supports --autocorrect +Style/MultilineMemoization: + Description: Wrap multiline memoizations in a `begin` and `end` block. + Enabled: false + VersionAdded: '0.44' + VersionChanged: '0.48' + EnforcedStyle: keyword + SupportedStyles: + - keyword + - braces + +# Supports --autocorrect +Style/MultilineMethodSignature: + Description: Avoid multi-line method signatures. + Enabled: false + VersionAdded: '0.59' + VersionChanged: '1.7' + +# Supports --autocorrect +Style/MultilineTernaryOperator: + Description: 'Avoid multi-line ?: (the ternary operator); use if/unless instead.' + StyleGuide: "#no-multiline-ternary" + Enabled: false + VersionAdded: '0.9' + VersionChanged: '0.86' + +# Supports --autocorrect +Style/MultilineWhenThen: + Description: Do not use then for multi-line when statement. + StyleGuide: "#no-then" + Enabled: false + VersionAdded: '0.73' + +# Supports --autocorrect +Style/MultipleComparison: + Description: Avoid comparing a variable with multiple items in a conditional, use + Array#include? instead. + Enabled: false + VersionAdded: '0.49' + VersionChanged: '1.1' + AllowMethodComparison: true + ComparisonsThreshold: 2 + +# Supports --autocorrect +Style/MutableConstant: + Description: Do not assign mutable objects to constants. + Enabled: false + VersionAdded: '0.34' + VersionChanged: '1.8' + SafeAutoCorrect: false + EnforcedStyle: literals + SupportedStyles: + - literals + - strict + +# Supports --autocorrect +Style/NegatedIf: + Description: Favor unless over if for negative conditions (or control flow or). + StyleGuide: "#unless-for-negatives" + Enabled: false + VersionAdded: '0.20' + VersionChanged: '0.48' + EnforcedStyle: both + SupportedStyles: + - both + - prefix + - postfix + +# Supports --autocorrect +Style/NegatedIfElseCondition: + Description: Checks for uses of `if-else` and ternary operators with a negated condition + which can be simplified by inverting condition and swapping branches. + Enabled: false + VersionAdded: '1.2' + +# Supports --autocorrect +Style/NegatedUnless: + Description: Favor if over unless for negative conditions. + StyleGuide: "#if-for-negatives" + Enabled: false + VersionAdded: '0.69' + EnforcedStyle: both + SupportedStyles: + - both + - prefix + - postfix + +# Supports --autocorrect +Style/NegatedWhile: + Description: Favor until over while for negative conditions. + StyleGuide: "#until-for-negatives" + Enabled: false + VersionAdded: '0.20' + +# Supports --autocorrect +Style/NestedFileDirname: + Description: Checks for nested `File.dirname`. + Enabled: false + VersionAdded: '1.26' + +# Supports --autocorrect +Style/NestedModifier: + Description: Avoid using nested modifiers. + StyleGuide: "#no-nested-modifiers" + Enabled: false + VersionAdded: '0.35' + +# Supports --autocorrect +Style/NestedParenthesizedCalls: + Description: Parenthesize method calls which are nested inside the argument list of + another parenthesized method call. + Enabled: false + VersionAdded: '0.36' + VersionChanged: '0.77' + AllowedMethods: + - be + - be_a + - be_an + - be_between + - be_falsey + - be_kind_of + - be_instance_of + - be_truthy + - be_within + - eq + - eql + - end_with + - include + - match + - raise_error + - respond_to + - start_with + +# Supports --autocorrect +Style/NestedTernaryOperator: + Description: Use one expression per branch in a ternary operator. + StyleGuide: "#no-nested-ternary" + Enabled: false + VersionAdded: '0.9' + VersionChanged: '0.86' + +# Supports --autocorrect +Style/Next: + Description: Use `next` to skip iteration instead of a condition at the end. + StyleGuide: "#no-nested-conditionals" + Enabled: false + VersionAdded: '0.22' + VersionChanged: '0.35' + EnforcedStyle: skip_modifier_ifs + MinBodyLength: 3 + SupportedStyles: + - skip_modifier_ifs + - always + +# Supports --autocorrect +Style/NilComparison: + Description: Prefer x.nil? to x == nil. + StyleGuide: "#predicate-methods" + Enabled: false + VersionAdded: '0.12' + VersionChanged: '0.59' + EnforcedStyle: predicate + SupportedStyles: + - predicate + - comparison + +# Supports --autocorrect +Style/NilLambda: + Description: Prefer `-> {}` to `-> { nil }`. + Enabled: false + VersionAdded: '1.3' + VersionChanged: '1.15' + +# Supports --autocorrect +Style/NonNilCheck: + Description: Checks for redundant nil checks. + StyleGuide: "#no-non-nil-checks" + Enabled: false + VersionAdded: '0.20' + VersionChanged: '0.22' + IncludeSemanticChanges: false + +# Supports --autocorrect +Style/Not: + Description: Use ! instead of not. + StyleGuide: "#bang-not-not" + Enabled: false + VersionAdded: '0.9' + VersionChanged: '0.20' + +Style/NumberedParameters: + Description: Restrict the usage of numbered parameters. + Enabled: false + VersionAdded: '1.22' + EnforcedStyle: allow_single_line + SupportedStyles: + - allow_single_line + - disallow + +Style/NumberedParametersLimit: + Description: Avoid excessive numbered params in a single block. + Enabled: false + VersionAdded: '1.22' + Max: 1 + +# Supports --autocorrect +Style/NumericLiteralPrefix: + Description: Use smallcase prefixes for numeric literals. + StyleGuide: "#numeric-literal-prefixes" + Enabled: false + VersionAdded: '0.41' + EnforcedOctalStyle: zero_with_o + SupportedOctalStyles: + - zero_with_o + - zero_only + +# Supports --autocorrect +Style/NumericLiterals: + Description: Add underscores to large numeric literals to improve their readability. + StyleGuide: "#underscores-in-numerics" + Enabled: false + VersionAdded: '0.9' + VersionChanged: '0.48' + MinDigits: 5 + Strict: false + AllowedNumbers: [] + AllowedPatterns: [] + +# Supports --autocorrect +Style/NumericPredicate: + Description: Checks for the use of predicate- or comparison methods for numeric comparisons. + StyleGuide: "#predicate-methods" + Safe: false + Enabled: false + VersionAdded: '0.42' + VersionChanged: '0.59' + EnforcedStyle: predicate + SupportedStyles: + - predicate + - comparison + AllowedMethods: [] + AllowedPatterns: [] + Exclude: + - "/Users/rubyon/Desktop/liaf-rails/spec/**/*" + +# Supports --autocorrect +Style/ObjectThen: + Description: Enforces the use of consistent method names `Object#yield_self` or `Object#then`. + StyleGuide: "#object-yield-self-vs-object-then" + Enabled: false + VersionAdded: '1.28' + EnforcedStyle: then + SupportedStyles: + - then + - yield_self + +# Supports --autocorrect +Style/OneLineConditional: + Description: Favor the ternary operator (?:) or multi-line constructs over single-line + if/then/else/end constructs. + StyleGuide: "#ternary-operator" + Enabled: false + AlwaysCorrectToMultiline: false + VersionAdded: '0.9' + VersionChanged: '0.90' + +Style/OpenStructUse: + Description: Avoid using OpenStruct. As of Ruby 3.0, use is officially discouraged + due to performance, version compatibility, and potential security issues. + Reference: + - https://docs.ruby-lang.org/en/3.0.0/OpenStruct.html#class-OpenStruct-label-Caveats + Enabled: false + Safe: false + VersionAdded: '1.23' + VersionChanged: '1.51' + +# Supports --autocorrect +Style/OperatorMethodCall: + Description: Checks for redundant dot before operator method call. + StyleGuide: "#operator-method-call" + Enabled: false + VersionAdded: '1.37' + +Style/OptionHash: + Description: Don't use option hashes when you can use keyword arguments. + StyleGuide: "#keyword-arguments-vs-option-hashes" + Enabled: false + VersionAdded: '0.33' + VersionChanged: '0.34' + SuspiciousParamNames: + - options + - opts + - args + - params + - parameters + Allowlist: [] + +Style/OptionalArguments: + Description: Checks for optional arguments that do not appear at the end of the argument + list. + StyleGuide: "#optional-arguments" + Enabled: false + Safe: false + VersionAdded: '0.33' + VersionChanged: '0.83' + +Style/OptionalBooleanParameter: + Description: Use keyword arguments when defining method with boolean argument. + StyleGuide: "#boolean-keyword-arguments" + Enabled: false + Safe: false + VersionAdded: '0.89' + AllowedMethods: + - respond_to_missing? + +# Supports --autocorrect +Style/OrAssignment: + Description: Recommend usage of double pipe equals (||=) where applicable. + StyleGuide: "#double-pipe-for-uninit" + Enabled: false + VersionAdded: '0.50' + +# Supports --autocorrect +Style/ParallelAssignment: + Description: Check for simple usages of parallel assignment. It will only warn when + the number of variables matches on both sides of the assignment. + StyleGuide: "#parallel-assignment" + Enabled: false + VersionAdded: '0.32' + +# Supports --autocorrect +Style/ParenthesesAroundCondition: + Description: Don't use parentheses around the condition of an if/unless/while. + StyleGuide: "#no-parens-around-condition" + Enabled: true + VersionAdded: '0.9' + VersionChanged: '0.56' + AllowSafeAssignment: true + AllowInMultilineConditions: false + +# Supports --autocorrect +Style/PercentLiteralDelimiters: + Description: Use `%`-literal delimiters consistently. + StyleGuide: "#percent-literal-braces" + Enabled: true + VersionAdded: '0.19' + PreferredDelimiters: + default: "()" + "%i": "[]" + "%I": "[]" + "%r": "{}" + "%w": "[]" + "%W": "[]" + VersionChanged: '0.48' + +# Supports --autocorrect +Style/PercentQLiterals: + Description: Checks if uses of %Q/%q match the configured preference. + Enabled: false + VersionAdded: '0.25' + EnforcedStyle: lower_case_q + SupportedStyles: + - lower_case_q + - upper_case_q + +# Supports --autocorrect +Style/PerlBackrefs: + Description: Avoid Perl-style regex back references. + StyleGuide: "#no-perl-regexp-last-matchers" + Enabled: false + VersionAdded: '0.13' + +# Supports --autocorrect +Style/PreferredHashMethods: + Description: Checks use of `has_key?` and `has_value?` Hash methods. + StyleGuide: "#hash-key" + Enabled: false + Safe: false + VersionAdded: '0.41' + VersionChanged: '0.70' + EnforcedStyle: short + SupportedStyles: + - short + - verbose + +# Supports --autocorrect +Style/Proc: + Description: Use proc instead of Proc.new. + StyleGuide: "#proc" + Enabled: false + VersionAdded: '0.9' + VersionChanged: '0.18' + +# Supports --autocorrect +Style/QuotedSymbols: + Description: Use a consistent style for quoted symbols. + Enabled: false + VersionAdded: '1.16' + EnforcedStyle: same_as_string_literals + SupportedStyles: + - same_as_string_literals + - single_quotes + - double_quotes + +# Supports --autocorrect +Style/RaiseArgs: + Description: Checks the arguments passed to raise/fail. + StyleGuide: "#exception-class-messages" + Enabled: false + Safe: false + VersionAdded: '0.14' + VersionChanged: '1.61' + EnforcedStyle: exploded + SupportedStyles: + - compact + - exploded + AllowedCompactTypes: [] + +# Supports --autocorrect +Style/RandomWithOffset: + Description: Prefer to use ranges when generating random numbers instead of integers + with offsets. + StyleGuide: "#random-numbers" + Enabled: false + VersionAdded: '0.52' + +# Supports --autocorrect +Style/RedundantArgument: + Description: Check for a redundant argument passed to certain methods. + Enabled: false + Safe: false + VersionAdded: '1.4' + VersionChanged: '1.55' + Methods: + join: '' + sum: 0 + exit: true + exit!: false + split: " " + chomp: "\n" + chomp!: "\n" + +# Supports --autocorrect +Style/RedundantArrayConstructor: + Description: Checks for the instantiation of array using redundant `Array` constructor. + Enabled: false + VersionAdded: '1.52' + +# Supports --autocorrect +Style/RedundantAssignment: + Description: Checks for redundant assignment before returning. + Enabled: false + VersionAdded: '0.87' + +# Supports --autocorrect +Style/RedundantBegin: + Description: Don't use begin blocks when they are not needed. + StyleGuide: "#begin-implicit" + Enabled: false + VersionAdded: '0.10' + VersionChanged: '0.21' + +# Supports --autocorrect +Style/RedundantCapitalW: + Description: Checks for %W when interpolation is not needed. + Enabled: false + VersionAdded: '0.76' + +# Supports --autocorrect +Style/RedundantCondition: + Description: Checks for unnecessary conditional expressions. + Enabled: false + VersionAdded: '0.76' + +# Supports --autocorrect +Style/RedundantConditional: + Description: Don't return true/false from a conditional. + Enabled: false + VersionAdded: '0.50' + +# Supports --autocorrect +Style/RedundantConstantBase: + Description: Avoid redundant `::` prefix on constant. + Enabled: false + VersionAdded: '1.40' + +# Supports --autocorrect +Style/RedundantCurrentDirectoryInPath: + Description: Checks for uses a redundant current directory in path. + Enabled: false + VersionAdded: '1.53' + +# Supports --autocorrect +Style/RedundantDoubleSplatHashBraces: + Description: Checks for redundant uses of double splat hash braces. + Enabled: false + VersionAdded: '1.41' + +# Supports --autocorrect +Style/RedundantEach: + Description: Checks for redundant `each`. + Enabled: false + Safe: false + VersionAdded: '1.38' + +# Supports --autocorrect +Style/RedundantException: + Description: Checks for an obsolete RuntimeException argument in raise/fail. + StyleGuide: "#no-explicit-runtimeerror" + Enabled: false + VersionAdded: '0.14' + VersionChanged: '0.29' + +# Supports --autocorrect +Style/RedundantFetchBlock: + Description: Use `fetch(key, value)` instead of `fetch(key) { value }` when value + has Numeric, Rational, Complex, Symbol or String type, `false`, `true`, `nil` or + is a constant. + Reference: https://github.com/fastruby/fast-ruby#hashfetch-with-argument-vs-hashfetch--block-code + Enabled: false + Safe: false + SafeForConstants: false + VersionAdded: '0.86' + +# Supports --autocorrect +Style/RedundantFileExtensionInRequire: + Description: Checks for the presence of superfluous `.rb` extension in the filename + provided to `require` and `require_relative`. + StyleGuide: "#no-explicit-rb-to-require" + Enabled: false + VersionAdded: '0.88' + +# Supports --autocorrect +Style/RedundantFilterChain: + Description: Identifies usages of `any?`, `empty?`, `none?` or `one?` predicate methods + chained to `select`/`filter`/`find_all` and change them to use predicate method + instead. + Enabled: false + SafeAutoCorrect: false + VersionAdded: '1.52' + VersionChanged: '1.57' + +# Supports --autocorrect +Style/RedundantFreeze: + Description: Checks usages of Object#freeze on immutable objects. + Enabled: false + VersionAdded: '0.34' + VersionChanged: '0.66' + +# Supports --autocorrect +Style/RedundantHeredocDelimiterQuotes: + Description: Checks for redundant heredoc delimiter quotes. + Enabled: false + VersionAdded: '1.45' + +# Supports --autocorrect +Style/RedundantInitialize: + Description: Checks for redundant `initialize` methods. + Enabled: false + AutoCorrect: contextual + Safe: false + AllowComments: true + VersionAdded: '1.27' + VersionChanged: '1.61' + +# Supports --autocorrect +Style/RedundantInterpolation: + Description: Checks for strings that are just an interpolated expression. + Enabled: false + SafeAutoCorrect: false + VersionAdded: '0.76' + VersionChanged: '1.30' + +# Supports --autocorrect +Style/RedundantInterpolationUnfreeze: + Description: Checks for redundant unfreezing of interpolated strings. + Enabled: false + VersionAdded: '1.66' + +# Supports --autocorrect +Style/RedundantLineContinuation: + Description: Check for redundant line continuation. + Enabled: false + VersionAdded: '1.49' + +# Supports --autocorrect +Style/RedundantParentheses: + Description: Checks for parentheses that seem not to serve any purpose. + Enabled: false + VersionAdded: '0.36' + +# Supports --autocorrect +Style/RedundantPercentQ: + Description: Checks for %q/%Q when single quotes or double quotes would do. + StyleGuide: "#percent-q" + Enabled: false + VersionAdded: '0.76' + +# Supports --autocorrect +Style/RedundantRegexpArgument: + Description: Identifies places where argument can be replaced from a deterministic + regexp to a string. + Enabled: false + VersionAdded: '1.53' + +# Supports --autocorrect +Style/RedundantRegexpCharacterClass: + Description: Checks for unnecessary single-element Regexp character classes. + Enabled: false + VersionAdded: '0.85' + +# Supports --autocorrect +Style/RedundantRegexpConstructor: + Description: Checks for the instantiation of regexp using redundant `Regexp.new` or + `Regexp.compile`. + Enabled: false + VersionAdded: '1.52' + +# Supports --autocorrect +Style/RedundantRegexpEscape: + Description: Checks for redundant escapes in Regexps. + Enabled: false + VersionAdded: '0.85' + +# Supports --autocorrect +Style/RedundantReturn: + Description: Don't use return where it's not required. + StyleGuide: "#no-explicit-return" + Enabled: true + VersionAdded: '0.10' + VersionChanged: '0.14' + AllowMultipleReturnValues: true + +# Supports --autocorrect +Style/RedundantSelf: + Description: Don't use self where it's not needed. + StyleGuide: "#no-self-unless-required" + Enabled: false + VersionAdded: '0.10' + VersionChanged: '0.13' + +# Supports --autocorrect +Style/RedundantSelfAssignment: + Description: Checks for places where redundant assignments are made for in place modification + methods. + Enabled: false + Safe: false + VersionAdded: '0.90' + +# Supports --autocorrect +Style/RedundantSelfAssignmentBranch: + Description: Checks for places where conditional branch makes redundant self-assignment. + Enabled: false + VersionAdded: '1.19' + +# Supports --autocorrect +Style/RedundantSort: + Description: Use `min` instead of `sort.first`, `max_by` instead of `sort_by...last`, + etc. + Enabled: false + VersionAdded: '0.76' + VersionChanged: '1.22' + Safe: false + +# Supports --autocorrect +Style/RedundantSortBy: + Description: Use `sort` instead of `sort_by { |x| x }`. + Enabled: false + VersionAdded: '0.36' + +# Supports --autocorrect +Style/RedundantStringEscape: + Description: Checks for redundant escapes in string literals. + Enabled: false + VersionAdded: '1.37' + +# Supports --autocorrect +Style/RegexpLiteral: + Description: Use / or %r around regular expressions. + StyleGuide: "#percent-r" + Enabled: false + VersionAdded: '0.9' + VersionChanged: '0.30' + EnforcedStyle: slashes + SupportedStyles: + - slashes + - percent_r + - mixed + AllowInnerSlashes: false + +# Supports --autocorrect +Style/RequireOrder: + Description: Sort `require` and `require_relative` in alphabetical order. + Enabled: false + SafeAutoCorrect: false + VersionAdded: '1.40' + +# Supports --autocorrect +Style/RescueModifier: + Description: Avoid using rescue in its modifier form. + StyleGuide: "#no-rescue-modifiers" + Enabled: false + VersionAdded: '0.9' + VersionChanged: '0.34' + +# Supports --autocorrect +Style/RescueStandardError: + Description: Avoid rescuing without specifying an error class. + Enabled: false + VersionAdded: '0.52' + EnforcedStyle: explicit + SupportedStyles: + - implicit + - explicit + +# Supports --autocorrect +Style/ReturnNil: + Description: Use return instead of return nil. + Enabled: false + EnforcedStyle: return + SupportedStyles: + - return + - return_nil + VersionAdded: '0.50' + +# Supports --autocorrect +Style/ReturnNilInPredicateMethodDefinition: + Description: Checks if uses of `return` or `return nil` in predicate method definition. + StyleGuide: "#bool-methods-qmark" + Enabled: false + SafeAutoCorrect: false + AllowedMethods: [] + AllowedPatterns: [] + VersionAdded: '1.53' + +# Supports --autocorrect +Style/SafeNavigation: + Description: Transforms usages of a method call safeguarded by a check for the existence + of the object to safe navigation (`&.`). Autocorrection is unsafe as it assumes + the object will be `nil` or truthy, but never `false`. + Enabled: false + VersionAdded: '0.43' + VersionChanged: '1.27' + ConvertCodeThatCanStartToReturnNil: false + AllowedMethods: + - present? + - blank? + - presence + - try + - try! + SafeAutoCorrect: false + MaxChainLength: 2 + +# Supports --autocorrect +Style/Sample: + Description: Use `sample` instead of `shuffle.first`, `shuffle.last`, and `shuffle[Integer]`. + Reference: https://github.com/fastruby/fast-ruby#arrayshufflefirst-vs-arraysample-code + Enabled: false + VersionAdded: '0.30' + +# Supports --autocorrect +Style/SelectByRegexp: + Description: Prefer grep/grep_v to select/reject with a regexp match. + Enabled: false + SafeAutoCorrect: false + VersionAdded: '1.22' + +# Supports --autocorrect +Style/SelfAssignment: + Description: Checks for places where self-assignment shorthand should have been used. + StyleGuide: "#self-assignment" + Enabled: false + VersionAdded: '0.19' + VersionChanged: '0.29' + +# Supports --autocorrect +Style/Semicolon: + Description: Don't use semicolons to terminate expressions. + StyleGuide: "#no-semicolon" + Enabled: true + VersionAdded: '0.9' + VersionChanged: '0.19' + AllowAsExpressionSeparator: true + +Style/Send: + Description: Prefer `Object#__send__` or `Object#public_send` to `send`, as `send` + may overlap with existing methods. + StyleGuide: "#prefer-public-send" + Enabled: false + VersionAdded: '0.33' + +# Supports --autocorrect +Style/SendWithLiteralMethodName: + Description: Detects the use of the `public_send` method with a static method name + argument. + Enabled: false + Safe: false + AllowSend: true + VersionAdded: '1.64' + +# Supports --autocorrect +Style/SignalException: + Description: Checks for proper usage of fail and raise. + StyleGuide: "#prefer-raise-over-fail" + Enabled: false + VersionAdded: '0.11' + VersionChanged: '0.37' + EnforcedStyle: only_raise + SupportedStyles: + - only_raise + - only_fail + - semantic + +# Supports --autocorrect +Style/SingleArgumentDig: + Description: Avoid using single argument dig method. + Enabled: false + VersionAdded: '0.89' + Safe: false + +# Supports --autocorrect +Style/SingleLineBlockParams: + Description: Enforces the names of some block params. + Enabled: false + VersionAdded: '0.16' + VersionChanged: '1.6' + Methods: + - reduce: + - acc + - elem + - inject: + - acc + - elem + +# Supports --autocorrect +Style/SingleLineDoEndBlock: + Description: Checks for single-line `do`...`end` blocks. + StyleGuide: "#single-line-do-end-block" + Enabled: false + VersionAdded: '1.57' + +# Supports --autocorrect +Style/SingleLineMethods: + Description: Avoid single-line methods. + StyleGuide: "#no-single-line-methods" + Enabled: false + VersionAdded: '0.9' + VersionChanged: '1.8' + AllowIfMethodIsEmpty: true + +# Supports --autocorrect +Style/SlicingWithRange: + Description: Checks array slicing is done with redundant, endless, and beginless ranges + when suitable. + StyleGuide: "#slicing-with-ranges" + Enabled: false + VersionAdded: '0.83' + Safe: false + +# Supports --autocorrect +Style/SoleNestedConditional: + Description: Finds sole nested conditional nodes which can be merged into outer conditional + node. + Enabled: false + VersionAdded: '0.89' + VersionChanged: '1.5' + AllowModifier: false + +# Supports --autocorrect +Style/SpecialGlobalVars: + Description: Avoid Perl-style global variables. + StyleGuide: "#no-cryptic-perlisms" + Enabled: false + VersionAdded: '0.13' + VersionChanged: '0.36' + SafeAutoCorrect: false + RequireEnglish: true + EnforcedStyle: use_english_names + SupportedStyles: + - use_perl_names + - use_english_names + - use_builtin_english_names + +# Supports --autocorrect +Style/StabbyLambdaParentheses: + Description: Check for the usage of parentheses around stabby lambda arguments. + StyleGuide: "#stabby-lambda-with-args" + Enabled: true + VersionAdded: '0.35' + EnforcedStyle: require_parentheses + SupportedStyles: + - require_parentheses + - require_no_parentheses + +# Supports --autocorrect +Style/StaticClass: + Description: Prefer modules to classes with only class methods. + StyleGuide: "#modules-vs-classes" + Enabled: false + Safe: false + VersionAdded: '1.3' + +# Supports --autocorrect +Style/StderrPuts: + Description: Use `warn` instead of `$stderr.puts`. + StyleGuide: "#warn" + Enabled: false + VersionAdded: '0.51' + +# Supports --autocorrect +Style/StringChars: + Description: Checks for uses of `String#split` with empty string or regexp literal + argument. + StyleGuide: "#string-chars" + Enabled: false + Safe: false + VersionAdded: '1.12' + +# Supports --autocorrect +Style/StringConcatenation: + Description: Checks for places where string concatenation can be replaced with string + interpolation. + StyleGuide: "#string-interpolation" + Enabled: false + Safe: false + VersionAdded: '0.89' + VersionChanged: '1.18' + Mode: aggressive + +# Supports --autocorrect +Style/StringHashKeys: + Description: Prefer symbols instead of strings as hash keys. + StyleGuide: "#symbols-as-keys" + Enabled: false + VersionAdded: '0.52' + VersionChanged: '0.75' + Safe: false + +# Supports --autocorrect +Style/StringLiterals: + Description: Checks if uses of quotes match the configured preference. + StyleGuide: "#consistent-string-literals" + Enabled: true + VersionAdded: '0.9' + VersionChanged: '0.36' + EnforcedStyle: double_quotes + SupportedStyles: + - single_quotes + - double_quotes + ConsistentQuotesInMultiline: false + Include: + - app/**/* + - config/**/* + - lib/**/* + - test/**/* + - Gemfile + +# Supports --autocorrect +Style/StringLiteralsInInterpolation: + Description: Checks if uses of quotes inside expressions in interpolated strings match + the configured preference. + Enabled: false + VersionAdded: '0.27' + EnforcedStyle: single_quotes + SupportedStyles: + - single_quotes + - double_quotes + +# Supports --autocorrect +Style/StringMethods: + Description: Checks if configured preferred methods are used over non-preferred. + Enabled: false + VersionAdded: '0.34' + VersionChanged: '0.34' + PreferredMethods: + intern: to_sym + +# Supports --autocorrect +Style/Strip: + Description: Use `strip` instead of `lstrip.rstrip`. + Enabled: false + VersionAdded: '0.36' + +# Supports --autocorrect +Style/StructInheritance: + Description: Checks for inheritance from Struct.new. + StyleGuide: "#no-extend-struct-new" + Enabled: false + SafeAutoCorrect: false + VersionAdded: '0.29' + VersionChanged: '1.20' + +# Supports --autocorrect +Style/SuperArguments: + Description: Call `super` without arguments and parentheses when the signature is + identical. + Enabled: false + VersionAdded: '1.64' + +# Supports --autocorrect +Style/SuperWithArgsParentheses: + Description: Use parentheses for `super` with arguments. + StyleGuide: "#super-with-args" + Enabled: false + VersionAdded: '1.58' + +# Supports --autocorrect +Style/SwapValues: + Description: Enforces the use of shorthand-style swapping of 2 variables. + StyleGuide: "#values-swapping" + Enabled: false + VersionAdded: '1.1' + SafeAutoCorrect: false + +# Supports --autocorrect +Style/SymbolArray: + Description: Use %i or %I for arrays of symbols. + StyleGuide: "#percent-i" + Enabled: false + VersionAdded: '0.9' + VersionChanged: '0.49' + EnforcedStyle: percent + MinSize: 2 + SupportedStyles: + - percent + - brackets + +# Supports --autocorrect +Style/SymbolLiteral: + Description: Use plain symbols instead of string symbols when possible. + Enabled: false + VersionAdded: '0.30' + +# Supports --autocorrect +Style/SymbolProc: + Description: Use symbols as procs instead of blocks when possible. + Enabled: false + Safe: false + VersionAdded: '0.26' + VersionChanged: '1.64' + AllowMethodsWithArguments: false + AllowedMethods: + - define_method + - mail + - respond_to + AllowedPatterns: [] + AllowComments: false + +# Supports --autocorrect +Style/TernaryParentheses: + Description: Checks for use of parentheses around ternary conditions. + Enabled: false + VersionAdded: '0.42' + VersionChanged: '0.46' + EnforcedStyle: require_no_parentheses + SupportedStyles: + - require_parentheses + - require_no_parentheses + - require_parentheses_when_complex + AllowSafeAssignment: true + +Style/TopLevelMethodDefinition: + Description: Looks for top-level method definitions. + StyleGuide: "#top-level-methods" + Enabled: false + VersionAdded: '1.15' + +# Supports --autocorrect +Style/TrailingBodyOnClass: + Description: Class body goes below class statement. + Enabled: false + VersionAdded: '0.53' + +# Supports --autocorrect +Style/TrailingBodyOnMethodDefinition: + Description: Method body goes below definition. + Enabled: false + VersionAdded: '0.52' + +# Supports --autocorrect +Style/TrailingBodyOnModule: + Description: Module body goes below module statement. + Enabled: false + VersionAdded: '0.53' + +# Supports --autocorrect +Style/TrailingCommaInArguments: + Description: Checks for trailing comma in argument lists. + StyleGuide: "#no-trailing-params-comma" + Enabled: false + VersionAdded: '0.36' + EnforcedStyleForMultiline: no_comma + SupportedStylesForMultiline: + - comma + - consistent_comma + - no_comma + +# Supports --autocorrect +Style/TrailingCommaInArrayLiteral: + Description: Checks for trailing comma in array literals. + StyleGuide: "#no-trailing-array-commas" + Enabled: true + VersionAdded: '0.53' + EnforcedStyleForMultiline: no_comma + SupportedStylesForMultiline: + - comma + - consistent_comma + - no_comma + +# Supports --autocorrect +Style/TrailingCommaInBlockArgs: + Description: Checks for useless trailing commas in block arguments. + Enabled: false + Safe: false + VersionAdded: '0.81' + +# Supports --autocorrect +Style/TrailingCommaInHashLiteral: + Description: Checks for trailing comma in hash literals. + Enabled: true + EnforcedStyleForMultiline: no_comma + SupportedStylesForMultiline: + - comma + - consistent_comma + - no_comma + VersionAdded: '0.53' + +# Supports --autocorrect +Style/TrailingMethodEndStatement: + Description: Checks for trailing end statement on line of method body. + Enabled: false + VersionAdded: '0.52' + +# Supports --autocorrect +Style/TrailingUnderscoreVariable: + Description: Checks for the usage of unneeded trailing underscores at the end of parallel + variable assignment. + AllowNamedUnderscoreVariables: true + Enabled: false + VersionAdded: '0.31' + VersionChanged: '0.35' + +# Supports --autocorrect +Style/TrivialAccessors: + Description: Prefer attr_* methods to trivial readers/writers. + StyleGuide: "#attr_family" + Enabled: false + VersionAdded: '0.9' + VersionChanged: '1.15' + ExactNameMatch: true + AllowPredicates: true + AllowDSLWriters: true + IgnoreClassMethods: false + AllowedMethods: + - to_ary + - to_a + - to_c + - to_enum + - to_h + - to_hash + - to_i + - to_int + - to_io + - to_open + - to_path + - to_proc + - to_r + - to_regexp + - to_str + - to_s + - to_sym + +# Supports --autocorrect +Style/UnlessElse: + Description: Do not use unless with else. Rewrite these with the positive case first. + StyleGuide: "#no-else-with-unless" + Enabled: false + VersionAdded: '0.9' + +Style/UnlessLogicalOperators: + Description: Checks for use of logical operators in an unless condition. + Enabled: false + VersionAdded: '1.11' + EnforcedStyle: forbid_mixed_logical_operators + SupportedStyles: + - forbid_mixed_logical_operators + - forbid_logical_operators + +# Supports --autocorrect +Style/UnpackFirst: + Description: Checks for accessing the first element of `String#unpack` instead of + using `unpack1`. + Enabled: false + VersionAdded: '0.54' + +# Supports --autocorrect +Style/VariableInterpolation: + Description: Don't interpolate global, instance and class variables directly in strings. + StyleGuide: "#curlies-interpolate" + Enabled: false + VersionAdded: '0.9' + VersionChanged: '0.20' + +# Supports --autocorrect +Style/WhenThen: + Description: Use when x then ... for one-line cases. + StyleGuide: "#no-when-semicolons" + Enabled: false + VersionAdded: '0.9' + +# Supports --autocorrect +Style/WhileUntilDo: + Description: Checks for redundant do after while or until. + StyleGuide: "#no-multiline-while-do" + Enabled: false + VersionAdded: '0.9' + +# Supports --autocorrect +Style/WhileUntilModifier: + Description: Favor modifier while/until usage when you have a single-line body. + StyleGuide: "#while-as-a-modifier" + Enabled: false + VersionAdded: '0.9' + VersionChanged: '0.30' + +# Supports --autocorrect +Style/WordArray: + Description: Use %w or %W for arrays of words. + StyleGuide: "#percent-w" + Enabled: false + VersionAdded: '0.9' + VersionChanged: '1.19' + EnforcedStyle: percent + SupportedStyles: + - percent + - brackets + MinSize: 2 + WordRegex: !ruby/regexp /\A(?:\p{Word}|\p{Word}-\p{Word}|\n|\t)+\z/ + +# Supports --autocorrect +Style/YAMLFileRead: + Description: Checks for the use of `YAML.load`, `YAML.safe_load`, and `YAML.parse` + with `File.read` argument. + Enabled: false + VersionAdded: '1.53' + +# Supports --autocorrect +Style/YodaCondition: + Description: Forbid or enforce yoda conditions. + Reference: https://en.wikipedia.org/wiki/Yoda_conditions + Enabled: false + EnforcedStyle: forbid_for_all_comparison_operators + SupportedStyles: + - forbid_for_all_comparison_operators + - forbid_for_equality_operators_only + - require_for_all_comparison_operators + - require_for_equality_operators_only + Safe: false + VersionAdded: '0.49' + VersionChanged: '0.75' + +# Supports --autocorrect +Style/YodaExpression: + Description: Forbid the use of yoda expressions. + Enabled: false + Safe: false + VersionAdded: '1.42' + VersionChanged: '1.43' + SupportedOperators: + - "*" + - "+" + - "&" + - "|" + - "^" + +# Supports --autocorrect +Style/ZeroLengthPredicate: + Description: 'Use #empty? when testing for objects of length 0.' + Enabled: false + Safe: false + VersionAdded: '0.37' + VersionChanged: '0.39' \ No newline at end of file diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..4d9d11c --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.4.2 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e37b6bf --- /dev/null +++ b/Dockerfile @@ -0,0 +1,86 @@ +# syntax=docker/dockerfile:1 +# check=error=true + +# This Dockerfile is designed for production, not development. Use with Kamal or build'n'run by hand: +# docker build -t farmitry_hvac . +# docker run -d -p 80:80 -e RAILS_MASTER_KEY= --name farmitry_hvac farmitry_hvac + +# For a containerized dev environment, see Dev Containers: https://guides.rubyonrails.org/getting_started_with_devcontainer.html + +# Make sure RUBY_VERSION matches the Ruby version in .ruby-version +ARG RUBY_VERSION=3.4.2 +FROM docker.io/library/ruby:$RUBY_VERSION-slim AS base + +# Rails app lives here +WORKDIR /rails + +# Install base packages +RUN apt-get update -qq && \ + apt-get install --no-install-recommends -y curl libjemalloc2 libvips sqlite3 && \ + rm -rf /var/lib/apt/lists /var/cache/apt/archives + +# Set production environment +ENV RAILS_ENV="production" \ + BUNDLE_DEPLOYMENT="1" \ + BUNDLE_PATH="/usr/local/bundle" \ + BUNDLE_WITHOUT="development" + +# Throw-away build stage to reduce size of final image +FROM base AS build + +# Install packages needed to build gems and node modules +RUN apt-get update -qq && \ + apt-get install --no-install-recommends -y build-essential git libyaml-dev node-gyp pkg-config python-is-python3 && \ + rm -rf /var/lib/apt/lists /var/cache/apt/archives + +# Install JavaScript dependencies +ARG NODE_VERSION=23.10.0 +ARG YARN_VERSION=1.22.22 +ENV PATH=/usr/local/node/bin:$PATH +RUN curl -sL https://github.com/nodenv/node-build/archive/master.tar.gz | tar xz -C /tmp/ && \ + /tmp/node-build-master/bin/node-build "${NODE_VERSION}" /usr/local/node && \ + npm install -g yarn@$YARN_VERSION && \ + rm -rf /tmp/node-build-master + +# Install application gems +COPY Gemfile Gemfile.lock ./ +RUN bundle install && \ + rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git && \ + bundle exec bootsnap precompile --gemfile + +# Install node modules +COPY package.json yarn.lock ./ +RUN yarn install --immutable + +# Copy application code +COPY . . + +# Precompile bootsnap code for faster boot times +RUN bundle exec bootsnap precompile app/ lib/ + +# Precompiling assets for production without requiring secret RAILS_MASTER_KEY +RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile + + +RUN rm -rf node_modules + + +# Final stage for app image +FROM base + +# Copy built artifacts: gems, application +COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}" +COPY --from=build /rails /rails + +# Run and own only the runtime files as a non-root user for security +RUN groupadd --system --gid 1000 rails && \ + useradd rails --uid 1000 --gid 1000 --create-home --shell /bin/bash && \ + chown -R rails:rails db log storage tmp +USER 1000:1000 + +# Entrypoint prepares the database. +ENTRYPOINT ["/rails/bin/docker-entrypoint"] + +# Start server via Thruster by default, this can be overwritten at runtime +EXPOSE 80 +CMD ["./bin/thrust", "./bin/rails", "server"] diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..67a82f2 --- /dev/null +++ b/Gemfile @@ -0,0 +1,72 @@ +source "https://rubygems.org" + +# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" +gem "rails", "~> 8.0.2" +# The modern asset pipeline for Rails [https://github.com/rails/propshaft] +gem "propshaft" +# Use sqlite3 as the database for Active Record +gem "sqlite3", ">= 2.1" +# Use the Puma web server [https://github.com/puma/puma] +gem "puma", ">= 5.0" +# Bundle and transpile JavaScript [https://github.com/rails/jsbundling-rails] +gem "jsbundling-rails" +# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev] +gem "turbo-rails" +# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev] +gem "stimulus-rails" +# Bundle and process CSS [https://github.com/rails/cssbundling-rails] +gem "cssbundling-rails" +# Build JSON APIs with ease [https://github.com/rails/jbuilder] +gem "jbuilder" + +# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword] +# gem "bcrypt", "~> 3.1.7" + +# Windows does not include zoneinfo files, so bundle the tzinfo-data gem +gem "tzinfo-data", platforms: %i[ windows jruby ] + +# Use the database-backed adapters for Rails.cache, Active Job, and Action Cable +gem "solid_cable" +gem "solid_cache" +gem "solid_queue" + +# Reduces boot times through caching; required in config/boot.rb +gem "bootsnap", require: false + +# Deploy this application anywhere as a Docker container [https://kamal-deploy.org] +gem "kamal", require: false + +# Add HTTP asset caching/compression and X-Sendfile acceleration to Puma [https://github.com/basecamp/thruster/] +gem "thruster", require: false + +# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images] +# gem "image_processing", "~> 1.2" + +group :development, :test do + # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem + gem "debug", platforms: %i[ mri windows ], require: "debug/prelude" + + # Static analysis for security vulnerabilities [https://brakemanscanner.org/] + gem "brakeman", require: false + + # Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/] + gem "rubocop-rails-omakase", require: false + + gem "amazing_print", require: false + gem "erb_lint", require: false +end + +group :development do + # Use console on exceptions pages [https://github.com/rails/web-console] + gem "web-console" + + gem "foreman" +end + +group :test do + # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing] + gem "capybara" + gem "selenium-webdriver" +end + +gem "rmodbus" diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..3d31fa1 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,414 @@ +GEM + remote: https://rubygems.org/ + specs: + actioncable (8.0.2) + actionpack (= 8.0.2) + activesupport (= 8.0.2) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + zeitwerk (~> 2.6) + actionmailbox (8.0.2) + actionpack (= 8.0.2) + activejob (= 8.0.2) + activerecord (= 8.0.2) + activestorage (= 8.0.2) + activesupport (= 8.0.2) + mail (>= 2.8.0) + actionmailer (8.0.2) + actionpack (= 8.0.2) + actionview (= 8.0.2) + activejob (= 8.0.2) + activesupport (= 8.0.2) + mail (>= 2.8.0) + rails-dom-testing (~> 2.2) + actionpack (8.0.2) + actionview (= 8.0.2) + activesupport (= 8.0.2) + nokogiri (>= 1.8.5) + rack (>= 2.2.4) + rack-session (>= 1.0.1) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actiontext (8.0.2) + actionpack (= 8.0.2) + activerecord (= 8.0.2) + activestorage (= 8.0.2) + activesupport (= 8.0.2) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (8.0.2) + activesupport (= 8.0.2) + builder (~> 3.1) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (8.0.2) + activesupport (= 8.0.2) + globalid (>= 0.3.6) + activemodel (8.0.2) + activesupport (= 8.0.2) + activerecord (8.0.2) + activemodel (= 8.0.2) + activesupport (= 8.0.2) + timeout (>= 0.4.0) + activestorage (8.0.2) + actionpack (= 8.0.2) + activejob (= 8.0.2) + activerecord (= 8.0.2) + activesupport (= 8.0.2) + marcel (~> 1.0) + activesupport (8.0.2) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + amazing_print (1.7.2) + ast (2.4.3) + base64 (0.2.0) + bcrypt_pbkdf (1.1.1) + benchmark (0.4.0) + better_html (2.1.1) + actionview (>= 6.0) + activesupport (>= 6.0) + ast (~> 2.0) + erubi (~> 1.4) + parser (>= 2.4) + smart_properties + bigdecimal (3.1.9) + bindex (0.8.1) + bootsnap (1.18.4) + msgpack (~> 1.2) + brakeman (7.0.2) + racc + builder (3.3.0) + capybara (3.40.0) + addressable + matrix + mini_mime (>= 0.1.3) + nokogiri (~> 1.11) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (>= 1.5, < 3.0) + xpath (~> 3.2) + concurrent-ruby (1.3.5) + connection_pool (2.5.0) + crass (1.0.6) + cssbundling-rails (1.4.3) + railties (>= 6.0.0) + date (3.4.1) + debug (1.10.0) + irb (~> 1.10) + reline (>= 0.3.8) + digest-crc (0.7.0) + rake (>= 12.0.0, < 14.0.0) + dotenv (3.1.8) + drb (2.2.1) + ed25519 (1.3.0) + erb_lint (0.9.0) + activesupport + better_html (>= 2.0.1) + parser (>= 2.7.1.4) + rainbow + rubocop (>= 1) + smart_properties + erubi (1.13.1) + et-orbi (1.2.11) + tzinfo + foreman (0.88.1) + fugit (1.11.1) + et-orbi (~> 1, >= 1.2.11) + raabro (~> 1.4) + globalid (1.2.1) + activesupport (>= 6.1) + i18n (1.14.7) + concurrent-ruby (~> 1.0) + io-console (0.8.0) + irb (1.15.2) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + jbuilder (2.13.0) + actionview (>= 5.0.0) + activesupport (>= 5.0.0) + jsbundling-rails (1.3.1) + railties (>= 6.0.0) + json (2.10.2) + kamal (2.5.3) + activesupport (>= 7.0) + base64 (~> 0.2) + bcrypt_pbkdf (~> 1.0) + concurrent-ruby (~> 1.2) + dotenv (~> 3.1) + ed25519 (~> 1.2) + net-ssh (~> 7.3) + sshkit (>= 1.23.0, < 2.0) + thor (~> 1.3) + zeitwerk (>= 2.6.18, < 3.0) + language_server-protocol (3.17.0.4) + lint_roller (1.1.0) + logger (1.7.0) + loofah (2.24.0) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + mail (2.8.1) + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.0.4) + matrix (0.4.2) + mini_mime (1.1.5) + minitest (5.25.5) + msgpack (1.8.0) + net-imap (0.5.6) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-scp (4.1.0) + net-ssh (>= 2.6.5, < 8.0.0) + net-sftp (4.0.0) + net-ssh (>= 5.0.0, < 8.0.0) + net-smtp (0.5.1) + net-protocol + net-ssh (7.3.0) + nio4r (2.7.4) + nokogiri (1.18.7-aarch64-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.7-aarch64-linux-musl) + racc (~> 1.4) + nokogiri (1.18.7-arm-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.7-arm-linux-musl) + racc (~> 1.4) + nokogiri (1.18.7-arm64-darwin) + racc (~> 1.4) + nokogiri (1.18.7-x86_64-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.7-x86_64-linux-musl) + racc (~> 1.4) + ostruct (0.6.1) + parallel (1.27.0) + parser (3.3.8.0) + ast (~> 2.4.1) + racc + pp (0.6.2) + prettyprint + prettyprint (0.2.0) + prism (1.4.0) + propshaft (1.1.0) + actionpack (>= 7.0.0) + activesupport (>= 7.0.0) + rack + railties (>= 7.0.0) + psych (5.2.3) + date + stringio + public_suffix (6.0.1) + puma (6.6.0) + nio4r (~> 2.0) + raabro (1.4.0) + racc (1.8.1) + rack (3.1.13) + rack-session (2.1.0) + base64 (>= 0.1.0) + rack (>= 3.0.0) + rack-test (2.2.0) + rack (>= 1.3) + rackup (2.2.1) + rack (>= 3) + rails (8.0.2) + actioncable (= 8.0.2) + actionmailbox (= 8.0.2) + actionmailer (= 8.0.2) + actionpack (= 8.0.2) + actiontext (= 8.0.2) + actionview (= 8.0.2) + activejob (= 8.0.2) + activemodel (= 8.0.2) + activerecord (= 8.0.2) + activestorage (= 8.0.2) + activesupport (= 8.0.2) + bundler (>= 1.15.0) + railties (= 8.0.2) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.2) + loofah (~> 2.21) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + railties (8.0.2) + actionpack (= 8.0.2) + activesupport (= 8.0.2) + irb (~> 1.13) + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) + rainbow (3.1.1) + rake (13.2.1) + rdoc (6.13.1) + psych (>= 4.0.0) + regexp_parser (2.10.0) + reline (0.6.1) + io-console (~> 0.5) + rexml (3.4.1) + rmodbus (2.1.3) + digest-crc (~> 0.1) + rubocop (1.75.2) + json (~> 2.3) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.44.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.44.1) + parser (>= 3.3.7.2) + prism (~> 1.4) + rubocop-performance (1.25.0) + lint_roller (~> 1.1) + rubocop (>= 1.75.0, < 2.0) + rubocop-ast (>= 1.38.0, < 2.0) + rubocop-rails (2.31.0) + activesupport (>= 4.2.0) + lint_roller (~> 1.1) + rack (>= 1.1) + rubocop (>= 1.75.0, < 2.0) + rubocop-ast (>= 1.38.0, < 2.0) + rubocop-rails-omakase (1.1.0) + rubocop (>= 1.72) + rubocop-performance (>= 1.24) + rubocop-rails (>= 2.30) + ruby-progressbar (1.13.0) + rubyzip (2.4.1) + securerandom (0.4.1) + selenium-webdriver (4.31.0) + base64 (~> 0.2) + logger (~> 1.4) + rexml (~> 3.2, >= 3.2.5) + rubyzip (>= 1.2.2, < 3.0) + websocket (~> 1.0) + smart_properties (1.17.0) + solid_cable (3.0.7) + actioncable (>= 7.2) + activejob (>= 7.2) + activerecord (>= 7.2) + railties (>= 7.2) + solid_cache (1.0.7) + activejob (>= 7.2) + activerecord (>= 7.2) + railties (>= 7.2) + solid_queue (1.1.4) + activejob (>= 7.1) + activerecord (>= 7.1) + concurrent-ruby (>= 1.3.1) + fugit (~> 1.11.0) + railties (>= 7.1) + thor (~> 1.3.1) + sqlite3 (2.6.0-aarch64-linux-gnu) + sqlite3 (2.6.0-aarch64-linux-musl) + sqlite3 (2.6.0-arm-linux-gnu) + sqlite3 (2.6.0-arm-linux-musl) + sqlite3 (2.6.0-arm64-darwin) + sqlite3 (2.6.0-x86_64-linux-gnu) + sqlite3 (2.6.0-x86_64-linux-musl) + sshkit (1.24.0) + base64 + logger + net-scp (>= 1.1.2) + net-sftp (>= 2.1.2) + net-ssh (>= 2.8.0) + ostruct + stimulus-rails (1.3.4) + railties (>= 6.0.0) + stringio (3.1.6) + thor (1.3.2) + thruster (0.1.12) + thruster (0.1.12-aarch64-linux) + thruster (0.1.12-arm64-darwin) + thruster (0.1.12-x86_64-linux) + timeout (0.4.3) + turbo-rails (2.0.13) + actionpack (>= 7.1.0) + railties (>= 7.1.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (3.1.4) + unicode-emoji (~> 4.0, >= 4.0.4) + unicode-emoji (4.0.4) + uri (1.0.3) + useragent (0.16.11) + web-console (4.2.1) + actionview (>= 6.0.0) + activemodel (>= 6.0.0) + bindex (>= 0.4.0) + railties (>= 6.0.0) + websocket (1.2.11) + websocket-driver (0.7.7) + base64 + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + xpath (3.2.0) + nokogiri (~> 1.8) + zeitwerk (2.7.2) + +PLATFORMS + aarch64-linux + aarch64-linux-gnu + aarch64-linux-musl + arm-linux-gnu + arm-linux-musl + arm64-darwin-24 + x86_64-linux + x86_64-linux-gnu + x86_64-linux-musl + +DEPENDENCIES + amazing_print + bootsnap + brakeman + capybara + cssbundling-rails + debug + erb_lint + foreman + jbuilder + jsbundling-rails + kamal + propshaft + puma (>= 5.0) + rails (~> 8.0.2) + rmodbus + rubocop-rails-omakase + selenium-webdriver + solid_cable + solid_cache + solid_queue + sqlite3 (>= 2.1) + stimulus-rails + thruster + turbo-rails + tzinfo-data + web-console + +BUNDLED WITH + 2.6.6 diff --git a/Procfile.dev b/Procfile.dev new file mode 100644 index 0000000..e1dcb3c --- /dev/null +++ b/Procfile.dev @@ -0,0 +1,3 @@ +web: env RUBY_DEBUG_OPEN=true bin/rails server -b 0.0.0.0 +js: yarn build --watch +css: yarn build:css --watch diff --git a/README.md b/README.md new file mode 100644 index 0000000..7db80e4 --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +# README + +This README would normally document whatever steps are necessary to get the +application up and running. + +Things you may want to cover: + +* Ruby version + +* System dependencies + +* Configuration + +* Database creation + +* Database initialization + +* How to run the test suite + +* Services (job queues, cache servers, search engines, etc.) + +* Deployment instructions + +* ... diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..9a5ea73 --- /dev/null +++ b/Rakefile @@ -0,0 +1,6 @@ +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require_relative "config/application" + +Rails.application.load_tasks diff --git a/app/assets/builds/.keep b/app/assets/builds/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/assets/images/.keep b/app/assets/images/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/assets/stylesheets/application.tailwind.css b/app/assets/stylesheets/application.tailwind.css new file mode 100644 index 0000000..ade35dc --- /dev/null +++ b/app/assets/stylesheets/application.tailwind.css @@ -0,0 +1,184 @@ +@import "tailwindcss"; + +@theme { + --color-default: rgb(226, 232, 240); + --color-defaultSlate: rgb(100, 116, 139); + --color-defaultSlateDark: rgb(71, 85, 105); + --color-primary: rgb(66, 165, 245); + --color-notice: rgb(19, 198, 154); + --color-warning: rgb(255, 202, 40); + --color-accept: rgb(121, 134, 203); + --color-danger: rgb(239, 83, 80); + --color-tableBorder: rgb(203, 213, 225); + + --base-font-size: 0.85rem; + --text-xs: calc(var(--base-font-size) * 0.75); + --text-xs--line-height: calc(1 / var(--text-xs)); + --text-sm: calc(var(--base-font-size) * 0.875); + --text-sm--line-height: calc(1.25 / var(--text-sm)); + --text-base: calc(var(--base-font-size) * 1); + --text-base--line-height: calc(1.5 / var(--text-base)); + --text-lg: calc(var(--base-font-size) * 1.125); + --text-lg--line-height: calc(1.75 / var(--text-lg)); + --text-xl: calc(var(--base-font-size) * 1.25); + --text-xl--line-height: calc(1.75 / var(--text-xl)); + --text-2xl: calc(var(--base-font-size) * 1.5); + --text-2xl--line-height: calc(2 / var(--text-2xl)); + --text-3xl: calc(var(--base-font-size) * 1.875); + --text-3xl--line-height: calc(2.25 / var(--text-3xl)); + --text-4xl: calc(var(--base-font-size) * 2.25); + --text-4xl--line-height: calc(2.5 / var(--text-4xl)); + --text-5xl: calc(var(--base-font-size) * 3); + --text-5xl--line-height: 1; + --text-6xl: calc(var(--base-font-size) * 3.75); + --text-6xl--line-height: 1; + --text-7xl: calc(var(--base-font-size) * 4.5); + --text-7xl--line-height: 1; + --text-8xl: calc(var(--base-font-size) * 6); + --text-8xl--line-height: 1; + --text-9xl: calc(var(--base-font-size) * 8); + --text-9xl--line-height: 1; +} + +@layer base { + body { + @apply text-sm text-defaultSlateDark + } + + hr { + @apply border-tableBorder + } + + a.disabled { + @apply pointer-events-none cursor-not-allowed opacity-50 + } + + .disabled { + @apply pointer-events-none cursor-not-allowed opacity-50 + } + + .btn { + @apply justify-center rounded-xs bg-defaultSlate px-2 py-0.5 text-sm font-semibold leading-6 text-white + shadow-xs hover:opacity-80 cursor-pointer + } + + .card { + @apply bg-white border border-tableBorder rounded-xs shadow-xs + } + + /*Form*/ + .label-style { + @apply block my-1 font-bold text-defaultSlateDark + } + + .select-style { + @apply block w-full h-8 px-3 py-1.5 border border-defaultSlate/50 rounded-xs + } + + .input-style { + @apply block w-full h-8 px-3 py-1.5 border border-defaultSlate/50 rounded-xs + } + + .textarea-style { + @apply block w-full pl-4 flex-1 py-1.5 ring-1 ring-inset ring-defaultSlate/50 rounded-xs + } +} + +@layer utilities { + .page-title { + @apply text-xl font-bold; + } + + .search-title { + @apply text-base font-bold; + } + + .form-title { + @apply text-center text-3xl font-bold tracking-tight text-defaultSlateDark + } + + .field { + @apply w-full + } + + .btn-edit { + @apply inline-flex items-center rounded-xs px-2.5 py-1.5 text-sm font-semibold hover:opacity-75 disabled:cursor-not-allowed disabled:opacity-30 disabled:hover:bg-white + } + + /*Menu*/ + .menu-group { + @apply py-2 px-4 + } + + .menu-group-title { + @apply py-1 text-sm text-defaultSlateDark font-medium + } + + .menu-group-items { + @apply p-1 + } + + .menu-group-items-title { + @apply text-base font-bold + } + + .copyright { + @apply text-defaultSlateDark text-center + } + + /*Pagy*/ + .pagy { + @apply flex items-center justify-center space-x-1 font-semibold text-sm text-defaultSlate; + } + + .pagy a:not(.gap) { + @apply block rounded-xs px-2 py-1 border border-defaultSlate/50; + } + + .pagy a:not(.gap):hover { + @apply bg-slate-300 + } + + .pagy a:not(.gap):not([href]) { + @apply text-defaultSlate/50 border border-defaultSlate/25 cursor-default + } + + .pagy a:not(.gap).current { + @apply text-white bg-defaultSlate + } + + .pagy a.gap { + @apply inline-block my-auto + } + + .pagy label { + @apply inline-block whitespace-nowrap bg-default rounded-xs px-3 py-0.5 + } + + .pagy label input { + @apply bg-default border-none rounded-xs + } + + /*Base Table*/ + .base-table { + @apply min-w-full divide-y divide-tableBorder whitespace-nowrap + } + + .base-table th { + @apply bg-default px-2 py-2 text-left font-semibold text-defaultSlateDark lg:table-cell + } + + .base-table td { + @apply border-t border-tableBorder px-2 py-1 text-defaultSlate lg:table-cell whitespace-nowrap + } +} + +@media (min-width: 640px) { + .page-title { + @apply text-3xl font-bold; + } + + .search-title { + @apply text-lg font-bold; + } +} diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb new file mode 100644 index 0000000..0d95db2 --- /dev/null +++ b/app/controllers/application_controller.rb @@ -0,0 +1,4 @@ +class ApplicationController < ActionController::Base + # Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has. + allow_browser versions: :modern +end diff --git a/app/controllers/concerns/.keep b/app/controllers/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/controllers/modbus_controller.rb b/app/controllers/modbus_controller.rb new file mode 100644 index 0000000..559e264 --- /dev/null +++ b/app/controllers/modbus_controller.rb @@ -0,0 +1,26 @@ +class ModbusController < ApplicationController + def index + @schedule = Schedule.all + end + + def schedule_edit + @schedule = Schedule.all + end + + def schedule_edit_update + error_hours = [] + + params[:schedule].each do |id, attributes| + schedule = Schedule.find_by(id: id) + unless schedule.update(temperature: attributes[:temperature]) + error_hours << "#{schedule.hour}시" + end + end + + if error_hours.any? + redirect_to modbus_index_path, alert: "#{error_hours.join(', ')}의 온도 업데이트에 실패하였습니다." + else + redirect_to modbus_index_path, notice: "스케줄이 성공적으로 업데이트되었습니다." + end + end +end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb new file mode 100644 index 0000000..de6be79 --- /dev/null +++ b/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/app/helpers/modbus_helper.rb b/app/helpers/modbus_helper.rb new file mode 100644 index 0000000..73202f2 --- /dev/null +++ b/app/helpers/modbus_helper.rb @@ -0,0 +1,2 @@ +module ModbusHelper +end diff --git a/app/javascript/application.js b/app/javascript/application.js new file mode 100644 index 0000000..d933293 --- /dev/null +++ b/app/javascript/application.js @@ -0,0 +1,3 @@ +// Entry point for the build script in your package.json +import "@hotwired/turbo-rails" +import "./controllers" diff --git a/app/javascript/controllers/application.js b/app/javascript/controllers/application.js new file mode 100644 index 0000000..1213e85 --- /dev/null +++ b/app/javascript/controllers/application.js @@ -0,0 +1,9 @@ +import { Application } from "@hotwired/stimulus" + +const application = Application.start() + +// Configure Stimulus development experience +application.debug = false +window.Stimulus = application + +export { application } diff --git a/app/javascript/controllers/hello_controller.js b/app/javascript/controllers/hello_controller.js new file mode 100644 index 0000000..5975c07 --- /dev/null +++ b/app/javascript/controllers/hello_controller.js @@ -0,0 +1,7 @@ +import { Controller } from "@hotwired/stimulus" + +export default class extends Controller { + connect() { + this.element.textContent = "Hello World!" + } +} diff --git a/app/javascript/controllers/index.js b/app/javascript/controllers/index.js new file mode 100644 index 0000000..d0685d3 --- /dev/null +++ b/app/javascript/controllers/index.js @@ -0,0 +1,8 @@ +// This file is auto-generated by ./bin/rails stimulus:manifest:update +// Run that command whenever you add a new controller or create them with +// ./bin/rails generate stimulus controllerName + +import { application } from "./application" + +import HelloController from "./hello_controller" +application.register("hello", HelloController) diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb new file mode 100644 index 0000000..d394c3d --- /dev/null +++ b/app/jobs/application_job.rb @@ -0,0 +1,7 @@ +class ApplicationJob < ActiveJob::Base + # Automatically retry jobs that encountered a deadlock + # retry_on ActiveRecord::Deadlocked + + # Most jobs are safe to ignore if the underlying records are no longer available + # discard_on ActiveJob::DeserializationError +end diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb new file mode 100644 index 0000000..3c34c81 --- /dev/null +++ b/app/mailers/application_mailer.rb @@ -0,0 +1,4 @@ +class ApplicationMailer < ActionMailer::Base + default from: "from@example.com" + layout "mailer" +end diff --git a/app/models/application_record.rb b/app/models/application_record.rb new file mode 100644 index 0000000..b63caeb --- /dev/null +++ b/app/models/application_record.rb @@ -0,0 +1,3 @@ +class ApplicationRecord < ActiveRecord::Base + primary_abstract_class +end diff --git a/app/models/concerns/.keep b/app/models/concerns/.keep new file mode 100644 index 0000000..e69de29 diff --git a/app/models/schedule.rb b/app/models/schedule.rb new file mode 100644 index 0000000..741d2ff --- /dev/null +++ b/app/models/schedule.rb @@ -0,0 +1,6 @@ +class Schedule < ApplicationRecord + validates :temperature, + presence: true, + numericality: true, + format: { with: /\A\d+(\.\d)?\z/ } +end diff --git a/app/services/modbus/commands/bit_coil.rb b/app/services/modbus/commands/bit_coil.rb new file mode 100644 index 0000000..d69dbab --- /dev/null +++ b/app/services/modbus/commands/bit_coil.rb @@ -0,0 +1,8 @@ +# Modbus::Service.new(plc_id: 1, type: "bit_coil", start_address: 0, end_address: 15).execute +module Modbus + module Commands + def bit_coil(slave) + read_bit(slave, :read_coils) + end + end +end diff --git a/app/services/modbus/commands/bit_input.rb b/app/services/modbus/commands/bit_input.rb new file mode 100644 index 0000000..7a18433 --- /dev/null +++ b/app/services/modbus/commands/bit_input.rb @@ -0,0 +1,8 @@ +# Modbus::Service.new(plc_id: 1, type: "bit_input", start_address: 0, end_address: 15).execute +module Modbus + module Commands + def bit_input(slave) + read_bit(slave, :discrete_inputs) + end + end +end diff --git a/app/services/modbus/commands/word_holding_float32.rb b/app/services/modbus/commands/word_holding_float32.rb new file mode 100644 index 0000000..061f6ba --- /dev/null +++ b/app/services/modbus/commands/word_holding_float32.rb @@ -0,0 +1,8 @@ +# Modbus::Service.new(plc_id: 1, type: "word_holding_float32", start_address: 0, end_address: 15).execute +module Modbus + module Commands + def word_holding_float32(slave) + read_float(slave, :holding_registers) + end + end +end diff --git a/app/services/modbus/commands/word_holding_int16.rb b/app/services/modbus/commands/word_holding_int16.rb new file mode 100644 index 0000000..7408737 --- /dev/null +++ b/app/services/modbus/commands/word_holding_int16.rb @@ -0,0 +1,8 @@ +# Modbus::Service.new(plc_id: 1, type: "word_holding_int16", start_address: 16, end_address: 31).execute +module Modbus + module Commands + def word_holding_int16(slave) + read_int(slave, 16, :holding_registers) + end + end +end diff --git a/app/services/modbus/commands/word_input_float32.rb b/app/services/modbus/commands/word_input_float32.rb new file mode 100644 index 0000000..4fb60c7 --- /dev/null +++ b/app/services/modbus/commands/word_input_float32.rb @@ -0,0 +1,8 @@ +# Modbus::Service.new(plc_id: 1, type: "word_input_float32", start_address: 0, end_address: 15).execute +module Modbus + module Commands + def word_input_float32(slave) + read_float(slave, :input_registers) + end + end +end diff --git a/app/services/modbus/commands/word_input_int16.rb b/app/services/modbus/commands/word_input_int16.rb new file mode 100644 index 0000000..430deab --- /dev/null +++ b/app/services/modbus/commands/word_input_int16.rb @@ -0,0 +1,8 @@ +# Modbus::Service.new(plc_id: 1, type: "word_input_int16", start_address: 0, end_address: 15).execute +module Modbus + module Commands + def word_input_int16(slave) + read_int(slave, 16, :input_registers) + end + end +end diff --git a/app/services/modbus/commands/write_bit.rb b/app/services/modbus/commands/write_bit.rb new file mode 100644 index 0000000..2c9268c --- /dev/null +++ b/app/services/modbus/commands/write_bit.rb @@ -0,0 +1,8 @@ +# Modbus::Service.new(plc_id: 1, type: "write_bit", start_address: 0, value: 1).execute +module Modbus + module Commands + def write_bit(slave) + write_coil(slave) + end + end +end diff --git a/app/services/modbus/commands/write_bit_toggle.rb b/app/services/modbus/commands/write_bit_toggle.rb new file mode 100644 index 0000000..da40323 --- /dev/null +++ b/app/services/modbus/commands/write_bit_toggle.rb @@ -0,0 +1,8 @@ +# Modbus::Service.new(plc_id: 1, type: "write_bit_toggle", start_address: 0).execute +module Modbus + module Commands + def write_bit_toggle(slave) + write_toggle_coil(slave) + end + end +end diff --git a/app/services/modbus/commands/write_float32.rb b/app/services/modbus/commands/write_float32.rb new file mode 100644 index 0000000..260b038 --- /dev/null +++ b/app/services/modbus/commands/write_float32.rb @@ -0,0 +1,8 @@ +# Modbus::Service.new(plc_id: 1, type: "float32", start_address: 0, value: 123.45).execute +module Modbus + module Commands + def write_float32(slave) + write_float(slave) + end + end +end diff --git a/app/services/modbus/commands/write_int16.rb b/app/services/modbus/commands/write_int16.rb new file mode 100644 index 0000000..b94da14 --- /dev/null +++ b/app/services/modbus/commands/write_int16.rb @@ -0,0 +1,8 @@ +# Modbus::Service.new(plc_id: 1, type: "int16", start_address: 0, value: 123).execute +module Modbus + module Commands + def write_int16(slave) + write_int(slave, 16) + end + end +end diff --git a/app/services/modbus/operations.rb b/app/services/modbus/operations.rb new file mode 100644 index 0000000..3fa9221 --- /dev/null +++ b/app/services/modbus/operations.rb @@ -0,0 +1,93 @@ +# app/lib/modbus/operations.rb +module Modbus + module Operations + # write method + def write_toggle_coil(slave) + with_timeout do + target_value = slave.read_coils(@start_address, 1).first == 0 ? 1 : 0 + slave.coils[@start_address] = (target_value == 1) + loop do + break if slave.read_coils(@start_address, 1).first == target_value + sleep 0.1 + end + end + end + + def write_coil(slave) + with_timeout do + slave.coils[@start_address] = @value + loop do + break if slave.read_coils(@start_address, 1).first == @value + sleep 0.1 + end + end + end + + def write_int(slave, bits) + with_timeout do + regs = slave.holding_registers + if bits == 16 + value = @value.present? ? @value.to_i : 123 + regs[@start_address] = value + end + end + end + + def write_float(slave) + with_timeout do + regs = slave.holding_registers + value = @value.present? ? @value.to_f : 123.45 + regs[@start_address], regs[@start_address + 1] = [ value ].pack("f").unpack("v*") + end + end + + # read method + def read_bit(slave, type) + with_timeout do + value = case type + when :read_coils + slave.read_coils(@start_address, @end_address - @start_address + 1) + when :discrete_inputs + slave.discrete_inputs[@start_address..@end_address] + else + # type code here + end + Rails.logger.info "[#{Time.current}] Read Bit (#{type}): #{value}" + value + end + end + + def read_int(slave, bits, type) + with_timeout do + result = slave.send(type) + values = (@start_address..@end_address).map { |i| result[i] } + Rails.logger.info "[#{Time.current}] Read Float#{bits} (#{type}): #{values}" + values + end + end + + def read_float(slave, type) + with_timeout do + result = slave.send(type) + values = [] + (@start_address..@end_address).step(2) do |i| + raw = [ result[i], result[i + 1] ] + packed = raw.pack("v*") + float = packed.unpack("f")[0].round(2) + values << float + end + Rails.logger.info "[#{Time.current}] Read Float32 (#{type}): #{values.inspect}" + values + end + end + + def with_timeout + seconds = ENV.fetch("OPERATION_TIME_OUT", 1).to_i + Timeout.timeout(seconds) do + yield + end + rescue Timeout::Error + Rails.logger.error "[#{Time.current}] TimeOut (#{seconds}s)" + end + end +end diff --git a/app/services/modbus/polling_service.rb b/app/services/modbus/polling_service.rb new file mode 100644 index 0000000..b0f9dae --- /dev/null +++ b/app/services/modbus/polling_service.rb @@ -0,0 +1,46 @@ +module Modbus + class PollingService + class << self + def start + return if @thread&.alive? + + @thread = Thread.new do + puts "[#{Time.current}] Modbus polling service 시작됨" + last_logged_hour = nil + loop do + begin + now = Time.now + current_hour = now.hour + + if current_hour != last_logged_hour && now.min == 0 + schedule = Schedule.find_by(hour: current_hour) + + Modbus::Service.new( + type: "write_int16", + start_address: 2, + end_address: 2, + value: schedule.temperature * 10 + ).execute + puts "[Schedule] #{current_hour}:00 -> Target temp: #{schedule.temperature}°C" + last_logged_hour = current_hour + end + rescue StandardError => e + error_message = "[#{Time.current}] 오류: #{e.message}" + puts error_message + ensure + sleep 0.1 + end + end + end + end + + def stop + if @thread + @thread.exit + @thread = nil + puts "[#{Time.now}] Modbus polling service 중지됨" + end + end + end + end +end diff --git a/app/services/modbus/service.rb b/app/services/modbus/service.rb new file mode 100644 index 0000000..96c7624 --- /dev/null +++ b/app/services/modbus/service.rb @@ -0,0 +1,38 @@ +require_relative "operations" + +Dir[File.join(__dir__.to_s, "commands", "**", "*.rb")].each do |file| + load file +end + +class Modbus::Service + include Modbus::Operations + include Modbus::Commands + + def initialize(type:, start_address:, end_address: nil, value: nil) + @type = type + @start_address = start_address.to_i + @end_address = end_address&.to_i + @value = value + @slave_id = 1 + @plc_host = "rubyon.co.kr" + @plc_port = 502 + end + + def execute + ModBus::TCPClient.new(@plc_host, @plc_port) do |client| + client.with_slave(@slave_id) do |slave| + method_name = @type.strip + # Commands 모듈에 정의된 메서드만 허용 + if Modbus::Commands.instance_methods(false).include?(method_name.to_sym) + return send(method_name, slave) + else + available_commands = Modbus::Commands.instance_methods(false).sort.map(&:to_s) + command_list = available_commands.join("\r\n") + raise ArgumentError, "지원되지 않는 type: #{@type}\r\n사용 가능한 명령어 목록:\r\n#{command_list}" + end + end + end + rescue => e + Rails.logger.error "[#{Time.current}] Service 오류: #{e.message}" + end +end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb new file mode 100644 index 0000000..5df5045 --- /dev/null +++ b/app/views/layouts/application.html.erb @@ -0,0 +1,30 @@ + + + + <%= content_for(:title) || "Farmitry Hvac" %> + + + + <%= csrf_meta_tags %> + <%= csp_meta_tag %> + + <%= yield :head %> + + <%# Enable PWA manifest for installable apps (make sure to enable in config/routes.rb too!) %> + <%#= tag.link rel: "manifest", href: pwa_manifest_path(format: :json) %> + + + + + + <%# Includes all stylesheet files in app/assets/stylesheets %> + <%= stylesheet_link_tag :app, "data-turbo-track": "reload" %> + <%= javascript_include_tag "application", "data-turbo-track": "reload", type: "module" %> + + + +
+ <%= yield %> +
+ + diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb new file mode 100644 index 0000000..3aac900 --- /dev/null +++ b/app/views/layouts/mailer.html.erb @@ -0,0 +1,13 @@ + + + + + + + + + <%= yield %> + + diff --git a/app/views/layouts/mailer.text.erb b/app/views/layouts/mailer.text.erb new file mode 100644 index 0000000..37f0bdd --- /dev/null +++ b/app/views/layouts/mailer.text.erb @@ -0,0 +1 @@ +<%= yield %> diff --git a/app/views/modbus/index.html.erb b/app/views/modbus/index.html.erb new file mode 100644 index 0000000..ae77f45 --- /dev/null +++ b/app/views/modbus/index.html.erb @@ -0,0 +1,18 @@ +<% if flash[:notice] %> +
+ <%= flash[:notice] %> +
+<% elsif flash[:alert] %> +
+ <%= flash[:alert] %> +
+<% end %> + +<% @schedule.each do |s| %> +
+
<%= s.hour %>시
+
<%= s.temperature %> °C
+
+<% end %> + +<%= link_to "수정", "/modbus/schedule_edit", class: "btn btn-primary" %> diff --git a/app/views/modbus/schedule_edit.html.erb b/app/views/modbus/schedule_edit.html.erb new file mode 100644 index 0000000..11ac21b --- /dev/null +++ b/app/views/modbus/schedule_edit.html.erb @@ -0,0 +1,14 @@ +<%= form_with url: "/modbus/schedule_edit_update", method: :post do %> + <% @schedule.each do |s| %> +
+
<%= s.hour %>시
+
+ <%= text_field_tag "schedule[#{s.id}][temperature]", s.temperature, class: "border px-2 py-1 rounded" %> °C +
+
+ <% end %> + +
+ <%= submit_tag "업데이트", class: "bg-blue-500 text-white px-4 py-2 rounded" %> +
+<% end %> diff --git a/app/views/pwa/manifest.json.erb b/app/views/pwa/manifest.json.erb new file mode 100644 index 0000000..f71218a --- /dev/null +++ b/app/views/pwa/manifest.json.erb @@ -0,0 +1,22 @@ +{ + "name": "FarmitryHvac", + "icons": [ + { + "src": "/icon.png", + "type": "image/png", + "sizes": "512x512" + }, + { + "src": "/icon.png", + "type": "image/png", + "sizes": "512x512", + "purpose": "maskable" + } + ], + "start_url": "/", + "display": "standalone", + "scope": "/", + "description": "FarmitryHvac.", + "theme_color": "red", + "background_color": "red" +} diff --git a/app/views/pwa/service-worker.js b/app/views/pwa/service-worker.js new file mode 100644 index 0000000..b3a13fb --- /dev/null +++ b/app/views/pwa/service-worker.js @@ -0,0 +1,26 @@ +// Add a service worker for processing Web Push notifications: +// +// self.addEventListener("push", async (event) => { +// const { title, options } = await event.data.json() +// event.waitUntil(self.registration.showNotification(title, options)) +// }) +// +// self.addEventListener("notificationclick", function(event) { +// event.notification.close() +// event.waitUntil( +// clients.matchAll({ type: "window" }).then((clientList) => { +// for (let i = 0; i < clientList.length; i++) { +// let client = clientList[i] +// let clientPath = (new URL(client.url)).pathname +// +// if (clientPath == event.notification.data.path && "focus" in client) { +// return client.focus() +// } +// } +// +// if (clients.openWindow) { +// return clients.openWindow(event.notification.data.path) +// } +// }) +// ) +// }) diff --git a/bin/brakeman b/bin/brakeman new file mode 100755 index 0000000..ace1c9b --- /dev/null +++ b/bin/brakeman @@ -0,0 +1,7 @@ +#!/usr/bin/env ruby +require "rubygems" +require "bundler/setup" + +ARGV.unshift("--ensure-latest") + +load Gem.bin_path("brakeman", "brakeman") diff --git a/bin/bundle b/bin/bundle new file mode 100755 index 0000000..50da5fd --- /dev/null +++ b/bin/bundle @@ -0,0 +1,109 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'bundle' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "rubygems" + +m = Module.new do + module_function + + def invoked_as_script? + File.expand_path($0) == File.expand_path(__FILE__) + end + + def env_var_version + ENV["BUNDLER_VERSION"] + end + + def cli_arg_version + return unless invoked_as_script? # don't want to hijack other binstubs + return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update` + bundler_version = nil + update_index = nil + ARGV.each_with_index do |a, i| + if update_index && update_index.succ == i && a.match?(Gem::Version::ANCHORED_VERSION_PATTERN) + bundler_version = a + end + next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/ + bundler_version = $1 + update_index = i + end + bundler_version + end + + def gemfile + gemfile = ENV["BUNDLE_GEMFILE"] + return gemfile if gemfile && !gemfile.empty? + + File.expand_path("../Gemfile", __dir__) + end + + def lockfile + lockfile = + case File.basename(gemfile) + when "gems.rb" then gemfile.sub(/\.rb$/, ".locked") + else "#{gemfile}.lock" + end + File.expand_path(lockfile) + end + + def lockfile_version + return unless File.file?(lockfile) + lockfile_contents = File.read(lockfile) + return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/ + Regexp.last_match(1) + end + + def bundler_requirement + @bundler_requirement ||= + env_var_version || + cli_arg_version || + bundler_requirement_for(lockfile_version) + end + + def bundler_requirement_for(version) + return "#{Gem::Requirement.default}.a" unless version + + bundler_gem_version = Gem::Version.new(version) + + bundler_gem_version.approximate_recommendation + end + + def load_bundler! + ENV["BUNDLE_GEMFILE"] ||= gemfile + + activate_bundler + end + + def activate_bundler + gem_error = activation_error_handling do + gem "bundler", bundler_requirement + end + return if gem_error.nil? + require_error = activation_error_handling do + require "bundler/version" + end + return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION)) + warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`" + exit 42 + end + + def activation_error_handling + yield + nil + rescue StandardError, LoadError => e + e + end +end + +m.load_bundler! + +if m.invoked_as_script? + load Gem.bin_path("bundler", "bundle") +end diff --git a/bin/dev b/bin/dev new file mode 100755 index 0000000..d80a02d --- /dev/null +++ b/bin/dev @@ -0,0 +1,11 @@ +#!/usr/bin/env sh + +if gem list --no-installed --exact --silent foreman; then + echo "Installing foreman..." + gem install foreman +fi + +# Default to port 3000 if not specified +export PORT="${PORT:-3000}" + +exec foreman start -f Procfile.dev --env /dev/null "$@" diff --git a/bin/docker-entrypoint b/bin/docker-entrypoint new file mode 100755 index 0000000..57567d6 --- /dev/null +++ b/bin/docker-entrypoint @@ -0,0 +1,14 @@ +#!/bin/bash -e + +# Enable jemalloc for reduced memory usage and latency. +if [ -z "${LD_PRELOAD+x}" ]; then + LD_PRELOAD=$(find /usr/lib -name libjemalloc.so.2 -print -quit) + export LD_PRELOAD +fi + +# If running the rails server then create or migrate existing database +if [ "${@: -2:1}" == "./bin/rails" ] && [ "${@: -1:1}" == "server" ]; then + ./bin/rails db:prepare +fi + +exec "${@}" diff --git a/bin/jobs b/bin/jobs new file mode 100755 index 0000000..dcf59f3 --- /dev/null +++ b/bin/jobs @@ -0,0 +1,6 @@ +#!/usr/bin/env ruby + +require_relative "../config/environment" +require "solid_queue/cli" + +SolidQueue::Cli.start(ARGV) diff --git a/bin/kamal b/bin/kamal new file mode 100755 index 0000000..cbe59b9 --- /dev/null +++ b/bin/kamal @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'kamal' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("kamal", "kamal") diff --git a/bin/rails b/bin/rails new file mode 100755 index 0000000..efc0377 --- /dev/null +++ b/bin/rails @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +APP_PATH = File.expand_path("../config/application", __dir__) +require_relative "../config/boot" +require "rails/commands" diff --git a/bin/rake b/bin/rake new file mode 100755 index 0000000..4fbf10b --- /dev/null +++ b/bin/rake @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +require_relative "../config/boot" +require "rake" +Rake.application.run diff --git a/bin/rubocop b/bin/rubocop new file mode 100755 index 0000000..40330c0 --- /dev/null +++ b/bin/rubocop @@ -0,0 +1,8 @@ +#!/usr/bin/env ruby +require "rubygems" +require "bundler/setup" + +# explicit rubocop config increases performance slightly while avoiding config confusion. +ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__)) + +load Gem.bin_path("rubocop", "rubocop") diff --git a/bin/setup b/bin/setup new file mode 100755 index 0000000..6b62a32 --- /dev/null +++ b/bin/setup @@ -0,0 +1,37 @@ +#!/usr/bin/env ruby +require "fileutils" + +APP_ROOT = File.expand_path("..", __dir__) + +def system!(*args) + system(*args, exception: true) +end + +FileUtils.chdir APP_ROOT do + # This script is a way to set up or update your development environment automatically. + # 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("bundle check") || system!("bundle install") + + # Install JavaScript dependencies + system("yarn install --check-files") + + # 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" + + puts "\n== Removing old logs and tempfiles ==" + system! "bin/rails log:clear tmp:clear" + + unless ARGV.include?("--skip-server") + puts "\n== Starting development server ==" + STDOUT.flush # flush the output before exec(2) so that it displays + exec "bin/dev" + end +end diff --git a/bin/thrust b/bin/thrust new file mode 100755 index 0000000..36bde2d --- /dev/null +++ b/bin/thrust @@ -0,0 +1,5 @@ +#!/usr/bin/env ruby +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("thruster", "thrust") diff --git a/config.ru b/config.ru new file mode 100644 index 0000000..4a3c09a --- /dev/null +++ b/config.ru @@ -0,0 +1,6 @@ +# This file is used by Rack-based servers to start the application. + +require_relative "config/environment" + +run Rails.application +Rails.application.load_server diff --git a/config/application.rb b/config/application.rb new file mode 100644 index 0000000..0d76f73 --- /dev/null +++ b/config/application.rb @@ -0,0 +1,32 @@ +require_relative "boot" + +require "rails/all" + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) + +module FarmitryHvac + class Application < Rails::Application + # Initialize configuration defaults for originally generated Rails version. + config.load_defaults 8.0 + + # Please, add to the `ignore` list any other `lib` subdirectories that do + # not contain `.rb` files, or that should not be reloaded or eager loaded. + # Common ones are `templates`, `generators`, or `middleware`, for example. + config.autoload_lib( + ignore: %w[ + assets + tasks + ] + ) + + # Configuration for the application, engines, and railties goes here. + # + # These settings can be overridden in specific environments using the files + # in config/environments, which are processed later. + # + # config.time_zone = "Central Time (US & Canada)" + # config.eager_load_paths << Rails.root.join("extras") + end +end diff --git a/config/boot.rb b/config/boot.rb new file mode 100644 index 0000000..988a5dd --- /dev/null +++ b/config/boot.rb @@ -0,0 +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. diff --git a/config/cable.yml b/config/cable.yml new file mode 100644 index 0000000..b9adc5a --- /dev/null +++ b/config/cable.yml @@ -0,0 +1,17 @@ +# Async adapter only works within the same process, so for manually triggering cable updates from a console, +# and seeing results in the browser, you must do so from the web console (running inside the dev process), +# not a terminal started via bin/rails console! Add "console" to any action or any ERB template view +# to make the web console appear. +development: + adapter: async + +test: + adapter: test + +production: + adapter: solid_cable + connects_to: + database: + writing: cable + polling_interval: 0.1.seconds + message_retention: 1.day diff --git a/config/cache.yml b/config/cache.yml new file mode 100644 index 0000000..19d4908 --- /dev/null +++ b/config/cache.yml @@ -0,0 +1,16 @@ +default: &default + store_options: + # Cap age of oldest cache entry to fulfill retention policies + # max_age: <%= 60.days.to_i %> + max_size: <%= 256.megabytes %> + namespace: <%= Rails.env %> + +development: + <<: *default + +test: + <<: *default + +production: + database: cache + <<: *default diff --git a/config/credentials.yml.enc b/config/credentials.yml.enc new file mode 100644 index 0000000..1940b25 --- /dev/null +++ b/config/credentials.yml.enc @@ -0,0 +1 @@ +q/SQgIn041lS6kROinLX4LDzShUnhVLEEZXRd+m62OlFkZrpoYn0lBFKLU9qxiaFbPXJfjf/rZmPEc5ISP6h3uQsPTuHHo8vV1b97icyQOQ+tmTHgojU5ZDgATaCnJ45hkpQrtatEGv8TRCE/VjG0ZosrD8IZQC8Jc79kcweR4X5oUvO92ICuf2tNhDjo4Wiy7yP24MsonlyGDI08q9DTVEmSPUIX4i0d8poFmB62lo/ypLh84G6QygzioPaxvGFVpB/IZHyohrsreihYA1N550zYzhTJAdiqu06ilUcMxVyjTQzluVnSyySk35K15EF5uXjqcCbYWMZR1MBnViuuVyw/hLUqbhNkK4HV4riH8xCu2BrOMInih8pnlyeiWHxsIU8327FuMvU4l4fYyBUwVFbfIRI8PMtcs4hjps5QKX3fk4FOkpwMZBu79aLyVPZOH6OMzzxDWwZhtltPTxaJkUCeBF9JLq+POkMhBsL1d0Svh7JTmC7fpck--2nzgLvheNvjVN3LY--ehCeDg/81bdfRRyzs+HOhA== \ No newline at end of file diff --git a/config/database.yml b/config/database.yml new file mode 100644 index 0000000..2640cb5 --- /dev/null +++ b/config/database.yml @@ -0,0 +1,41 @@ +# SQLite. Versions 3.8.0 and up are supported. +# gem install sqlite3 +# +# Ensure the SQLite 3 gem is defined in your Gemfile +# gem "sqlite3" +# +default: &default + adapter: sqlite3 + pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + timeout: 5000 + +development: + <<: *default + database: storage/development.sqlite3 + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + <<: *default + database: storage/test.sqlite3 + + +# Store production database in the storage/ directory, which by default +# is mounted as a persistent Docker volume in config/deploy.yml. +production: + primary: + <<: *default + database: storage/production.sqlite3 + cache: + <<: *default + database: storage/production_cache.sqlite3 + migrations_paths: db/cache_migrate + queue: + <<: *default + database: storage/production_queue.sqlite3 + migrations_paths: db/queue_migrate + cable: + <<: *default + database: storage/production_cable.sqlite3 + migrations_paths: db/cable_migrate diff --git a/config/deploy.yml b/config/deploy.yml new file mode 100644 index 0000000..e4f6cfb --- /dev/null +++ b/config/deploy.yml @@ -0,0 +1,116 @@ +# Name of your application. Used to uniquely configure containers. +service: farmitry_hvac + +# Name of the container image. +image: your-user/farmitry_hvac + +# Deploy to these servers. +servers: + web: + - 192.168.0.1 + # job: + # hosts: + # - 192.168.0.1 + # cmd: bin/jobs + +# Enable SSL auto certification via Let's Encrypt and allow for multiple apps on a single web server. +# Remove this section when using multiple web servers and ensure you terminate SSL at your load balancer. +# +# Note: If using Cloudflare, set encryption mode in SSL/TLS setting to "Full" to enable CF-to-app encryption. +proxy: + ssl: true + host: app.example.com + +# Credentials for your image host. +registry: + # Specify the registry server, if you're not using Docker Hub + # server: registry.digitalocean.com / ghcr.io / ... + username: your-user + + # Always use an access token rather than real password when possible. + password: + - KAMAL_REGISTRY_PASSWORD + +# Inject ENV variables into containers (secrets come from .kamal/secrets). +env: + secret: + - RAILS_MASTER_KEY + clear: + # Run the Solid Queue Supervisor inside the web server's Puma process to do jobs. + # When you start using multiple servers, you should split out job processing to a dedicated machine. + SOLID_QUEUE_IN_PUMA: true + + # Set number of processes dedicated to Solid Queue (default: 1) + # JOB_CONCURRENCY: 3 + + # Set number of cores available to the application on each server (default: 1). + # WEB_CONCURRENCY: 2 + + # Match this to any external database server to configure Active Record correctly + # Use farmitry_hvac-db for a db accessory server on same machine via local kamal docker network. + # DB_HOST: 192.168.0.2 + + # Log everything from Rails + # RAILS_LOG_LEVEL: debug + +# Aliases are triggered with "bin/kamal ". You can overwrite arguments on invocation: +# "bin/kamal logs -r job" will tail logs from the first server in the job section. +aliases: + console: app exec --interactive --reuse "bin/rails console" + shell: app exec --interactive --reuse "bash" + logs: app logs -f + dbc: app exec --interactive --reuse "bin/rails dbconsole" + + +# Use a persistent storage volume for sqlite database files and local Active Storage files. +# Recommended to change this to a mounted volume path that is backed up off server. +volumes: + - "farmitry_hvac_storage:/rails/storage" + + +# Bridge fingerprinted assets, like JS and CSS, between versions to avoid +# hitting 404 on in-flight requests. Combines all files from new and old +# version inside the asset_path. +asset_path: /rails/public/assets + +# Configure the image builder. +builder: + arch: amd64 + + # # Build image via remote server (useful for faster amd64 builds on arm64 computers) + # remote: ssh://docker@docker-builder-server + # + # # Pass arguments and secrets to the Docker build process + # args: + # RUBY_VERSION: 3.4.2 + # secrets: + # - GITHUB_TOKEN + # - RAILS_MASTER_KEY + +# Use a different ssh user than root +# ssh: +# user: app + +# Use accessory services (secrets come from .kamal/secrets). +# accessories: +# db: +# image: mysql:8.0 +# host: 192.168.0.2 +# # Change to 3306 to expose port to the world instead of just local network. +# port: "127.0.0.1:3306:3306" +# env: +# clear: +# MYSQL_ROOT_HOST: '%' +# secret: +# - MYSQL_ROOT_PASSWORD +# files: +# - config/mysql/production.cnf:/etc/mysql/my.cnf +# - db/production.sql:/docker-entrypoint-initdb.d/setup.sql +# directories: +# - data:/var/lib/mysql +# redis: +# image: redis:7.0 +# host: 192.168.0.2 +# port: 6379 +# directories: +# - data:/data diff --git a/config/environment.rb b/config/environment.rb new file mode 100644 index 0000000..cac5315 --- /dev/null +++ b/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require_relative "application" + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb new file mode 100644 index 0000000..4cc21c4 --- /dev/null +++ b/config/environments/development.rb @@ -0,0 +1,72 @@ +require "active_support/core_ext/integer/time" + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Make code changes take effect immediately without server restart. + config.enable_reloading = true + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports. + config.consider_all_requests_local = true + + # Enable server timing. + config.server_timing = true + + # Enable/disable Action Controller caching. By default Action Controller caching is disabled. + # Run rails dev:cache to toggle Action Controller caching. + if Rails.root.join("tmp/caching-dev.txt").exist? + config.action_controller.perform_caching = true + config.action_controller.enable_fragment_cache_logging = true + config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" } + else + config.action_controller.perform_caching = false + end + + # Change to :null_store to avoid any caching. + config.cache_store = :memory_store + + # Store uploaded files on the local file system (see config/storage.yml for options). + config.active_storage.service = :local + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + # Make template changes take effect immediately. + config.action_mailer.perform_caching = false + + # Set localhost to be used by links generated in mailer templates. + config.action_mailer.default_url_options = { host: "localhost", port: 3000 } + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Highlight code that triggered database queries in logs. + config.active_record.verbose_query_logs = true + + # Append comments with runtime information tags to SQL queries in logs. + config.active_record.query_log_tags_enabled = true + + # Highlight code that enqueued background job in logs. + config.active_job.verbose_enqueue_logs = true + + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + config.action_view.annotate_rendered_view_with_filenames = true + + # Uncomment if you wish to allow Action Cable access from any origin. + # config.action_cable.disable_request_forgery_protection = true + + # Raise error when a before_action's only/except options reference missing actions. + config.action_controller.raise_on_missing_callback_actions = true + + # Apply autocorrection by RuboCop to files generated by `bin/rails generate`. + # config.generators.apply_rubocop_autocorrect_after_generate! +end diff --git a/config/environments/production.rb b/config/environments/production.rb new file mode 100644 index 0000000..bdcd01d --- /dev/null +++ b/config/environments/production.rb @@ -0,0 +1,90 @@ +require "active_support/core_ext/integer/time" + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.enable_reloading = false + + # Eager load code on boot for better performance and memory savings (ignored by Rake tasks). + config.eager_load = true + + # Full error reports are disabled. + config.consider_all_requests_local = false + + # Turn on fragment caching in view templates. + config.action_controller.perform_caching = true + + # Cache assets for far-future expiry since they are all digest stamped. + config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" } + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.asset_host = "http://assets.example.com" + + # Store uploaded files on the local file system (see config/storage.yml for options). + config.active_storage.service = :local + + # Assume all access to the app is happening through a SSL-terminating reverse proxy. + config.assume_ssl = true + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + config.force_ssl = true + + # Skip http-to-https redirect for the default health check endpoint. + # config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } } + + # Log to STDOUT with the current request id as a default log tag. + config.log_tags = [ :request_id ] + config.logger = ActiveSupport::TaggedLogging.logger(STDOUT) + + # Change to "debug" to log everything (including potentially personally-identifiable information!) + config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info") + + # Prevent health checks from clogging up the logs. + config.silence_healthcheck_path = "/up" + + # Don't log any deprecations. + config.active_support.report_deprecations = false + + # Replace the default in-process memory cache store with a durable alternative. + config.cache_store = :solid_cache_store + + # Replace the default in-process and non-durable queuing backend for Active Job. + config.active_job.queue_adapter = :solid_queue + config.solid_queue.connects_to = { database: { writing: :queue } } + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Set host to be used by links generated in mailer templates. + config.action_mailer.default_url_options = { host: "example.com" } + + # Specify outgoing SMTP server. Remember to add smtp/* credentials via rails credentials:edit. + # config.action_mailer.smtp_settings = { + # user_name: Rails.application.credentials.dig(:smtp, :user_name), + # password: Rails.application.credentials.dig(:smtp, :password), + # address: "smtp.example.com", + # port: 587, + # authentication: :plain + # } + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false + + # Only use :id for inspections in production. + config.active_record.attributes_for_inspect = [ :id ] + + # Enable DNS rebinding protection and other `Host` header attacks. + # config.hosts = [ + # "example.com", # Allow requests from example.com + # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com` + # ] + # + # Skip DNS rebinding protection for the default health check endpoint. + # config.host_authorization = { exclude: ->(request) { request.path == "/up" } } +end diff --git a/config/environments/test.rb b/config/environments/test.rb new file mode 100644 index 0000000..c2095b1 --- /dev/null +++ b/config/environments/test.rb @@ -0,0 +1,53 @@ +# The test environment is used exclusively to run your application's +# test suite. You never need to work with it otherwise. Remember that +# your test database is "scratch space" for the test suite and is wiped +# and recreated between test runs. Don't rely on the data there! + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # While tests run files are not watched, reloading is not necessary. + config.enable_reloading = false + + # Eager loading loads your entire application. When running a single test locally, + # 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? + + # Configure public file server for tests with cache-control for performance. + config.public_file_server.headers = { "cache-control" => "public, max-age=3600" } + + # Show full error reports. + config.consider_all_requests_local = true + config.cache_store = :null_store + + # Render exception templates for rescuable exceptions and raise for other exceptions. + config.action_dispatch.show_exceptions = :rescuable + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + + # Store uploaded files on the local file system in a temporary directory. + config.active_storage.service = :test + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Set host to be used by links generated in mailer templates. + config.action_mailer.default_url_options = { host: "example.com" } + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = true + + # Raise error when a before_action's only/except options reference missing actions. + config.action_controller.raise_on_missing_callback_actions = true +end diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb new file mode 100644 index 0000000..4873244 --- /dev/null +++ b/config/initializers/assets.rb @@ -0,0 +1,7 @@ +# 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. +Rails.application.config.assets.version = "1.0" + +# Add additional assets to the asset load path. +# Rails.application.config.assets.paths << Emoji.images_path diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb new file mode 100644 index 0000000..b3076b3 --- /dev/null +++ b/config/initializers/content_security_policy.rb @@ -0,0 +1,25 @@ +# Be sure to restart your server when you modify this file. + +# Define an application-wide content security policy. +# See the Securing Rails Applications Guide for more information: +# https://guides.rubyonrails.org/security.html#content-security-policy-header + +# Rails.application.configure do +# config.content_security_policy do |policy| +# policy.default_src :self, :https +# policy.font_src :self, :https, :data +# policy.img_src :self, :https, :data +# policy.object_src :none +# policy.script_src :self, :https +# policy.style_src :self, :https +# # Specify URI for violation reports +# # policy.report_uri "/csp-violation-report-endpoint" +# end +# +# # Generate session nonces for permitted importmap, inline scripts, and inline styles. +# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s } +# config.content_security_policy_nonce_directives = %w(script-src style-src) +# +# # Report violations without enforcing the policy. +# # config.content_security_policy_report_only = true +# end diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..c0b717f --- /dev/null +++ b/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,8 @@ +# 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, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc +] diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb new file mode 100644 index 0000000..3860f65 --- /dev/null +++ b/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, "\\1en" +# inflect.singular /^(ox)en/i, "\\1" +# inflect.irregular "person", "people" +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym "RESTful" +# end diff --git a/config/initializers/modbus_service.rb b/config/initializers/modbus_service.rb new file mode 100644 index 0000000..490c40b --- /dev/null +++ b/config/initializers/modbus_service.rb @@ -0,0 +1,3 @@ +Rails.application.config.after_initialize do + Modbus::PollingService.start +end diff --git a/config/locales/en.yml b/config/locales/en.yml new file mode 100644 index 0000000..6c349ae --- /dev/null +++ b/config/locales/en.yml @@ -0,0 +1,31 @@ +# Files in the config/locales directory are used for internationalization and +# are automatically loaded by Rails. If you want to use locales other than +# English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t "hello" +# +# In views, this is aliased to just `t`: +# +# <%= t("hello") %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# To learn more about the API, please read the Rails Internationalization guide +# at https://guides.rubyonrails.org/i18n.html. +# +# Be aware that YAML interprets the following case-insensitive strings as +# booleans: `true`, `false`, `on`, `off`, `yes`, `no`. Therefore, these strings +# must be quoted to be interpreted as strings. For example: +# +# en: +# "yes": yup +# enabled: "ON" + +en: + hello: "Hello world" diff --git a/config/puma.rb b/config/puma.rb new file mode 100644 index 0000000..a248513 --- /dev/null +++ b/config/puma.rb @@ -0,0 +1,41 @@ +# 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. +# +# Puma starts a configurable number of processes (workers) and each process +# serves each request in a thread from an internal thread pool. +# +# You can control the number of workers using ENV["WEB_CONCURRENCY"]. You +# should only set this value when you want to run 2 or more workers. The +# default is already 1. +# +# The ideal number of threads per worker depends both on how much time the +# application spends waiting for IO operations and on how much you wish to +# prioritize throughput over latency. +# +# As a rule of thumb, increasing the number of threads will increase how much +# traffic a given process can handle (throughput), but due to CRuby's +# Global VM Lock (GVL) it has diminishing returns and will degrade the +# response time (latency) of the application. +# +# The default is set to 3 threads as it's deemed a decent compromise between +# throughput and latency for the average Rails application. +# +# Any libraries that use a connection pool or another resource pool should +# be configured to provide at least as many connections as the number of +# threads. This includes Active Record's `pool` parameter in `database.yml`. +threads_count = ENV.fetch("RAILS_MAX_THREADS", 3) +threads threads_count, threads_count + +# Specifies the `port` that Puma will listen on to receive requests; default is 3000. +port ENV.fetch("PORT", 3000) + +# Allow puma to be restarted by `bin/rails restart` command. +plugin :tmp_restart + +# Run the Solid Queue supervisor inside of Puma for single-server deployments +plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"] + +# Specify the PID file. Defaults to tmp/pids/server.pid in development. +# In other environments, only set the PID file if requested. +pidfile ENV["PIDFILE"] if ENV["PIDFILE"] diff --git a/config/queue.yml b/config/queue.yml new file mode 100644 index 0000000..9eace59 --- /dev/null +++ b/config/queue.yml @@ -0,0 +1,18 @@ +default: &default + dispatchers: + - polling_interval: 1 + batch_size: 500 + workers: + - queues: "*" + threads: 3 + processes: <%= ENV.fetch("JOB_CONCURRENCY", 1) %> + polling_interval: 0.1 + +development: + <<: *default + +test: + <<: *default + +production: + <<: *default diff --git a/config/recurring.yml b/config/recurring.yml new file mode 100644 index 0000000..d045b19 --- /dev/null +++ b/config/recurring.yml @@ -0,0 +1,10 @@ +# production: +# periodic_cleanup: +# class: CleanSoftDeletedRecordsJob +# queue: background +# args: [ 1000, { batch_size: 500 } ] +# schedule: every hour +# periodic_command: +# command: "SoftDeletedRecord.due.delete_all" +# priority: 2 +# schedule: at 5am every day diff --git a/config/routes.rb b/config/routes.rb new file mode 100644 index 0000000..a64c5f0 --- /dev/null +++ b/config/routes.rb @@ -0,0 +1,24 @@ +Rails.application.routes.draw do + # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html + + # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500. + # Can be used by load balancers and uptime monitors to verify that the app is live. + get "up" => "rails/health#show", as: :rails_health_check + + # Render dynamic PWA files from app/views/pwa/* (remember to link manifest in application.html.erb) + # get "manifest" => "rails/pwa#manifest", as: :pwa_manifest + # get "service-worker" => "rails/pwa#service_worker", as: :pwa_service_worker + + # Defines the root path route ("/") + root "modbus#index" + + resources :modbus do + collection do + get "start" + get "stop" + get "status" + get "schedule_edit" + post "schedule_edit_update" + end + end +end diff --git a/config/storage.yml b/config/storage.yml new file mode 100644 index 0000000..4942ab6 --- /dev/null +++ b/config/storage.yml @@ -0,0 +1,34 @@ +test: + service: Disk + root: <%= Rails.root.join("tmp/storage") %> + +local: + service: Disk + root: <%= Rails.root.join("storage") %> + +# Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) +# amazon: +# service: S3 +# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> +# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> +# region: us-east-1 +# bucket: your_own_bucket-<%= Rails.env %> + +# Remember not to checkin your GCS keyfile to a repository +# google: +# service: GCS +# project: your_project +# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> +# bucket: your_own_bucket-<%= Rails.env %> + +# Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) +# microsoft: +# service: AzureStorage +# storage_account_name: your_account_name +# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> +# container: your_container_name-<%= Rails.env %> + +# mirror: +# service: Mirror +# primary: local +# mirrors: [ amazon, google, microsoft ] diff --git a/db/cable_schema.rb b/db/cable_schema.rb new file mode 100644 index 0000000..2366660 --- /dev/null +++ b/db/cable_schema.rb @@ -0,0 +1,11 @@ +ActiveRecord::Schema[7.1].define(version: 1) do + create_table "solid_cable_messages", force: :cascade do |t| + t.binary "channel", limit: 1024, null: false + t.binary "payload", limit: 536870912, null: false + t.datetime "created_at", null: false + t.integer "channel_hash", limit: 8, null: false + t.index ["channel"], name: "index_solid_cable_messages_on_channel" + t.index ["channel_hash"], name: "index_solid_cable_messages_on_channel_hash" + t.index ["created_at"], name: "index_solid_cable_messages_on_created_at" + end +end diff --git a/db/cache_schema.rb b/db/cache_schema.rb new file mode 100644 index 0000000..6005a29 --- /dev/null +++ b/db/cache_schema.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +ActiveRecord::Schema[7.2].define(version: 1) do + create_table "solid_cache_entries", force: :cascade do |t| + t.binary "key", limit: 1024, null: false + t.binary "value", limit: 536870912, null: false + t.datetime "created_at", null: false + t.integer "key_hash", limit: 8, null: false + t.integer "byte_size", limit: 4, null: false + t.index ["byte_size"], name: "index_solid_cache_entries_on_byte_size" + t.index ["key_hash", "byte_size"], name: "index_solid_cache_entries_on_key_hash_and_byte_size" + t.index ["key_hash"], name: "index_solid_cache_entries_on_key_hash", unique: true + end +end diff --git a/db/migrate/20250416131440_create_schedules.rb b/db/migrate/20250416131440_create_schedules.rb new file mode 100644 index 0000000..1ed0d45 --- /dev/null +++ b/db/migrate/20250416131440_create_schedules.rb @@ -0,0 +1,10 @@ +class CreateSchedules < ActiveRecord::Migration[8.0] + def change + create_table :schedules do |t| + t.integer :hour + t.float :temperature + + t.timestamps + end + end +end diff --git a/db/queue_schema.rb b/db/queue_schema.rb new file mode 100644 index 0000000..85194b6 --- /dev/null +++ b/db/queue_schema.rb @@ -0,0 +1,129 @@ +ActiveRecord::Schema[7.1].define(version: 1) do + create_table "solid_queue_blocked_executions", force: :cascade do |t| + t.bigint "job_id", null: false + t.string "queue_name", null: false + t.integer "priority", default: 0, null: false + t.string "concurrency_key", null: false + t.datetime "expires_at", null: false + t.datetime "created_at", null: false + t.index [ "concurrency_key", "priority", "job_id" ], name: "index_solid_queue_blocked_executions_for_release" + t.index [ "expires_at", "concurrency_key" ], name: "index_solid_queue_blocked_executions_for_maintenance" + t.index [ "job_id" ], name: "index_solid_queue_blocked_executions_on_job_id", unique: true + end + + create_table "solid_queue_claimed_executions", force: :cascade do |t| + t.bigint "job_id", null: false + t.bigint "process_id" + t.datetime "created_at", null: false + t.index [ "job_id" ], name: "index_solid_queue_claimed_executions_on_job_id", unique: true + t.index [ "process_id", "job_id" ], name: "index_solid_queue_claimed_executions_on_process_id_and_job_id" + end + + create_table "solid_queue_failed_executions", force: :cascade do |t| + t.bigint "job_id", null: false + t.text "error" + t.datetime "created_at", null: false + t.index [ "job_id" ], name: "index_solid_queue_failed_executions_on_job_id", unique: true + end + + create_table "solid_queue_jobs", force: :cascade do |t| + t.string "queue_name", null: false + t.string "class_name", null: false + t.text "arguments" + t.integer "priority", default: 0, null: false + t.string "active_job_id" + t.datetime "scheduled_at" + t.datetime "finished_at" + t.string "concurrency_key" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index [ "active_job_id" ], name: "index_solid_queue_jobs_on_active_job_id" + t.index [ "class_name" ], name: "index_solid_queue_jobs_on_class_name" + t.index [ "finished_at" ], name: "index_solid_queue_jobs_on_finished_at" + t.index [ "queue_name", "finished_at" ], name: "index_solid_queue_jobs_for_filtering" + t.index [ "scheduled_at", "finished_at" ], name: "index_solid_queue_jobs_for_alerting" + end + + create_table "solid_queue_pauses", force: :cascade do |t| + t.string "queue_name", null: false + t.datetime "created_at", null: false + t.index [ "queue_name" ], name: "index_solid_queue_pauses_on_queue_name", unique: true + end + + create_table "solid_queue_processes", force: :cascade do |t| + t.string "kind", null: false + t.datetime "last_heartbeat_at", null: false + t.bigint "supervisor_id" + t.integer "pid", null: false + t.string "hostname" + t.text "metadata" + t.datetime "created_at", null: false + t.string "name", null: false + t.index [ "last_heartbeat_at" ], name: "index_solid_queue_processes_on_last_heartbeat_at" + t.index [ "name", "supervisor_id" ], name: "index_solid_queue_processes_on_name_and_supervisor_id", unique: true + t.index [ "supervisor_id" ], name: "index_solid_queue_processes_on_supervisor_id" + end + + create_table "solid_queue_ready_executions", force: :cascade do |t| + t.bigint "job_id", null: false + t.string "queue_name", null: false + t.integer "priority", default: 0, null: false + t.datetime "created_at", null: false + t.index [ "job_id" ], name: "index_solid_queue_ready_executions_on_job_id", unique: true + t.index [ "priority", "job_id" ], name: "index_solid_queue_poll_all" + t.index [ "queue_name", "priority", "job_id" ], name: "index_solid_queue_poll_by_queue" + end + + create_table "solid_queue_recurring_executions", force: :cascade do |t| + t.bigint "job_id", null: false + t.string "task_key", null: false + t.datetime "run_at", null: false + t.datetime "created_at", null: false + t.index [ "job_id" ], name: "index_solid_queue_recurring_executions_on_job_id", unique: true + t.index [ "task_key", "run_at" ], name: "index_solid_queue_recurring_executions_on_task_key_and_run_at", unique: true + end + + create_table "solid_queue_recurring_tasks", force: :cascade do |t| + t.string "key", null: false + t.string "schedule", null: false + t.string "command", limit: 2048 + t.string "class_name" + t.text "arguments" + t.string "queue_name" + t.integer "priority", default: 0 + t.boolean "static", default: true, null: false + t.text "description" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index [ "key" ], name: "index_solid_queue_recurring_tasks_on_key", unique: true + t.index [ "static" ], name: "index_solid_queue_recurring_tasks_on_static" + end + + create_table "solid_queue_scheduled_executions", force: :cascade do |t| + t.bigint "job_id", null: false + t.string "queue_name", null: false + t.integer "priority", default: 0, null: false + t.datetime "scheduled_at", null: false + t.datetime "created_at", null: false + t.index [ "job_id" ], name: "index_solid_queue_scheduled_executions_on_job_id", unique: true + t.index [ "scheduled_at", "priority", "job_id" ], name: "index_solid_queue_dispatch_all" + end + + create_table "solid_queue_semaphores", force: :cascade do |t| + t.string "key", null: false + t.integer "value", default: 1, null: false + t.datetime "expires_at", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index [ "expires_at" ], name: "index_solid_queue_semaphores_on_expires_at" + t.index [ "key", "value" ], name: "index_solid_queue_semaphores_on_key_and_value" + t.index [ "key" ], name: "index_solid_queue_semaphores_on_key", unique: true + end + + add_foreign_key "solid_queue_blocked_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade + add_foreign_key "solid_queue_claimed_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade + add_foreign_key "solid_queue_failed_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade + add_foreign_key "solid_queue_ready_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade + add_foreign_key "solid_queue_recurring_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade + add_foreign_key "solid_queue_scheduled_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade +end diff --git a/db/schema.rb b/db/schema.rb new file mode 100644 index 0000000..afe3d8e --- /dev/null +++ b/db/schema.rb @@ -0,0 +1,20 @@ +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# This file is the source Rails uses to define your schema when running `bin/rails +# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to +# be faster and is potentially less error prone than running all of your +# migrations from scratch. Old migrations may fail to apply correctly if those +# migrations use external dependencies or application code. +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema[8.0].define(version: 2025_04_16_131440) do + create_table "schedules", force: :cascade do |t| + t.integer "hour" + t.float "temperature" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end +end diff --git a/db/seeds.rb b/db/seeds.rb new file mode 100644 index 0000000..64f6801 --- /dev/null +++ b/db/seeds.rb @@ -0,0 +1,13 @@ +# This file should ensure the existence of records required to run the application in every environment (production, +# development, test). The code here should be idempotent so that it can be executed at any point in every environment. +# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup). +# +# Example: +# +# ["Action", "Comedy", "Drama", "Horror"].each do |genre_name| +# MovieGenre.find_or_create_by!(name: genre_name) +# end + +(0..23).each_with_index do |h, index| + Schedule.create!(hour: h, temperature: index) +end diff --git a/lib/tasks/.keep b/lib/tasks/.keep new file mode 100644 index 0000000..e69de29 diff --git a/log/.keep b/log/.keep new file mode 100644 index 0000000..e69de29 diff --git a/package.json b/package.json new file mode 100644 index 0000000..449f108 --- /dev/null +++ b/package.json @@ -0,0 +1,17 @@ +{ + "name": "app", + "private": true, + "devDependencies": { + "esbuild": "^0.25.2" + }, + "scripts": { + "build": "esbuild app/javascript/*.* --bundle --sourcemap --format=esm --outdir=app/assets/builds --public-path=/assets", + "build:css": "npx @tailwindcss/cli -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css --minify" + }, + "dependencies": { + "@hotwired/stimulus": "^3.2.2", + "@hotwired/turbo-rails": "^8.0.13", + "@tailwindcss/cli": "^4.1.4", + "tailwindcss": "^4.1.4" + } +} diff --git a/public/400.html b/public/400.html new file mode 100644 index 0000000..282dbc8 --- /dev/null +++ b/public/400.html @@ -0,0 +1,114 @@ + + + + + + + The server cannot process the request due to a client error (400 Bad Request) + + + + + + + + + + + + + +
+
+ +
+
+

The server cannot process the request due to a client error. Please check the request and try again. If you’re the application owner check the logs for more information.

+
+
+ + + + diff --git a/public/404.html b/public/404.html new file mode 100644 index 0000000..c0670bc --- /dev/null +++ b/public/404.html @@ -0,0 +1,114 @@ + + + + + + + The page you were looking for doesn’t exist (404 Not found) + + + + + + + + + + + + + +
+
+ +
+
+

The page you were looking for doesn’t exist. You may have mistyped the address or the page may have moved. If you’re the application owner check the logs for more information.

+
+
+ + + + diff --git a/public/406-unsupported-browser.html b/public/406-unsupported-browser.html new file mode 100644 index 0000000..9532a9c --- /dev/null +++ b/public/406-unsupported-browser.html @@ -0,0 +1,114 @@ + + + + + + + Your browser is not supported (406 Not Acceptable) + + + + + + + + + + + + + +
+
+ +
+
+

Your browser is not supported.
Please upgrade your browser to continue.

+
+
+ + + + diff --git a/public/422.html b/public/422.html new file mode 100644 index 0000000..8bcf060 --- /dev/null +++ b/public/422.html @@ -0,0 +1,114 @@ + + + + + + + The change you wanted was rejected (422 Unprocessable Entity) + + + + + + + + + + + + + +
+
+ +
+
+

The change you wanted was rejected. Maybe you tried to change something you didn’t have access to. If you’re the application owner check the logs for more information.

+
+
+ + + + diff --git a/public/500.html b/public/500.html new file mode 100644 index 0000000..d77718c --- /dev/null +++ b/public/500.html @@ -0,0 +1,114 @@ + + + + + + + We’re sorry, but something went wrong (500 Internal Server Error) + + + + + + + + + + + + + +
+
+ +
+
+

We’re sorry, but something went wrong.
If you’re the application owner check the logs for more information.

+
+
+ + + + diff --git a/public/icon.png b/public/icon.png new file mode 100644 index 0000000..c4c9dbf Binary files /dev/null and b/public/icon.png differ diff --git a/public/icon.svg b/public/icon.svg new file mode 100644 index 0000000..04b34bf --- /dev/null +++ b/public/icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..c19f78a --- /dev/null +++ b/public/robots.txt @@ -0,0 +1 @@ +# See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file diff --git a/script/.keep b/script/.keep new file mode 100644 index 0000000..e69de29 diff --git a/storage/.keep b/storage/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb new file mode 100644 index 0000000..6e09319 --- /dev/null +++ b/test/application_system_test_case.rb @@ -0,0 +1,14 @@ +require "test_helper" + +class ApplicationSystemTestCase < ActionDispatch::SystemTestCase + if ENV["CAPYBARA_SERVER_PORT"] + served_by host: "rails-app", port: ENV["CAPYBARA_SERVER_PORT"] + + driven_by :selenium, using: :headless_chrome, screen_size: [ 1400, 1400 ], options: { + browser: :remote, + url: "http://#{ENV["SELENIUM_HOST"]}:4444" + } + else + driven_by :selenium, using: :headless_chrome, screen_size: [ 1400, 1400 ] + end +end diff --git a/test/controllers/.keep b/test/controllers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/controllers/modbus_controller_test.rb b/test/controllers/modbus_controller_test.rb new file mode 100644 index 0000000..c98df04 --- /dev/null +++ b/test/controllers/modbus_controller_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class ModbusControllerTest < ActionDispatch::IntegrationTest + # test "the truth" do + # assert true + # end +end diff --git a/test/fixtures/files/.keep b/test/fixtures/files/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/fixtures/schedules.yml b/test/fixtures/schedules.yml new file mode 100644 index 0000000..f14ccde --- /dev/null +++ b/test/fixtures/schedules.yml @@ -0,0 +1,9 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + hour: 1 + temperature: 1.5 + +two: + hour: 1 + temperature: 1.5 diff --git a/test/helpers/.keep b/test/helpers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/integration/.keep b/test/integration/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/mailers/.keep b/test/mailers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/models/.keep b/test/models/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/models/schedule_test.rb b/test/models/schedule_test.rb new file mode 100644 index 0000000..0d4c4e6 --- /dev/null +++ b/test/models/schedule_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class ScheduleTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/system/.keep b/test/system/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 0000000..0c22470 --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,15 @@ +ENV["RAILS_ENV"] ||= "test" +require_relative "../config/environment" +require "rails/test_help" + +module ActiveSupport + class TestCase + # Run tests in parallel with specified workers + parallelize(workers: :number_of_processors) + + # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. + fixtures :all + + # Add more helper methods to be used by all tests here... + end +end diff --git a/tmp/.keep b/tmp/.keep new file mode 100644 index 0000000..e69de29 diff --git a/tmp/pids/.keep b/tmp/pids/.keep new file mode 100644 index 0000000..e69de29 diff --git a/tmp/storage/.keep b/tmp/storage/.keep new file mode 100644 index 0000000..e69de29 diff --git a/vendor/.keep b/vendor/.keep new file mode 100644 index 0000000..e69de29 diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..b853bb2 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,594 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@emnapi/core@^1.4.0": + version "1.4.3" + resolved "https://registry.yarnpkg.com/@emnapi/core/-/core-1.4.3.tgz#9ac52d2d5aea958f67e52c40a065f51de59b77d6" + integrity sha512-4m62DuCE07lw01soJwPiBGC0nAww0Q+RY70VZ+n49yDIO13yyinhbWCeNnaob0lakDtWQzSdtNWzJeOJt2ma+g== + dependencies: + "@emnapi/wasi-threads" "1.0.2" + tslib "^2.4.0" + +"@emnapi/runtime@^1.4.0": + version "1.4.3" + resolved "https://registry.yarnpkg.com/@emnapi/runtime/-/runtime-1.4.3.tgz#c0564665c80dc81c448adac23f9dfbed6c838f7d" + integrity sha512-pBPWdu6MLKROBX05wSNKcNb++m5Er+KQ9QkB+WVM+pW2Kx9hoSrVTnu3BdkI5eBLZoKu/J6mW/B6i6bJB2ytXQ== + dependencies: + tslib "^2.4.0" + +"@emnapi/wasi-threads@1.0.2", "@emnapi/wasi-threads@^1.0.1": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@emnapi/wasi-threads/-/wasi-threads-1.0.2.tgz#977f44f844eac7d6c138a415a123818c655f874c" + integrity sha512-5n3nTJblwRi8LlXkJ9eBzu+kZR8Yxcc7ubakyQTFzPMtIhFpUBRbsnc2Dv88IZDIbCDlBiWrknhB4Lsz7mg6BA== + dependencies: + tslib "^2.4.0" + +"@esbuild/aix-ppc64@0.25.2": + version "0.25.2" + resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.25.2.tgz#b87036f644f572efb2b3c75746c97d1d2d87ace8" + integrity sha512-wCIboOL2yXZym2cgm6mlA742s9QeJ8DjGVaL39dLN4rRwrOgOyYSnOaFPhKZGLb2ngj4EyfAFjsNJwPXZvseag== + +"@esbuild/android-arm64@0.25.2": + version "0.25.2" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.25.2.tgz#5ca7dc20a18f18960ad8d5e6ef5cf7b0a256e196" + integrity sha512-5ZAX5xOmTligeBaeNEPnPaeEuah53Id2tX4c2CVP3JaROTH+j4fnfHCkr1PjXMd78hMst+TlkfKcW/DlTq0i4w== + +"@esbuild/android-arm@0.25.2": + version "0.25.2" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.25.2.tgz#3c49f607b7082cde70c6ce0c011c362c57a194ee" + integrity sha512-NQhH7jFstVY5x8CKbcfa166GoV0EFkaPkCKBQkdPJFvo5u+nGXLEH/ooniLb3QI8Fk58YAx7nsPLozUWfCBOJA== + +"@esbuild/android-x64@0.25.2": + version "0.25.2" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.25.2.tgz#8a00147780016aff59e04f1036e7cb1b683859e2" + integrity sha512-Ffcx+nnma8Sge4jzddPHCZVRvIfQ0kMsUsCMcJRHkGJ1cDmhe4SsrYIjLUKn1xpHZybmOqCWwB0zQvsjdEHtkg== + +"@esbuild/darwin-arm64@0.25.2": + version "0.25.2" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.25.2.tgz#486efe7599a8d90a27780f2bb0318d9a85c6c423" + integrity sha512-MpM6LUVTXAzOvN4KbjzU/q5smzryuoNjlriAIx+06RpecwCkL9JpenNzpKd2YMzLJFOdPqBpuub6eVRP5IgiSA== + +"@esbuild/darwin-x64@0.25.2": + version "0.25.2" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.25.2.tgz#95ee222aacf668c7a4f3d7ee87b3240a51baf374" + integrity sha512-5eRPrTX7wFyuWe8FqEFPG2cU0+butQQVNcT4sVipqjLYQjjh8a8+vUTfgBKM88ObB85ahsnTwF7PSIt6PG+QkA== + +"@esbuild/freebsd-arm64@0.25.2": + version "0.25.2" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.2.tgz#67efceda8554b6fc6a43476feba068fb37fa2ef6" + integrity sha512-mLwm4vXKiQ2UTSX4+ImyiPdiHjiZhIaE9QvC7sw0tZ6HoNMjYAqQpGyui5VRIi5sGd+uWq940gdCbY3VLvsO1w== + +"@esbuild/freebsd-x64@0.25.2": + version "0.25.2" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.25.2.tgz#88a9d7ecdd3adadbfe5227c2122d24816959b809" + integrity sha512-6qyyn6TjayJSwGpm8J9QYYGQcRgc90nmfdUb0O7pp1s4lTY+9D0H9O02v5JqGApUyiHOtkz6+1hZNvNtEhbwRQ== + +"@esbuild/linux-arm64@0.25.2": + version "0.25.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.25.2.tgz#87be1099b2bbe61282333b084737d46bc8308058" + integrity sha512-gq/sjLsOyMT19I8obBISvhoYiZIAaGF8JpeXu1u8yPv8BE5HlWYobmlsfijFIZ9hIVGYkbdFhEqC0NvM4kNO0g== + +"@esbuild/linux-arm@0.25.2": + version "0.25.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.25.2.tgz#72a285b0fe64496e191fcad222185d7bf9f816f6" + integrity sha512-UHBRgJcmjJv5oeQF8EpTRZs/1knq6loLxTsjc3nxO9eXAPDLcWW55flrMVc97qFPbmZP31ta1AZVUKQzKTzb0g== + +"@esbuild/linux-ia32@0.25.2": + version "0.25.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.25.2.tgz#337a87a4c4dd48a832baed5cbb022be20809d737" + integrity sha512-bBYCv9obgW2cBP+2ZWfjYTU+f5cxRoGGQ5SeDbYdFCAZpYWrfjjfYwvUpP8MlKbP0nwZ5gyOU/0aUzZ5HWPuvQ== + +"@esbuild/linux-loong64@0.25.2": + version "0.25.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.25.2.tgz#1b81aa77103d6b8a8cfa7c094ed3d25c7579ba2a" + integrity sha512-SHNGiKtvnU2dBlM5D8CXRFdd+6etgZ9dXfaPCeJtz+37PIUlixvlIhI23L5khKXs3DIzAn9V8v+qb1TRKrgT5w== + +"@esbuild/linux-mips64el@0.25.2": + version "0.25.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.25.2.tgz#afbe380b6992e7459bf7c2c3b9556633b2e47f30" + integrity sha512-hDDRlzE6rPeoj+5fsADqdUZl1OzqDYow4TB4Y/3PlKBD0ph1e6uPHzIQcv2Z65u2K0kpeByIyAjCmjn1hJgG0Q== + +"@esbuild/linux-ppc64@0.25.2": + version "0.25.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.25.2.tgz#6bf8695cab8a2b135cca1aa555226dc932d52067" + integrity sha512-tsHu2RRSWzipmUi9UBDEzc0nLc4HtpZEI5Ba+Omms5456x5WaNuiG3u7xh5AO6sipnJ9r4cRWQB2tUjPyIkc6g== + +"@esbuild/linux-riscv64@0.25.2": + version "0.25.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.25.2.tgz#43c2d67a1a39199fb06ba978aebb44992d7becc3" + integrity sha512-k4LtpgV7NJQOml/10uPU0s4SAXGnowi5qBSjaLWMojNCUICNu7TshqHLAEbkBdAszL5TabfvQ48kK84hyFzjnw== + +"@esbuild/linux-s390x@0.25.2": + version "0.25.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.25.2.tgz#419e25737ec815c6dce2cd20d026e347cbb7a602" + integrity sha512-GRa4IshOdvKY7M/rDpRR3gkiTNp34M0eLTaC1a08gNrh4u488aPhuZOCpkF6+2wl3zAN7L7XIpOFBhnaE3/Q8Q== + +"@esbuild/linux-x64@0.25.2": + version "0.25.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.25.2.tgz#22451f6edbba84abe754a8cbd8528ff6e28d9bcb" + integrity sha512-QInHERlqpTTZ4FRB0fROQWXcYRD64lAoiegezDunLpalZMjcUcld3YzZmVJ2H/Cp0wJRZ8Xtjtj0cEHhYc/uUg== + +"@esbuild/netbsd-arm64@0.25.2": + version "0.25.2" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.2.tgz#744affd3b8d8236b08c5210d828b0698a62c58ac" + integrity sha512-talAIBoY5M8vHc6EeI2WW9d/CkiO9MQJ0IOWX8hrLhxGbro/vBXJvaQXefW2cP0z0nQVTdQ/eNyGFV1GSKrxfw== + +"@esbuild/netbsd-x64@0.25.2": + version "0.25.2" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.25.2.tgz#dbbe7521fd6d7352f34328d676af923fc0f8a78f" + integrity sha512-voZT9Z+tpOxrvfKFyfDYPc4DO4rk06qamv1a/fkuzHpiVBMOhpjK+vBmWM8J1eiB3OLSMFYNaOaBNLXGChf5tg== + +"@esbuild/openbsd-arm64@0.25.2": + version "0.25.2" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.2.tgz#f9caf987e3e0570500832b487ce3039ca648ce9f" + integrity sha512-dcXYOC6NXOqcykeDlwId9kB6OkPUxOEqU+rkrYVqJbK2hagWOMrsTGsMr8+rW02M+d5Op5NNlgMmjzecaRf7Tg== + +"@esbuild/openbsd-x64@0.25.2": + version "0.25.2" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.25.2.tgz#d2bb6a0f8ffea7b394bb43dfccbb07cabd89f768" + integrity sha512-t/TkWwahkH0Tsgoq1Ju7QfgGhArkGLkF1uYz8nQS/PPFlXbP5YgRpqQR3ARRiC2iXoLTWFxc6DJMSK10dVXluw== + +"@esbuild/sunos-x64@0.25.2": + version "0.25.2" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.25.2.tgz#49b437ed63fe333b92137b7a0c65a65852031afb" + integrity sha512-cfZH1co2+imVdWCjd+D1gf9NjkchVhhdpgb1q5y6Hcv9TP6Zi9ZG/beI3ig8TvwT9lH9dlxLq5MQBBgwuj4xvA== + +"@esbuild/win32-arm64@0.25.2": + version "0.25.2" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.25.2.tgz#081424168463c7d6c7fb78f631aede0c104373cf" + integrity sha512-7Loyjh+D/Nx/sOTzV8vfbB3GJuHdOQyrOryFdZvPHLf42Tk9ivBU5Aedi7iyX+x6rbn2Mh68T4qq1SDqJBQO5Q== + +"@esbuild/win32-ia32@0.25.2": + version "0.25.2" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.25.2.tgz#3f9e87143ddd003133d21384944a6c6cadf9693f" + integrity sha512-WRJgsz9un0nqZJ4MfhabxaD9Ft8KioqU3JMinOTvobbX6MOSUigSBlogP8QB3uxpJDsFS6yN+3FDBdqE5lg9kg== + +"@esbuild/win32-x64@0.25.2": + version "0.25.2" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.25.2.tgz#839f72c2decd378f86b8f525e1979a97b920c67d" + integrity sha512-kM3HKb16VIXZyIeVrM1ygYmZBKybX8N4p754bw390wGO3Tf2j4L2/WYL+4suWujpgf6GBYs3jv7TyUivdd05JA== + +"@hotwired/stimulus@^3.2.2": + version "3.2.2" + resolved "https://registry.yarnpkg.com/@hotwired/stimulus/-/stimulus-3.2.2.tgz#071aab59c600fed95b97939e605ff261a4251608" + integrity sha512-eGeIqNOQpXoPAIP7tC1+1Yc1yl1xnwYqg+3mzqxyrbE5pg5YFBZcA6YoTiByJB6DKAEsiWtl6tjTJS4IYtbB7A== + +"@hotwired/turbo-rails@^8.0.13": + version "8.0.13" + resolved "https://registry.yarnpkg.com/@hotwired/turbo-rails/-/turbo-rails-8.0.13.tgz#7016651f7144053992ce5096bb95495f8faa5854" + integrity sha512-6SCnnOSzhtaJ0pNkAjncZxjtKsK3sP/vPEkCnTXBXSHkr+vF7DTZkOlwjhms1DbbQNTsjCsBoKvzSMbh/omSCQ== + dependencies: + "@hotwired/turbo" "^8.0.13" + "@rails/actioncable" "^7.0" + +"@hotwired/turbo@^8.0.13": + version "8.0.13" + resolved "https://registry.yarnpkg.com/@hotwired/turbo/-/turbo-8.0.13.tgz#ab35fda9d358432c8a872a833844b38cccb8c25b" + integrity sha512-M7qXUqcGab6G5PKOiwhgbByTtrPgKPFCTMNQ52QhzUEXEqmp0/ApEguUesh/FPiUjrmFec+3lq98KsWnYY2C7g== + +"@napi-rs/wasm-runtime@^0.2.8": + version "0.2.9" + resolved "https://registry.yarnpkg.com/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.9.tgz#7278122cf94f3b36d8170a8eee7d85356dfa6a96" + integrity sha512-OKRBiajrrxB9ATokgEQoG87Z25c67pCpYcCwmXYX8PBftC9pBfN18gnm/fh1wurSLEKIAt+QRFLFCQISrb66Jg== + dependencies: + "@emnapi/core" "^1.4.0" + "@emnapi/runtime" "^1.4.0" + "@tybys/wasm-util" "^0.9.0" + +"@parcel/watcher-android-arm64@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.5.1.tgz#507f836d7e2042f798c7d07ad19c3546f9848ac1" + integrity sha512-KF8+j9nNbUN8vzOFDpRMsaKBHZ/mcjEjMToVMJOhTozkDonQFFrRcfdLWn6yWKCmJKmdVxSgHiYvTCef4/qcBA== + +"@parcel/watcher-darwin-arm64@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.5.1.tgz#3d26dce38de6590ef79c47ec2c55793c06ad4f67" + integrity sha512-eAzPv5osDmZyBhou8PoF4i6RQXAfeKL9tjb3QzYuccXFMQU0ruIc/POh30ePnaOyD1UXdlKguHBmsTs53tVoPw== + +"@parcel/watcher-darwin-x64@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.5.1.tgz#99f3af3869069ccf774e4ddfccf7e64fd2311ef8" + integrity sha512-1ZXDthrnNmwv10A0/3AJNZ9JGlzrF82i3gNQcWOzd7nJ8aj+ILyW1MTxVk35Db0u91oD5Nlk9MBiujMlwmeXZg== + +"@parcel/watcher-freebsd-x64@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.5.1.tgz#14d6857741a9f51dfe51d5b08b7c8afdbc73ad9b" + integrity sha512-SI4eljM7Flp9yPuKi8W0ird8TI/JK6CSxju3NojVI6BjHsTyK7zxA9urjVjEKJ5MBYC+bLmMcbAWlZ+rFkLpJQ== + +"@parcel/watcher-linux-arm-glibc@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.5.1.tgz#43c3246d6892381db473bb4f663229ad20b609a1" + integrity sha512-RCdZlEyTs8geyBkkcnPWvtXLY44BCeZKmGYRtSgtwwnHR4dxfHRG3gR99XdMEdQ7KeiDdasJwwvNSF5jKtDwdA== + +"@parcel/watcher-linux-arm-musl@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm-musl/-/watcher-linux-arm-musl-2.5.1.tgz#663750f7090bb6278d2210de643eb8a3f780d08e" + integrity sha512-6E+m/Mm1t1yhB8X412stiKFG3XykmgdIOqhjWj+VL8oHkKABfu/gjFj8DvLrYVHSBNC+/u5PeNrujiSQ1zwd1Q== + +"@parcel/watcher-linux-arm64-glibc@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.5.1.tgz#ba60e1f56977f7e47cd7e31ad65d15fdcbd07e30" + integrity sha512-LrGp+f02yU3BN9A+DGuY3v3bmnFUggAITBGriZHUREfNEzZh/GO06FF5u2kx8x+GBEUYfyTGamol4j3m9ANe8w== + +"@parcel/watcher-linux-arm64-musl@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.5.1.tgz#f7fbcdff2f04c526f96eac01f97419a6a99855d2" + integrity sha512-cFOjABi92pMYRXS7AcQv9/M1YuKRw8SZniCDw0ssQb/noPkRzA+HBDkwmyOJYp5wXcsTrhxO0zq1U11cK9jsFg== + +"@parcel/watcher-linux-x64-glibc@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.1.tgz#4d2ea0f633eb1917d83d483392ce6181b6a92e4e" + integrity sha512-GcESn8NZySmfwlTsIur+49yDqSny2IhPeZfXunQi48DMugKeZ7uy1FX83pO0X22sHntJ4Ub+9k34XQCX+oHt2A== + +"@parcel/watcher-linux-x64-musl@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.1.tgz#277b346b05db54f55657301dd77bdf99d63606ee" + integrity sha512-n0E2EQbatQ3bXhcH2D1XIAANAcTZkQICBPVaxMeaCVBtOpBZpWJuf7LwyWPSBDITb7In8mqQgJ7gH8CILCURXg== + +"@parcel/watcher-win32-arm64@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.5.1.tgz#7e9e02a26784d47503de1d10e8eab6cceb524243" + integrity sha512-RFzklRvmc3PkjKjry3hLF9wD7ppR4AKcWNzH7kXR7GUe0Igb3Nz8fyPwtZCSquGrhU5HhUNDr/mKBqj7tqA2Vw== + +"@parcel/watcher-win32-ia32@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.5.1.tgz#2d0f94fa59a873cdc584bf7f6b1dc628ddf976e6" + integrity sha512-c2KkcVN+NJmuA7CGlaGD1qJh1cLfDnQsHjE89E60vUEMlqduHGCdCLJCID5geFVM0dOtA3ZiIO8BoEQmzQVfpQ== + +"@parcel/watcher-win32-x64@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.5.1.tgz#ae52693259664ba6f2228fa61d7ee44b64ea0947" + integrity sha512-9lHBdJITeNR++EvSQVUcaZoWupyHfXe1jZvGZ06O/5MflPcuPLtEphScIBL+AiCWBO46tDSHzWyD0uDmmZqsgA== + +"@parcel/watcher@^2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher/-/watcher-2.5.1.tgz#342507a9cfaaf172479a882309def1e991fb1200" + integrity sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg== + dependencies: + detect-libc "^1.0.3" + is-glob "^4.0.3" + micromatch "^4.0.5" + node-addon-api "^7.0.0" + optionalDependencies: + "@parcel/watcher-android-arm64" "2.5.1" + "@parcel/watcher-darwin-arm64" "2.5.1" + "@parcel/watcher-darwin-x64" "2.5.1" + "@parcel/watcher-freebsd-x64" "2.5.1" + "@parcel/watcher-linux-arm-glibc" "2.5.1" + "@parcel/watcher-linux-arm-musl" "2.5.1" + "@parcel/watcher-linux-arm64-glibc" "2.5.1" + "@parcel/watcher-linux-arm64-musl" "2.5.1" + "@parcel/watcher-linux-x64-glibc" "2.5.1" + "@parcel/watcher-linux-x64-musl" "2.5.1" + "@parcel/watcher-win32-arm64" "2.5.1" + "@parcel/watcher-win32-ia32" "2.5.1" + "@parcel/watcher-win32-x64" "2.5.1" + +"@rails/actioncable@^7.0": + version "7.2.201" + resolved "https://registry.yarnpkg.com/@rails/actioncable/-/actioncable-7.2.201.tgz#bfb3da01b3e2462f5a18f372c52dedd7de76037f" + integrity sha512-wsTdWoZ5EfG5k3t7ORdyQF0ZmDEgN4aVPCanHAiNEwCROqibSZMXXmCbH7IDJUVri4FOeAVwwbPINI7HVHPKBw== + +"@tailwindcss/cli@^4.1.4": + version "4.1.4" + resolved "https://registry.yarnpkg.com/@tailwindcss/cli/-/cli-4.1.4.tgz#d7fce8043013fc31ca04756db41d3988377b7173" + integrity sha512-gP05Qihh+cZ2FqD5fa0WJXx3KEk2YWUYv/RBKAyiOg0V4vYVDr/xlLc0sacpnVEXM45BVUR9U2hsESufYs6YTA== + dependencies: + "@parcel/watcher" "^2.5.1" + "@tailwindcss/node" "4.1.4" + "@tailwindcss/oxide" "4.1.4" + enhanced-resolve "^5.18.1" + mri "^1.2.0" + picocolors "^1.1.1" + tailwindcss "4.1.4" + +"@tailwindcss/node@4.1.4": + version "4.1.4" + resolved "https://registry.yarnpkg.com/@tailwindcss/node/-/node-4.1.4.tgz#cfabbbcd53cbbae8a175dc744e6fe31e8ad43d3e" + integrity sha512-MT5118zaiO6x6hNA04OWInuAiP1YISXql8Z+/Y8iisV5nuhM8VXlyhRuqc2PEviPszcXI66W44bCIk500Oolhw== + dependencies: + enhanced-resolve "^5.18.1" + jiti "^2.4.2" + lightningcss "1.29.2" + tailwindcss "4.1.4" + +"@tailwindcss/oxide-android-arm64@4.1.4": + version "4.1.4" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.1.4.tgz#5cee1085f6c856f0da2c182e29d115af1f1118e8" + integrity sha512-xMMAe/SaCN/vHfQYui3fqaBDEXMu22BVwQ33veLc8ep+DNy7CWN52L+TTG9y1K397w9nkzv+Mw+mZWISiqhmlA== + +"@tailwindcss/oxide-darwin-arm64@4.1.4": + version "4.1.4" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.1.4.tgz#878c0ea38fa277f058084bb1a91a4891d9049945" + integrity sha512-JGRj0SYFuDuAGilWFBlshcexev2hOKfNkoX+0QTksKYq2zgF9VY/vVMq9m8IObYnLna0Xlg+ytCi2FN2rOL0Sg== + +"@tailwindcss/oxide-darwin-x64@4.1.4": + version "4.1.4" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.1.4.tgz#ffde947581f7eaa7e1df2be222255ccff063de8a" + integrity sha512-sdDeLNvs3cYeWsEJ4H1DvjOzaGios4QbBTNLVLVs0XQ0V95bffT3+scptzYGPMjm7xv4+qMhCDrkHwhnUySEzA== + +"@tailwindcss/oxide-freebsd-x64@4.1.4": + version "4.1.4" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.1.4.tgz#894dbe0155afe924071198c44635663d3d9c967a" + integrity sha512-VHxAqxqdghM83HslPhRsNhHo91McsxRJaEnShJOMu8mHmEj9Ig7ToHJtDukkuLWLzLboh2XSjq/0zO6wgvykNA== + +"@tailwindcss/oxide-linux-arm-gnueabihf@4.1.4": + version "4.1.4" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.1.4.tgz#7b5d7de6a88613e5c908a68f1ed84ac675fd9351" + integrity sha512-OTU/m/eV4gQKxy9r5acuesqaymyeSCnsx1cFto/I1WhPmi5HDxX1nkzb8KYBiwkHIGg7CTfo/AcGzoXAJBxLfg== + +"@tailwindcss/oxide-linux-arm64-gnu@4.1.4": + version "4.1.4" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.1.4.tgz#9d77b37c0ad52c370de3573240993d43d6e82141" + integrity sha512-hKlLNvbmUC6z5g/J4H+Zx7f7w15whSVImokLPmP6ff1QqTVE+TxUM9PGuNsjHvkvlHUtGTdDnOvGNSEUiXI1Ww== + +"@tailwindcss/oxide-linux-arm64-musl@4.1.4": + version "4.1.4" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.1.4.tgz#a1839425aaa7a42a465d58017f53c3817d98ac3d" + integrity sha512-X3As2xhtgPTY/m5edUtddmZ8rCruvBvtxYLMw9OsZdH01L2gS2icsHRwxdU0dMItNfVmrBezueXZCHxVeeb7Aw== + +"@tailwindcss/oxide-linux-x64-gnu@4.1.4": + version "4.1.4" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.1.4.tgz#bf11a9bf2191d964bb8f696d2ea904b55140b800" + integrity sha512-2VG4DqhGaDSmYIu6C4ua2vSLXnJsb/C9liej7TuSO04NK+JJJgJucDUgmX6sn7Gw3Cs5ZJ9ZLrnI0QRDOjLfNQ== + +"@tailwindcss/oxide-linux-x64-musl@4.1.4": + version "4.1.4" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.1.4.tgz#11c7429543951cfa308016d4a957ab6a4192b37f" + integrity sha512-v+mxVgH2kmur/X5Mdrz9m7TsoVjbdYQT0b4Z+dr+I4RvreCNXyCFELZL/DO0M1RsidZTrm6O1eMnV6zlgEzTMQ== + +"@tailwindcss/oxide-wasm32-wasi@4.1.4": + version "4.1.4" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.1.4.tgz#2c6b1aba1f086c3337625cdb3372c3955832768c" + integrity sha512-2TLe9ir+9esCf6Wm+lLWTMbgklIjiF0pbmDnwmhR9MksVOq+e8aP3TSsXySnBDDvTTVd/vKu1aNttEGj3P6l8Q== + dependencies: + "@emnapi/core" "^1.4.0" + "@emnapi/runtime" "^1.4.0" + "@emnapi/wasi-threads" "^1.0.1" + "@napi-rs/wasm-runtime" "^0.2.8" + "@tybys/wasm-util" "^0.9.0" + tslib "^2.8.0" + +"@tailwindcss/oxide-win32-arm64-msvc@4.1.4": + version "4.1.4" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.1.4.tgz#ffdfed3d61203428d448f52e35185f85a0ef9856" + integrity sha512-VlnhfilPlO0ltxW9/BgfLI5547PYzqBMPIzRrk4W7uupgCt8z6Trw/tAj6QUtF2om+1MH281Pg+HHUJoLesmng== + +"@tailwindcss/oxide-win32-x64-msvc@4.1.4": + version "4.1.4" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.1.4.tgz#0abb7920564bcf5dafabc56914eeea38547a32c9" + integrity sha512-+7S63t5zhYjslUGb8NcgLpFXD+Kq1F/zt5Xv5qTv7HaFTG/DHyHD9GA6ieNAxhgyA4IcKa/zy7Xx4Oad2/wuhw== + +"@tailwindcss/oxide@4.1.4": + version "4.1.4" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide/-/oxide-4.1.4.tgz#bf3bce61310b64bd47f61f12083ae4903a91ba8e" + integrity sha512-p5wOpXyOJx7mKh5MXh5oKk+kqcz8T+bA3z/5VWWeQwFrmuBItGwz8Y2CHk/sJ+dNb9B0nYFfn0rj/cKHZyjahQ== + optionalDependencies: + "@tailwindcss/oxide-android-arm64" "4.1.4" + "@tailwindcss/oxide-darwin-arm64" "4.1.4" + "@tailwindcss/oxide-darwin-x64" "4.1.4" + "@tailwindcss/oxide-freebsd-x64" "4.1.4" + "@tailwindcss/oxide-linux-arm-gnueabihf" "4.1.4" + "@tailwindcss/oxide-linux-arm64-gnu" "4.1.4" + "@tailwindcss/oxide-linux-arm64-musl" "4.1.4" + "@tailwindcss/oxide-linux-x64-gnu" "4.1.4" + "@tailwindcss/oxide-linux-x64-musl" "4.1.4" + "@tailwindcss/oxide-wasm32-wasi" "4.1.4" + "@tailwindcss/oxide-win32-arm64-msvc" "4.1.4" + "@tailwindcss/oxide-win32-x64-msvc" "4.1.4" + +"@tybys/wasm-util@^0.9.0": + version "0.9.0" + resolved "https://registry.yarnpkg.com/@tybys/wasm-util/-/wasm-util-0.9.0.tgz#3e75eb00604c8d6db470bf18c37b7d984a0e3355" + integrity sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw== + dependencies: + tslib "^2.4.0" + +braces@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" + integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== + dependencies: + fill-range "^7.1.1" + +detect-libc@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + integrity sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg== + +detect-libc@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.0.3.tgz#f0cd503b40f9939b894697d19ad50895e30cf700" + integrity sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw== + +enhanced-resolve@^5.18.1: + version "5.18.1" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.18.1.tgz#728ab082f8b7b6836de51f1637aab5d3b9568faf" + integrity sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg== + dependencies: + graceful-fs "^4.2.4" + tapable "^2.2.0" + +esbuild@^0.25.2: + version "0.25.2" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.25.2.tgz#55a1d9ebcb3aa2f95e8bba9e900c1a5061bc168b" + integrity sha512-16854zccKPnC+toMywC+uKNeYSv+/eXkevRAfwRD/G9Cleq66m8XFIrigkbvauLLlCfDL45Q2cWegSg53gGBnQ== + optionalDependencies: + "@esbuild/aix-ppc64" "0.25.2" + "@esbuild/android-arm" "0.25.2" + "@esbuild/android-arm64" "0.25.2" + "@esbuild/android-x64" "0.25.2" + "@esbuild/darwin-arm64" "0.25.2" + "@esbuild/darwin-x64" "0.25.2" + "@esbuild/freebsd-arm64" "0.25.2" + "@esbuild/freebsd-x64" "0.25.2" + "@esbuild/linux-arm" "0.25.2" + "@esbuild/linux-arm64" "0.25.2" + "@esbuild/linux-ia32" "0.25.2" + "@esbuild/linux-loong64" "0.25.2" + "@esbuild/linux-mips64el" "0.25.2" + "@esbuild/linux-ppc64" "0.25.2" + "@esbuild/linux-riscv64" "0.25.2" + "@esbuild/linux-s390x" "0.25.2" + "@esbuild/linux-x64" "0.25.2" + "@esbuild/netbsd-arm64" "0.25.2" + "@esbuild/netbsd-x64" "0.25.2" + "@esbuild/openbsd-arm64" "0.25.2" + "@esbuild/openbsd-x64" "0.25.2" + "@esbuild/sunos-x64" "0.25.2" + "@esbuild/win32-arm64" "0.25.2" + "@esbuild/win32-ia32" "0.25.2" + "@esbuild/win32-x64" "0.25.2" + +fill-range@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" + integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== + dependencies: + to-regex-range "^5.0.1" + +graceful-fs@^4.2.4: + version "4.2.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== + +is-glob@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +jiti@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/jiti/-/jiti-2.4.2.tgz#d19b7732ebb6116b06e2038da74a55366faef560" + integrity sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A== + +lightningcss-darwin-arm64@1.29.2: + version "1.29.2" + resolved "https://registry.yarnpkg.com/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.29.2.tgz#6ceff38b01134af48e859394e1ca21e5d49faae6" + integrity sha512-cK/eMabSViKn/PG8U/a7aCorpeKLMlK0bQeNHmdb7qUnBkNPnL+oV5DjJUo0kqWsJUapZsM4jCfYItbqBDvlcA== + +lightningcss-darwin-x64@1.29.2: + version "1.29.2" + resolved "https://registry.yarnpkg.com/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.29.2.tgz#891b6f9e57682d794223c33463ca66d3af3fb038" + integrity sha512-j5qYxamyQw4kDXX5hnnCKMf3mLlHvG44f24Qyi2965/Ycz829MYqjrVg2H8BidybHBp9kom4D7DR5VqCKDXS0w== + +lightningcss-freebsd-x64@1.29.2: + version "1.29.2" + resolved "https://registry.yarnpkg.com/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.29.2.tgz#8a95f9ab73b2b2b0beefe1599fafa8b058938495" + integrity sha512-wDk7M2tM78Ii8ek9YjnY8MjV5f5JN2qNVO+/0BAGZRvXKtQrBC4/cn4ssQIpKIPP44YXw6gFdpUF+Ps+RGsCwg== + +lightningcss-linux-arm-gnueabihf@1.29.2: + version "1.29.2" + resolved "https://registry.yarnpkg.com/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.29.2.tgz#5c60bbf92b39d7ed51e363f7b98a7111bf5914a1" + integrity sha512-IRUrOrAF2Z+KExdExe3Rz7NSTuuJ2HvCGlMKoquK5pjvo2JY4Rybr+NrKnq0U0hZnx5AnGsuFHjGnNT14w26sg== + +lightningcss-linux-arm64-gnu@1.29.2: + version "1.29.2" + resolved "https://registry.yarnpkg.com/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.29.2.tgz#e73d7608c4cce034c3654e5e8b53be74846224de" + integrity sha512-KKCpOlmhdjvUTX/mBuaKemp0oeDIBBLFiU5Fnqxh1/DZ4JPZi4evEH7TKoSBFOSOV3J7iEmmBaw/8dpiUvRKlQ== + +lightningcss-linux-arm64-musl@1.29.2: + version "1.29.2" + resolved "https://registry.yarnpkg.com/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.29.2.tgz#a95a18d5a909831c092e0a8d2de4b9ac1a8db151" + integrity sha512-Q64eM1bPlOOUgxFmoPUefqzY1yV3ctFPE6d/Vt7WzLW4rKTv7MyYNky+FWxRpLkNASTnKQUaiMJ87zNODIrrKQ== + +lightningcss-linux-x64-gnu@1.29.2: + version "1.29.2" + resolved "https://registry.yarnpkg.com/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.29.2.tgz#551ca07e565394928642edee92acc042e546cb78" + integrity sha512-0v6idDCPG6epLXtBH/RPkHvYx74CVziHo6TMYga8O2EiQApnUPZsbR9nFNrg2cgBzk1AYqEd95TlrsL7nYABQg== + +lightningcss-linux-x64-musl@1.29.2: + version "1.29.2" + resolved "https://registry.yarnpkg.com/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.29.2.tgz#2fd164554340831bce50285b57101817850dd258" + integrity sha512-rMpz2yawkgGT8RULc5S4WiZopVMOFWjiItBT7aSfDX4NQav6M44rhn5hjtkKzB+wMTRlLLqxkeYEtQ3dd9696w== + +lightningcss-win32-arm64-msvc@1.29.2: + version "1.29.2" + resolved "https://registry.yarnpkg.com/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.29.2.tgz#da43ea49fafc5d2de38e016f1a8539d5eed98318" + integrity sha512-nL7zRW6evGQqYVu/bKGK+zShyz8OVzsCotFgc7judbt6wnB2KbiKKJwBE4SGoDBQ1O94RjW4asrCjQL4i8Fhbw== + +lightningcss-win32-x64-msvc@1.29.2: + version "1.29.2" + resolved "https://registry.yarnpkg.com/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.29.2.tgz#ddefaa099a39b725b2f5bbdcb9fc718435cc9797" + integrity sha512-EdIUW3B2vLuHmv7urfzMI/h2fmlnOQBk1xlsDxkN1tCWKjNFjfLhGxYk8C8mzpSfr+A6jFFIi8fU6LbQGsRWjA== + +lightningcss@1.29.2: + version "1.29.2" + resolved "https://registry.yarnpkg.com/lightningcss/-/lightningcss-1.29.2.tgz#f5f0fd6e63292a232697e6fe709da5b47624def3" + integrity sha512-6b6gd/RUXKaw5keVdSEtqFVdzWnU5jMxTUjA2bVcMNPLwSQ08Sv/UodBVtETLCn7k4S1Ibxwh7k68IwLZPgKaA== + dependencies: + detect-libc "^2.0.3" + optionalDependencies: + lightningcss-darwin-arm64 "1.29.2" + lightningcss-darwin-x64 "1.29.2" + lightningcss-freebsd-x64 "1.29.2" + lightningcss-linux-arm-gnueabihf "1.29.2" + lightningcss-linux-arm64-gnu "1.29.2" + lightningcss-linux-arm64-musl "1.29.2" + lightningcss-linux-x64-gnu "1.29.2" + lightningcss-linux-x64-musl "1.29.2" + lightningcss-win32-arm64-msvc "1.29.2" + lightningcss-win32-x64-msvc "1.29.2" + +micromatch@^4.0.5: + version "4.0.8" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" + integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== + dependencies: + braces "^3.0.3" + picomatch "^2.3.1" + +mri@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b" + integrity sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA== + +node-addon-api@^7.0.0: + version "7.1.1" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-7.1.1.tgz#1aba6693b0f255258a049d621329329322aad558" + integrity sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ== + +picocolors@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" + integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== + +picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +tailwindcss@4.1.4, tailwindcss@^4.1.4: + version "4.1.4" + resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-4.1.4.tgz#27b3c910c6f1a47f4540451f3faf7cdd6d977a69" + integrity sha512-1ZIUqtPITFbv/DxRmDr5/agPqJwF69d24m9qmM1939TJehgY539CtzeZRjbLt5G6fSy/7YqqYsfvoTEw9xUI2A== + +tapable@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" + integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +tslib@^2.4.0, tslib@^2.8.0: + version "2.8.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" + integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==