Skip to content

Commit

Permalink
# frozen_string_literal: true
Browse files Browse the repository at this point in the history
  • Loading branch information
j-f1 committed May 20, 2017
1 parent 383a695 commit 2c8b1ba
Show file tree
Hide file tree
Showing 296 changed files with 592 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Expand Up @@ -16,6 +16,9 @@ Style/Documentation:
Style/FileName:
Exclude:
- Gemfile
Style/FrozenStringLiteralComment:
EnforcedStyle: always
Enabled: true

# Want to refactor some stuff? Remove these.
Metrics/AbcSize:
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
@@ -1,3 +1,5 @@
# frozen_string_literal: true

source 'https://rubygems.org'

git_source(:github) do |repo_name|
Expand Down
10 changes: 5 additions & 5 deletions Gemfile.lock
@@ -1,30 +1,30 @@
GIT
remote: git://github.com/Charcoal-SE/aescrypt.git
remote: https://github.com/Charcoal-SE/aescrypt.git
revision: a40efa0bf95a251c89c64a8367a8edfd61f244f5
specs:
aescrypt (2.0.2)

GIT
remote: git://github.com/Charcoal-SE/will_paginate-bootstrap.git
remote: https://github.com/Charcoal-SE/will_paginate-bootstrap.git
revision: 95ee3e99801f391f47365a7946033e32714571a9
specs:
will_paginate-bootstrap (1.0.1)
will_paginate (>= 3.0.3)

GIT
remote: git://github.com/Undo1/db_fixtures_dump.git
remote: https://github.com/Undo1/db_fixtures_dump.git
revision: b2b4d1a354e3cdf6286c18bd252c2bba2aad5e0b
specs:
db_fixtures_dump (0.1.1)

GIT
remote: git://github.com/Undo1/will_paginate.git
remote: https://github.com/Undo1/will_paginate.git
revision: 6a9e3eadbe7d1a5264429bd7d0dc54d35f5a9d51
specs:
will_paginate (3.1.5)

GIT
remote: git://github.com/plataformatec/devise.git
remote: https://github.com/plataformatec/devise.git
revision: 079ed3b6f8b671acde2dd630d28d21adb010fb3a
branch: master
specs:
Expand Down
2 changes: 2 additions & 0 deletions Rakefile
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# 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.

Expand Down
2 changes: 2 additions & 0 deletions app/channels/api_channel.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class ApiChannel < ApplicationCable::Channel
def subscribed
@key = ApiKey.find_by_key(params[:key])
Expand Down
2 changes: 2 additions & 0 deletions app/channels/application_cable/channel.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file. Action Cable runs in a loop that does not support auto reloading.
module ApplicationCable
class Channel < ActionCable::Channel::Base
Expand Down
2 changes: 2 additions & 0 deletions app/channels/application_cable/connection.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file. Action Cable runs in a loop that does not support auto reloading.
module ApplicationCable
class Connection < ActionCable::Connection::Base
Expand Down
2 changes: 2 additions & 0 deletions app/channels/flag_logs_channel.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class FlagLogsChannel < ApplicationCable::Channel
def subscribed
stream_from 'flag_logs'
Expand Down
2 changes: 2 additions & 0 deletions app/channels/github_channel.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file. Action Cable runs in a loop that does not support auto reloading.
class GithubChannel < ApplicationCable::Channel
def subscribed
Expand Down
2 changes: 2 additions & 0 deletions app/channels/pings_channel.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file. Action Cable runs in a loop that does not support auto reloading.
class PingsChannel < ApplicationCable::Channel
def subscribed
Expand Down
2 changes: 2 additions & 0 deletions app/channels/posts_channel.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file. Action Cable runs in a loop that does not support auto reloading.
class PostsChannel < ApplicationCable::Channel
def subscribed
Expand Down
2 changes: 2 additions & 0 deletions app/channels/smoke_detector_channel.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file. Action Cable runs in a loop that does not support auto reloading.
class SmokeDetectorChannel < ApplicationCable::Channel
def subscribed
Expand Down
2 changes: 2 additions & 0 deletions app/channels/topbar_channel.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Be sure to restart your server when you modify this file. Action Cable runs in a loop that does not support auto reloading.
class TopbarChannel < ApplicationCable::Channel
def subscribed
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/admin_controller.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class AdminController < ApplicationController
before_action :verify_admin, except: [:user_feedback, :api_feedback, :users, :recently_invalidated, :index]
before_action :set_ignored_user, only: [:ignore, :unignore, :destroy_ignored]
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api_controller.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class ApiController < ApplicationController
before_action :verify_key, except: [:filter_generator, :api_docs, :filter_fields]
before_action :set_pagesize, except: [:filter_generator, :api_docs]
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api_keys_controller.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class ApiKeysController < ApplicationController
before_action :authenticate_user!
before_action :set_key, except: [:index, :new, :create, :mine]
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/application_controller.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/authentication_controller.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'open-uri'
include AuthenticationHelper

Expand Down
2 changes: 2 additions & 0 deletions app/controllers/code_status_controller.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

include ApiHelper

class CodeStatusController < ApplicationController
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/custom_sessions_controller.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class CustomSessionsController < Devise::SessionsController
protect_from_forgery except: [:create]

Expand Down
2 changes: 2 additions & 0 deletions app/controllers/dashboard_controller.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class DashboardController < ApplicationController
def index
@reasons = Reason.all.joins(:posts)
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/deletion_logs_controller.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class DeletionLogsController < ApplicationController
before_action :set_deletion_log, only: [:show, :edit, :update, :destroy]
before_action :check_if_smokedetector, only: :create
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/developer_controller.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class DeveloperController < ApplicationController
before_action :authenticate_user!, except: [:blank_page]
before_action :verify_developer, except: [:blank_page]
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/feedbacks_controller.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class FeedbacksController < ApplicationController
before_action :authenticate_user!, except: [:create]
before_action :set_feedback, only: [:show, :edit, :update, :destroy]
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/flag_conditions_controller.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class FlagConditionsController < ApplicationController
before_action :authenticate_user!
before_action :verify_admin, only: [:full_list, :user_overview]
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/flag_log_controller.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class FlagLogController < ApplicationController
respond_to :html, :js

Expand Down
2 changes: 2 additions & 0 deletions app/controllers/flag_settings_controller.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class FlagSettingsController < ApplicationController
protect_from_forgery except: [:smokey_disable_flagging]
before_action :set_flag_setting, only: [:edit, :update]
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/github_controller.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'open-uri'
include ApiHelper

Expand Down
2 changes: 2 additions & 0 deletions app/controllers/graphs_controller.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class GraphsController < ApplicationController
def index; end

Expand Down
2 changes: 2 additions & 0 deletions app/controllers/micro_auth_controller.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class MicroAuthController < ApplicationController
before_action :authenticate_user!, except: [:token]
before_action :verify_key, except: [:invalid_key, :authorized]
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/posts_controller.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class PostsController < ApplicationController
protect_from_forgery except: [:create]
before_action :check_if_smokedetector, only: :create
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/reasons_controller.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class ReasonsController < ApplicationController
def show
@reason = Reason.find(params[:id])
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/review_controller.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class ReviewController < ApplicationController
before_action :authenticate_user!
skip_before_action :verify_authenticity_token, only: [:add_feedback]
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/search_controller.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class SearchController < ApplicationController
def search_results
# This might be ugly, but it's better than the alternative.
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/smoke_detectors_controller.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class SmokeDetectorsController < ApplicationController
before_action :authenticate_user!, except: [:audits]
before_action :verify_admin, except: [:audits, :force_failover]
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/stack_exchange_users_controller.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class StackExchangeUsersController < ApplicationController
before_action :authenticate_user!, only: [:update_data]
before_action :set_stack_exchange_user, only: [:show]
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/statistics_controller.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class StatisticsController < ApplicationController
protect_from_forgery except: [:create]
before_action :check_if_smokedetector, only: [:create]
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/status_controller.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class StatusController < ApplicationController
protect_from_forgery except: [:status_update]
before_action :check_if_smokedetector, only: [:status_update]
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/user_site_settings_controller.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class UserSiteSettingsController < ApplicationController
before_action :authenticate_user!
before_action :verify_admin, only: [:for_user]
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/users_controller.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class UsersController < ApplicationController
before_action :authenticate_user!

Expand Down
2 changes: 2 additions & 0 deletions app/helpers/api_helper.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ApiHelper
def authorized_get(uri, options = {})
authorized_request(uri, :get, options)
Expand Down
2 changes: 2 additions & 0 deletions app/helpers/api_keys_helper.rb
@@ -1,2 +1,4 @@
# frozen_string_literal: true

module ApiKeysHelper
end
2 changes: 2 additions & 0 deletions app/helpers/application_helper.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ApplicationHelper
def title(text)
content_for :title, text
Expand Down
2 changes: 2 additions & 0 deletions app/helpers/authentication_helper.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module AuthenticationHelper
def auth_url(scope, redirect_uri)
config = AppConfig['stack_exchange']
Expand Down
2 changes: 2 additions & 0 deletions app/helpers/code_status_helper.rb
@@ -1,2 +1,4 @@
# frozen_string_literal: true

module CodeStatusHelper
end
2 changes: 2 additions & 0 deletions app/helpers/custom_sessions_helper.rb
@@ -1,2 +1,4 @@
# frozen_string_literal: true

module CustomSessionsHelper
end
2 changes: 2 additions & 0 deletions app/helpers/deletion_logs_helper.rb
@@ -1,2 +1,4 @@
# frozen_string_literal: true

module DeletionLogsHelper
end
2 changes: 2 additions & 0 deletions app/helpers/developer_helper.rb
@@ -1,2 +1,4 @@
# frozen_string_literal: true

module DeveloperHelper
end
2 changes: 2 additions & 0 deletions app/helpers/feedbacks_helper.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module FeedbacksHelper
def element_class_for_feedback(f)
if f.is_negative?
Expand Down
2 changes: 2 additions & 0 deletions app/helpers/flag_conditions_helper.rb
@@ -1,2 +1,4 @@
# frozen_string_literal: true

module FlagConditionsHelper
end
2 changes: 2 additions & 0 deletions app/helpers/flag_log_helper.rb
@@ -1,2 +1,4 @@
# frozen_string_literal: true

module FlagLogHelper
end
2 changes: 2 additions & 0 deletions app/helpers/flag_settings_helper.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module FlagSettingsHelper
def flag_settings_plot_lines(start_time, end_time = Time.now)
setting_ids = FlagSetting.where(name: %w[max_flags min_accuracy]).pluck(:id)
Expand Down
2 changes: 2 additions & 0 deletions app/helpers/graphs_helper.rb
@@ -1,2 +1,4 @@
# frozen_string_literal: true

module GraphsHelper
end
2 changes: 2 additions & 0 deletions app/helpers/micro_auth_helper.rb
@@ -1,2 +1,4 @@
# frozen_string_literal: true

module MicroAuthHelper
end
2 changes: 2 additions & 0 deletions app/helpers/number_helper.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module NumberHelper
def number_to_multiplicative_quantifier(n)
return 'once' if n == 1
Expand Down
2 changes: 2 additions & 0 deletions app/helpers/posts_helper.rb
@@ -1,2 +1,4 @@
# frozen_string_literal: true

module PostsHelper
end
2 changes: 2 additions & 0 deletions app/helpers/reasons_helper.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ReasonsHelper
def self.check_for_inactive_reasons
Reason.where(inactive: false).each do |reason|
Expand Down
2 changes: 2 additions & 0 deletions app/helpers/search_helper.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module SearchHelper
def self.parse_search_params(params, symbol, user_signed_in)
input = params[symbol] || ''
Expand Down
2 changes: 2 additions & 0 deletions app/helpers/sites_helper.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module SitesHelper
def self.update_sites
require 'net/http'
Expand Down
2 changes: 2 additions & 0 deletions app/helpers/smoke_detectors_helper.rb
@@ -1,2 +1,4 @@
# frozen_string_literal: true

module SmokeDetectorsHelper
end
2 changes: 2 additions & 0 deletions app/helpers/statistics_helper.rb
@@ -1,2 +1,4 @@
# frozen_string_literal: true

module StatisticsHelper
end
2 changes: 2 additions & 0 deletions app/helpers/user_site_settings_helper.rb
@@ -1,2 +1,4 @@
# frozen_string_literal: true

module UserSiteSettingsHelper
end
2 changes: 2 additions & 0 deletions app/mailers/application_mailer.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class ApplicationMailer < ActionMailer::Base
default from: 'metasmoke@erwaysoftware.com'
layout 'mailer'
Expand Down

0 comments on commit 2c8b1ba

Please sign in to comment.