-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use rubocop to have consistent styling across the application
- Loading branch information
Showing
29 changed files
with
260 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
AllCops: | ||
TargetRubyVersion: 3.0 | ||
NewCops: disable | ||
Include: | ||
- '**/*.rb' | ||
- '**/Gemfile' | ||
- '**/Rakefile' | ||
- '**/config.ru' | ||
- 'lib/**/*.rake' | ||
Exclude: | ||
- 'db/**/*' | ||
- 'vendor/**/*' | ||
- 'node_modules/**/*' | ||
- 'bin/*' | ||
|
||
Metrics/AbcSize: | ||
Enabled: false | ||
|
||
Metrics/BlockLength: | ||
Enabled: false | ||
|
||
Metrics/ClassLength: | ||
Enabled: false | ||
|
||
Layout/LineLength: | ||
Max: 160 | ||
|
||
Metrics/MethodLength: | ||
Enabled: false | ||
|
||
Metrics/ModuleLength: | ||
Enabled: false | ||
|
||
Metrics/PerceivedComplexity: | ||
Enabled: false | ||
|
||
Metrics/CyclomaticComplexity: | ||
Enabled: false | ||
|
||
Style/Documentation: | ||
Enabled: false | ||
|
||
Style/FormatStringToken: | ||
Enabled: false | ||
|
||
# This cop is designed to help upgrade to Ruby 3.0. | ||
# It will add the comment `# frozen_string_literal: true` to the top of files to enable frozen string literals. | ||
# Frozen string literals will be default in Ruby 3.0. The comment will be added below a shebang and encoding comment. | ||
# The frozen string literal comment is only valid in Ruby 2.3+. | ||
Style/FrozenStringLiteralComment: | ||
Enabled: false | ||
|
||
Style/SymbolArray: | ||
EnforcedStyle: brackets | ||
|
||
Style/WordArray: | ||
EnforcedStyle: brackets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +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" | ||
require_relative 'config/application' | ||
|
||
Rails.application.load_tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
class ApplicationMailer < ActionMailer::Base | ||
default from: "[email protected]" | ||
layout "mailer" | ||
default from: '[email protected]' | ||
layout 'mailer' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
module ApiClient | ||
class Openai | ||
include HTTParty | ||
base_uri "https://api.openai.com" | ||
headers "Authorization" => "Bearer #{Rails.application.credentials.openai.token}", | ||
"Content-Type" => "application/json" | ||
base_uri 'https://api.openai.com' | ||
headers 'Authorization' => "Bearer #{Rails.application.credentials.openai.token}", | ||
'Content-Type' => 'application/json' | ||
raise_on [400, 401, 403, 404, 409, 415, 422, 500] | ||
format :json | ||
def self.generate_image(prompt: , size:) | ||
post("/v1/images/generations", body: { prompt: prompt, n: 1, size: size }.to_json) | ||
.parsed_response.dig("data", 0, "url") | ||
def self.generate_image(prompt:, size:) | ||
post('/v1/images/generations', body: { prompt: prompt, n: 1, size: size }.to_json) | ||
.parsed_response.dig('data', 0, 'url') | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# This file is used by Rack-based servers to start the application. | ||
|
||
require_relative "config/environment" | ||
require_relative 'config/environment' | ||
|
||
run Rails.application | ||
Rails.application.load_server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) | ||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) | ||
|
||
require "bundler/setup" # Set up gems listed in the Gemfile. | ||
require "bootsnap/setup" # Speed up boot time by caching expensive operations. | ||
require 'bundler/setup' # Set up gems listed in the Gemfile. | ||
require 'bootsnap/setup' # Speed up boot time by caching expensive operations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Load the Rails application. | ||
require_relative "application" | ||
require_relative 'application' | ||
|
||
# Initialize the Rails application. | ||
Rails.application.initialize! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# Pin npm packages by running ./bin/importmap | ||
|
||
pin "application", preload: true | ||
pin "@hotwired/turbo-rails", to: "turbo.min.js", preload: true | ||
pin "@hotwired/stimulus", to: "stimulus.min.js", preload: true | ||
pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true | ||
pin_all_from "app/javascript/controllers", under: "controllers" | ||
pin 'application', preload: true | ||
pin '@hotwired/turbo-rails', to: 'turbo.min.js', preload: true | ||
pin '@hotwired/stimulus', to: 'stimulus.min.js', preload: true | ||
pin '@hotwired/stimulus-loading', to: 'stimulus-loading.js', preload: true | ||
pin_all_from 'app/javascript/controllers', under: 'controllers' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,5 @@ | |
end | ||
|
||
# Defines the root path route ("/") | ||
root "home#index" | ||
root 'home#index' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.