Skip to content

Commit

Permalink
fix: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
freesteph committed Jan 16, 2021
1 parent 451d060 commit 98db914
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 19 deletions.
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ gem 'jbuilder', '~> 2.5'
# gem 'bcrypt', '~> 3.1.7'

gem 'aws-sdk-s3', require: false
gem 'concurrent-ruby'
gem 'faker'
gem 'haml-rails'
gem 'image_processing'
gem 'sentry-raven'
gem 'therubyracer'
gem 'concurrent-ruby'

group :production do
gem 'bcrypt_pbkdf'
Expand Down Expand Up @@ -64,4 +64,4 @@ group :development do
gem 'web-console'
end

gem "tailwindcss-rails", "~> 0.1.0"
gem 'tailwindcss-rails', '~> 0.1.0'
2 changes: 1 addition & 1 deletion Guardfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"

# Note: The cmd option is now required due to the increasing number of ways
# NOTE: The cmd option is now required due to the increasing number of ways
# rspec may be run, below are examples of the most common uses.
# * bundler: 'bundle exec rspec'
# * bundler binstubs: 'bin/rspec'
Expand Down
4 changes: 1 addition & 3 deletions app/controllers/themes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ def index
end
end

if offset + PAGE_SIZE < @count
@next = themes_path(page: @page + 1)
end
@next = themes_path(page: @page + 1) unless offset + PAGE_SIZE >= @count

@themes = Theme
.perfect
Expand Down
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
)

if ENV['RAILS_LOG_TO_STDOUT'].present?
logger = ActiveSupport::Logger.new(STDOUT)
logger = ActiveSupport::Logger.new($stdout)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
end
Expand Down
2 changes: 1 addition & 1 deletion config/environments/staging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
)

if ENV['RAILS_LOG_TO_STDOUT'].present?
logger = ActiveSupport::Logger.new(STDOUT)
logger = ActiveSupport::Logger.new($stdout)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
end
Expand Down
6 changes: 3 additions & 3 deletions config/puma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches the default thread size of Active Record.
#
threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }
threads_count = ENV.fetch('RAILS_MAX_THREADS', 5)
threads threads_count, threads_count

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

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

# Specifies the number of `workers` to boot in clustered mode.
# Workers are forked webserver processes. If using threads and workers together
Expand Down
8 changes: 3 additions & 5 deletions lib/logging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@

module PeachMelpa
module Log
@logger = ::Logger.new(STDOUT)
@logger = ::Logger.new($stdout)

def self.info(name = '')
def self.info(name = '', &block)
return if ENV['RAILS_ENV'] == 'test'

raise 'cannot call logger without block' unless block_given?

@logger.info(name) do
yield
end
@logger.info(name, &block)
end
end
end
4 changes: 2 additions & 2 deletions lib/tasks/themes.rake
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ require "#{Rails.root}/lib/critic"
require "#{Rails.root}/lib/retrieval"
require "#{Rails.root}/lib/parsing"

namespace :themes do
SCREENSHOT_FOLDER = "#{Rails.root}/tmp/screenshots/"
SCREENSHOT_FOLDER = "#{Rails.root}/tmp/screenshots/"

namespace :themes do
desc 'grabs MELPA archives.json and put it in tmp'
task refresh: :environment do
PeachMelpa::Retrieval.refresh_melpa_archive
Expand Down
2 changes: 1 addition & 1 deletion spec/models/theme_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
end

describe '.capture_artifacts!' do
let(:folder_path) { PeachMelpa::Parsing::SCREENSHOT_FOLDER + 'foo-theme' }
let(:folder_path) { "#{PeachMelpa::Parsing::SCREENSHOT_FOLDER}foo-theme" }

before do
allow(variant).to receive(:parse!)
Expand Down

0 comments on commit 98db914

Please sign in to comment.