mirror of
https://github.com/Neetpone/foalfetch.git
synced 2025-03-11 14:10:07 +01:00
style: rubocop
This commit is contained in:
parent
14f2591c1c
commit
efa9d065e3
9 changed files with 32 additions and 22 deletions
|
@ -48,7 +48,7 @@ Style/ClassVars:
|
|||
Style/ClassAndModuleChildren:
|
||||
EnforcedStyle: compact
|
||||
|
||||
# This does the oppposite of what I want to do.
|
||||
# This does the opposite of what I want to do.
|
||||
Layout/HashAlignment:
|
||||
Enabled: false
|
||||
|
||||
|
@ -61,3 +61,7 @@ Style/NumericPredicate:
|
|||
# I've always been an "unnecessary this->" guy myself.
|
||||
Style/RedundantSelf:
|
||||
Enabled: false
|
||||
|
||||
# Story downloads rely on this.
|
||||
Rails/RenderInline:
|
||||
Enabled: false
|
|
@ -15,8 +15,7 @@ class ImagesController < ApplicationController
|
|||
|
||||
ext = File.extname(url)
|
||||
hash = Digest::SHA256.hexdigest(url)
|
||||
path = Rails.root.join('public', 'cached-images', hash + ext)
|
||||
our_url = "/cached-images/#{hash}#{ext}"
|
||||
path = Rails.public_path.join('cached-images', hash + ext)
|
||||
content_type = nil
|
||||
|
||||
if File.exist? path
|
||||
|
|
|
@ -70,12 +70,12 @@ class SearchController < ApplicationController
|
|||
|
||||
# returns: [included tags, excluded tags]
|
||||
def parse_tag_queries
|
||||
tag_searches = "#{@search_params[:tags]},#{@search_params[:characters]}".split(',').reject(&:blank?)
|
||||
tag_searches = "#{@search_params[:tags]},#{@search_params[:characters]}".split(',').compact_blank
|
||||
|
||||
[
|
||||
tag_searches.reject { |t| t[0] == '-' },
|
||||
tag_searches.select { |t| t[0] == '-' }
|
||||
.map { |t| t[1..] }
|
||||
.pluck(1..)
|
||||
]
|
||||
end
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: visit_counts
|
||||
|
|
|
@ -41,7 +41,7 @@ m = Module.new do
|
|||
|
||||
def gemfile
|
||||
gemfile = ENV['BUNDLE_GEMFILE']
|
||||
return gemfile if gemfile && !gemfile.empty?
|
||||
return gemfile if gemfile.present?
|
||||
|
||||
File.expand_path('../Gemfile', __dir__)
|
||||
end
|
||||
|
|
|
@ -26,8 +26,14 @@ Bundler.require(*Rails.groups)
|
|||
#
|
||||
# config.time_zone = "Central Time (US & Canada)"
|
||||
# config.eager_load_paths << Rails.root.join("extras")
|
||||
module Foalfetch
|
||||
class Application < Rails::Application
|
||||
# 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")
|
||||
class Foalfetch::Application < Rails::Application
|
||||
# Initialize configuration defaults for originally generated Rails version.
|
||||
config.load_defaults 7.0
|
||||
|
||||
|
@ -39,4 +45,3 @@ module Foalfetch
|
|||
# config.time_zone = "Central Time (US & Canada)"
|
||||
# config.eager_load_paths << Rails.root.join("extras")
|
||||
end
|
||||
end
|
|
@ -1,5 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
require "test_helper"
|
||||
require 'test_helper'
|
||||
|
||||
class BlogsControllerTest < ActionDispatch::IntegrationTest
|
||||
# test "the truth" do
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
require "test_helper"
|
||||
require 'test_helper'
|
||||
|
||||
class BlogTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: visit_counts
|
||||
|
@ -6,7 +7,7 @@
|
|||
# count :integer default(0), not null
|
||||
# date :date not null
|
||||
#
|
||||
require "test_helper"
|
||||
require 'test_helper'
|
||||
|
||||
class VisitCountTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
|
|
Loading…
Add table
Reference in a new issue