Skip to content

Commit

Permalink
revert rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
microstudi committed Feb 5, 2024
1 parent 939828b commit e50f58c
Show file tree
Hide file tree
Showing 15 changed files with 80 additions and 60 deletions.
4 changes: 2 additions & 2 deletions bin/bundle
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
load Gem.bin_path("bundler", "bundle")
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
load Gem.bin_path('bundler', 'bundle')
16 changes: 16 additions & 0 deletions bin/cap
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env ruby
#
# This file was generated by Bundler.
#
# The application 'cap' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

require 'rubygems'
require 'bundler/setup'

load Gem.bin_path('capistrano', 'cap')
6 changes: 3 additions & 3 deletions bin/rails
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env ruby
APP_PATH = File.expand_path("../config/application", __dir__)
require_relative "../config/boot"
require "rails/commands"
APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot'
require 'rails/commands'
4 changes: 2 additions & 2 deletions bin/rake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env ruby
require_relative "../config/boot"
require "rake"
require_relative '../config/boot'
require 'rake'
Rake.application.run
16 changes: 8 additions & 8 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env ruby
require "fileutils"
require 'fileutils'

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

def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
Expand All @@ -13,16 +13,16 @@ FileUtils.chdir APP_ROOT do
# This script is idempotent, so that you can run it at anytime and get an expectable outcome.
# Add necessary setup steps to this file.

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

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

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

puts "\n== Restarting application server =="
system! "bin/rails restart"
system! 'bin/rails restart'
end
4 changes: 1 addition & 3 deletions config/initializers/active_admin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
admin.build_menu :utility_navigation do |menu|
menu.add id: :languages, label: -> { "Languages (#{I18n.t("locales.#{locale}")})" } do |lang|
I18n.available_locales.each do |locale|
lang.add label: I18n.t("locales.#{locale}", locale: locale), url: -> {
url_for(locale: locale)
}
lang.add label: I18n.t("locales.#{locale}", locale: locale), url: ->{ url_for(locale: locale) }
end
end
admin.add_current_user_to_menu menu
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/assets.rb
Original file line number Diff line number Diff line change
@@ -1,7 +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"
Rails.application.config.assets.version = '1.0'

# Add additional assets to the asset load path.
# Rails.application.config.assets.paths << Emoji.images_path
14 changes: 7 additions & 7 deletions config/initializers/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
# The secret key used by Devise. Devise uses this key to generate
# random tokens. Changing this key will render invalid all existing
# confirmation, reset password and unlock tokens in the database.
config.secret_key = "314feb2dc06c4ff725d7c53e4d9d9aeda03dc2b7aa9ee1a9b74fbb48991c3dfb937165d752108c6406942f40ac4cf7786d71cf30869eeece2e8d9be1a5c3b1cb"
config.secret_key = '314feb2dc06c4ff725d7c53e4d9d9aeda03dc2b7aa9ee1a9b74fbb48991c3dfb937165d752108c6406942f40ac4cf7786d71cf30869eeece2e8d9be1a5c3b1cb'

# ==> Mailer Configuration
# Configure the e-mail address which will be shown in Devise::Mailer,
# note that it will be overwritten if you use your own mailer class
# with default "from" parameter.
config.mailer_sender = ENV["MAILER_SENDER"] || "[email protected]"
config.mailer_sender = ENV['MAILER_SENDER'] || '[email protected]'

# Configure the class responsible to send e-mails.
# config.mailer = 'Devise::Mailer'
Expand All @@ -19,7 +19,7 @@
# Load and configure the ORM. Supports :active_record (default) and
# :mongoid (bson_ext recommended) by default. Other ORMs may be
# available as additional gems.
require "devise/orm/active_record"
require 'devise/orm/active_record'

# ==> Configuration for any authentication mechanism
# Configure which keys are used when authenticating a user. The default is
Expand All @@ -41,12 +41,12 @@
# Configure which authentication keys should be case-insensitive.
# These keys will be downcased upon creating or modifying a user and when used
# to authenticate or find a user. Default is :email.
config.case_insensitive_keys = [:email]
config.case_insensitive_keys = [ :email ]

# Configure which authentication keys should have whitespace stripped.
# These keys will have whitespace before and after removed upon creating or
# modifying a user and when used to authenticate or find a user. Default is :email.
config.strip_whitespace_keys = [:email]
config.strip_whitespace_keys = [ :email ]

# Tell if authentication through request.params is enabled. True by default.
# It can be set to an array that will enable params authentication only for the
Expand Down Expand Up @@ -123,7 +123,7 @@
config.reconfirmable = true

# Defines which key will be used when confirming an account
config.confirmation_keys = [:email]
config.confirmation_keys = [ :email ]

# ==> Configuration for :rememberable
# The time the user will be remembered without asking for credentials again.
Expand Down Expand Up @@ -160,7 +160,7 @@
config.lock_strategy = :failed_attempts

# Defines which key will be used when locking and unlocking an account
config.unlock_keys = [:email]
config.unlock_keys = [ :email ]

# Defines which strategy will be used to unlock an account.
# :email = Sends an unlock link to the user email
Expand Down
6 changes: 3 additions & 3 deletions config/initializers/ransack.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Ransack.configure do |config|
config.add_predicate "unaccent_cont",
arel_predicate: "matches",
config.add_predicate 'unaccent_cont',
arel_predicate: 'matches',
formatter: proc { |s| ActiveSupport::Inflector.transliterate("%#{s}%") },
validator: proc { |s| s.present? },
compounds: true,
type: :string
end
end
17 changes: 9 additions & 8 deletions config/initializers/rollbar.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
require "rollbar/rails"
require 'rollbar/rails'
Rollbar.configure do |config|
# Without configuration, Rollbar is enabled in all environments.
# To disable in specific environments, set config.enabled=false.

config.access_token = ENV["ROLLBAR_ACCESS_TOKEN"]
config.access_token = ENV['ROLLBAR_ACCESS_TOKEN']

# Here we'll disable in 'test':
if Rails.env.test? or ENV["ROLLBAR_ACCESS_TOKEN"].blank?
if Rails.env.test? or ENV['ROLLBAR_ACCESS_TOKEN'].blank?
config.enabled = false
end


# By default, Rollbar will try to call the `current_user` controller method
# to fetch the logged-in user object, and then call that object's `id`,
Expand All @@ -33,13 +34,13 @@
# You can also specify a callable, which will be called with the exception instance.

# Ignore the typical "attacks..."
config.exception_level_filters.merge!("ActionController::RoutingError" => lambda { |e|
config.exception_level_filters.merge!('ActionController::RoutingError' => lambda { |e|
e.message =~ %r(No route matches \[[A-Z]+\] "/(.+)")
case $1.split("/").first.to_s.downcase
when "myadmin", "phpmyadmin", "w00tw00t", "pma", "cgi-bin", "xmlrpc.php", "wp", "wordpress", "cfide"
"ignore"
when *%w(myadmin phpmyadmin w00tw00t pma cgi-bin xmlrpc.php wp wordpress cfide)
'ignore'
else
"warning"
'warning'
end
})

Expand Down
2 changes: 1 addition & 1 deletion config/initializers/session_store.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Be sure to restart your server when you modify this file.

Rails.application.config.session_store :cookie_store, key: "_timeoverflow_session"
Rails.application.config.session_store :cookie_store, key: '_timeoverflow_session'
5 changes: 5 additions & 0 deletions config/initializers/sidekiq.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
schedule_file = 'config/schedule.yml'

if File.exist?(schedule_file) && Sidekiq.server?
Sidekiq::Cron::Job.load_from_hash YAML.load_file(schedule_file)
end
14 changes: 7 additions & 7 deletions config/initializers/simple_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# wrapper, change the order or even add your own to the
# stack. The options given below are used to wrap the
# whole input.
config.wrappers :default, class: :input,
hint_class: :field_with_hint, error_class: :field_with_errors do |b|
config.wrappers :default, :class => :input,
:hint_class => :field_with_hint, :error_class => :field_with_errors do |b|
## Extensions enabled by default
# Any of these extensions can be disabled for a
# given input by passing: `f.input EXTENSION_NAME => false`.
Expand Down Expand Up @@ -41,8 +41,8 @@

## Inputs
b.use :label_input
b.use :hint, wrap_with: { tag: :span, class: :hint }
b.use :error, wrap_with: { tag: :span, class: :error }
b.use :hint, :wrap_with => { :tag => :span, :class => :hint }
b.use :error, :wrap_with => { :tag => :span, :class => :error }
end

# The default wrapper to be used by the FormBuilder.
Expand All @@ -55,7 +55,7 @@
config.boolean_style = :nested

# Default class for buttons
config.button_class = "btn btn-default"
config.button_class = 'btn btn-default'

# Method used to tidy up errors. Specify any Rails Array method.
# :first lists the first message for each field.
Expand All @@ -66,7 +66,7 @@
config.error_notification_tag = :div

# CSS class to add for error notification helper.
config.error_notification_class = "alert alert-danger"
config.error_notification_class = 'alert alert-danger'

# ID to add for error notification helper.
# config.error_notification_id = nil
Expand Down Expand Up @@ -95,7 +95,7 @@
# config.label_text = lambda { |label, required| "#{required} #{label}" }

# You can define the class to use on all labels. Default is nil.
config.label_class = "control-label"
config.label_class = 'control-label'

# You can define the class to use on all forms. Default is simple_form.
# config.form_class = :simple_form
Expand Down
28 changes: 14 additions & 14 deletions config/initializers/simple_form_bootstrap.rb
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
# Use this setup block to configure all options available in SimpleForm.
SimpleForm.setup do |config|
config.wrappers :bootstrap, tag: "div", class: "form-group", error_class: "error" do |b|
config.wrappers :bootstrap, :tag => 'div', :class => 'form-group', :error_class => 'error' do |b|
b.use :html5
b.use :placeholder
b.use :label
# b.wrapper :tag => 'div', :class => 'controls' do |ba|
b.use :input, class: "form-control"
# ba.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
# ba.use :hint, :wrap_with => { :tag => 'p', :class => 'help-block' }
b.use :input, :class => "form-control"
# ba.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
# ba.use :hint, :wrap_with => { :tag => 'p', :class => 'help-block' }
# end
end

config.wrappers :prepend, tag: "div", class: "form-group", error_class: "error" do |b|
config.wrappers :prepend, :tag => 'div', :class => "form-group", :error_class => 'error' do |b|
b.use :html5
b.use :placeholder
b.use :label
b.wrapper tag: "div", class: "controls" do |input|
input.wrapper tag: "div", class: "input-prepend" do |prepend|
b.wrapper :tag => 'div', :class => 'controls' do |input|
input.wrapper :tag => 'div', :class => 'input-prepend' do |prepend|
prepend.use :input
end
input.use :hint, wrap_with: { tag: "span", class: "help-block" }
input.use :error, wrap_with: { tag: "span", class: "help-inline" }
input.use :hint, :wrap_with => { :tag => 'span', :class => 'help-block' }
input.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
end
end

config.wrappers :append, tag: "div", class: "form-group", error_class: "error" do |b|
config.wrappers :append, :tag => 'div', :class => "form-group", :error_class => 'error' do |b|
b.use :html5
b.use :placeholder
b.use :label
b.wrapper tag: "div", class: "controls" do |input|
input.wrapper tag: "div", class: "input-append" do |append|
b.wrapper :tag => 'div', :class => 'controls' do |input|
input.wrapper :tag => 'div', :class => 'input-append' do |append|
append.use :input
end
input.use :hint, wrap_with: { tag: "span", class: "help-block" }
input.use :error, wrap_with: { tag: "span", class: "help-inline" }
input.use :hint, :wrap_with => { :tag => 'span', :class => 'help-block' }
input.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
end
end

Expand Down
2 changes: 1 addition & 1 deletion config/initializers/superadmins.rb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ADMINS = ENV["ADMINS"].to_s.split
ADMINS = ENV["ADMINS"].to_s.split

0 comments on commit e50f58c

Please sign in to comment.