Add # frozen_string_literal: true to all files

This commit is contained in:
Benjamin Neff 2017-08-27 18:04:06 +02:00
parent 44ebc7375a
commit e82690963d
No known key found for this signature in database
GPG key ID: 971464C3F1A90194
738 changed files with 1470 additions and 4 deletions

View file

@ -170,10 +170,6 @@ Layout/DotPosition:
### backward compatibility
# only with ruby >= 2.3
Style/FrozenStringLiteralComment:
Enabled: false
# only with ruby >= 2.4
Performance/RegexpMatch:
Enabled: false

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
source "https://rubygems.org"
gem "rails", "5.1.3"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
guard :rspec, cmd: "bin/spring rspec", all_on_start: false, all_after_pass: false do
watch(/^spec\/.+_spec\.rb$/)
watch(/^lib\/(.+)\.rb$/) {|m| "spec/lib/#{m[1]}_spec.rb" }

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Admin
class AdminController < ApplicationController
before_action :authenticate_user!

View file

@ -1,4 +1,6 @@
# frozen_string_literal: true
module Admin
class PodsController < AdminController
respond_to :html, :json, :mobile

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Admin
class UsersController < AdminController

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AdminsController < Admin::AdminController
include ApplicationHelper

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Api
module OpenidConnect
class AuthorizationsController < ApplicationController

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Api
module OpenidConnect
class ClientsController < ApplicationController

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2011 nov matake
#
# Permission is hereby granted, free of charge, to any person obtaining

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2011 nov matake
#
# Permission is hereby granted, free of charge, to any person obtaining

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Api
module OpenidConnect
class TokenEndpointController < ApplicationController

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Api
module OpenidConnect
class UserApplicationsController < ApplicationController

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Api
module OpenidConnect
class UserInfoController < ApplicationController

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Api
module V0
class BaseController < ApplicationController

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2012, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class BlocksController < ApplicationController
before_action :authenticate_user!

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class ConversationsController < ApplicationController
before_action :authenticate_user!
respond_to :html, :mobile, :json, :js

View file

@ -1,2 +1,4 @@
# frozen_string_literal: true
class HelpController < ApplicationController
end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2012, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class InvitationCodesController < ApplicationController
before_action :ensure_valid_invite_code

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class NodeInfoController < ApplicationController
def jrd
render json: NodeInfo.jrd(CGI.unescape(node_info_url("123.123").sub("123.123", "%{version}")))

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class ParticipationsController < ApplicationController
before_action :authenticate_user!

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class PollParticipationsController < ApplicationController
before_action :authenticate_user!

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class ResharesController < ApplicationController
before_action :authenticate_user!, except: :index
respond_to :json

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class SearchController < ApplicationController
before_action :authenticate_user!

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class SocialRelayController < ApplicationController
respond_to :json

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActivityStreamsHelper
def add_activitystreams_author(target, person)
target.author do |author|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ContactsHelper
def start_a_conversation_link(aspect, contacts_size)
conv_opts = { class: "conversation_button contacts_button"}

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ConversationsHelper
def conversation_class(conversation, unread_count, selected_conversation_id)
conv_class = unread_count > 0 ? "unread " : ""

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module GonHelper
def gon_load_contact(contact)
Gon.preloads[:contacts] ||= []

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module InterimStreamHackinessHelper
def commenting_disabled?(post)
return true unless user_signed_in?

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module InvitationCodesHelper
def invite_hidden_tag(invite)
if invite.present?

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module JsxcHelper
def get_bosh_endpoint
proto = AppConfig.chat.server.bosh.proto

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module LanguageHelper
include ApplicationHelper

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module MetaDataHelper
include ActionView::Helpers::AssetUrlHelper
include ActionView::Helpers::TagHelper

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module MobileHelper
def mobile_reshare_icon(post)
if (post.public? || reshare?(post)) && (user_signed_in? && post.author != current_user.person)

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module NotificationsHelper
include PeopleHelper
include PostsHelper

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module NotifierHelper
# @param post [Post] The post object.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module OEmbedHelper
def o_embed_html(cache)
data = cache.data

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module OpenGraphHelper
def og_html(cache)
"<a href=\"#{cache.url}\" target=\"_blank\">" +

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2012, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2012, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ServicesHelper
def contact_proxy(friend)
friend.contact || contact_proxy_template.dup.tap {|c| c.person = friend.person }

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module SessionsHelper
def prefilled_username
uri = Addressable::URI.parse(session["user_return_to"])

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module TagsHelper
def looking_for_tag_link
return if search_query.include?('@') || normalize_tag_name(search_query).blank?

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module UserApplicationsHelper
def user_application_name(app)
if app.name?

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module UsersHelper
def owner_image_tag(size=nil)
person_image_tag(current_user.person, size)

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class ApplicationMailer < ActionMailer::Base
default from: "\"#{AppConfig.settings.pod_name}\" <#{AppConfig.mail.sender_address}>"
end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class DiasporaDeviseMailer < Devise::Mailer
default from: "\"#{AppConfig.settings.pod_name}\" <#{AppConfig.mail.sender_address}>"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class ExportMailer < ApplicationMailer
def export_complete_for(user)
@user = user

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Maintenance < ApplicationMailer
def account_removal_warning(user)
@user = user

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module NotificationMailers
class AlsoCommented < NotificationMailers::Base
attr_accessor :comment

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module NotificationMailers
class Base
include Diaspora::Logging

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module NotificationMailers
class CommentOnPost < NotificationMailers::Base
attr_accessor :comment

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module NotificationMailers
class ConfirmEmail < NotificationMailers::Base
def set_headers

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module NotificationMailers
class CsrfTokenFail < NotificationMailers::Base
def set_headers

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module NotificationMailers
class Liked < NotificationMailers::Base
attr_accessor :like

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module NotificationMailers
class Mentioned < NotificationMailers::Base
attr_accessor :post

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module NotificationMailers
class MentionedInComment < NotificationMailers::Base
attr_reader :comment

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module NotificationMailers
class PrivateMessage < NotificationMailers::Base
attr_accessor :message, :conversation, :participants

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module NotificationMailers
class Reshared < NotificationMailers::Base
attr_accessor :reshare

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module NotificationMailers
class StartedSharing < NotificationMailers::Base
def set_headers(*_args) # rubocop:disable Style/AccessorMethodName

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Notifier < ApplicationMailer
helper :application
helper :notifier

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class ReportMailer < ApplicationMailer
def self.new_report(report_id)
report = Report.find_by_id(report_id)

Some files were not shown because too many files have changed in this diff Show more