Skip to content

Commit

Permalink
Add frozen string literal pragma to all files
Browse files Browse the repository at this point in the history
  • Loading branch information
tsujigiri committed Dec 27, 2016
1 parent ef75a7b commit f88be45
Show file tree
Hide file tree
Showing 279 changed files with 286 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ Style/TrailingCommaInLiteral:
# Only relevant for Rails 5.
Rails/HttpPositionalArguments:
Enabled: false

Style/FrozenStringLiteralComment:
EnforcedStyle: always
1 change: 1 addition & 0 deletions Capfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
load 'deploy'
# Uncomment if you are using Rails' asset pipeline
# load 'deploy/assets'
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
source 'https://rubygems.org'

gem 'dotenv-rails'
Expand Down
1 change: 1 addition & 0 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# A sample Guardfile
# More info at https://github.com/guard/guard#readme

Expand Down
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# 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
6 changes: 6 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# TODO

* fix postfix
* trigger paper searches from parsing worker
* unique/scheduled recommender jobs
* persist `echo 1 > /proc/sys/vm/overcommit_memory` on redis machine
1 change: 1 addition & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# -*- mode: ruby -*-
# vi: set ft=ruby :

Expand Down
1 change: 1 addition & 0 deletions app/controllers/achievements_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class AchievementsController < ApplicationController

def show
Expand Down
1 change: 1 addition & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class ApplicationController < ActionController::Base
protect_from_forgery
helper :all
Expand Down
1 change: 1 addition & 0 deletions app/controllers/beacon_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# simple Beacon implementation according to the GA4GH v0.2 standard
# see http://dnastack.com/ga4gh/bob/subscribe.html
# chrom={chromosome}&
Expand Down
1 change: 1 addition & 0 deletions app/controllers/das_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class DasController < ApplicationController

def show
Expand Down
1 change: 1 addition & 0 deletions app/controllers/fitbit_profiles_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class FitbitProfilesController < ApplicationController
before_filter :require_user, except: [:new_notification, :show, :index]
before_filter :require_user, only: [:update,:destroy,:init,:edit,:start_auth,:verify_auth,:dump]
Expand Down
1 change: 1 addition & 0 deletions app/controllers/genotypes_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class GenotypesController < ApplicationController

before_filter :require_user, except: [ :show, :feed,:index,:dump_download ]
Expand Down
1 change: 1 addition & 0 deletions app/controllers/index_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class IndexController < ApplicationController
def index
if current_user
Expand Down
1 change: 1 addition & 0 deletions app/controllers/messages_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class MessagesController < ApplicationController
before_filter :require_user
before_filter :require_owner, only: [:show, :destroy]
Expand Down
1 change: 1 addition & 0 deletions app/controllers/news_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class NewsController < ApplicationController

def index
Expand Down
1 change: 1 addition & 0 deletions app/controllers/password_resets_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class PasswordResetsController < ApplicationController

before_filter :load_user_using_perishable_token, :only => [:edit, :update]
Expand Down
1 change: 1 addition & 0 deletions app/controllers/phenotype_comments_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class PhenotypeCommentsController < ApplicationController
before_filter :require_user

Expand Down
1 change: 1 addition & 0 deletions app/controllers/phenotype_sets_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class PhenotypeSetsController < ApplicationController
before_filter :require_user

Expand Down
1 change: 1 addition & 0 deletions app/controllers/phenotypes_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class PhenotypesController < ApplicationController
before_filter :require_user, only: %i(new create get_genotypes recommend_phenotype)
helper_method :sort_column, :sort_direction
Expand Down
1 change: 1 addition & 0 deletions app/controllers/picture_phenotype_comments_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class PicturePhenotypeCommentsController < ApplicationController
before_filter :require_user

Expand Down
1 change: 1 addition & 0 deletions app/controllers/picture_phenotypes_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class PicturePhenotypesController < ApplicationController
before_filter :require_user, only: [ :new, :create, ]
helper_method :sort_column, :sort_direction
Expand Down
1 change: 1 addition & 0 deletions app/controllers/search_results_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class SearchResultsController < ApplicationController

def search
Expand Down
1 change: 1 addition & 0 deletions app/controllers/snp_comments_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class SnpCommentsController < ApplicationController
before_filter :require_user

Expand Down
1 change: 1 addition & 0 deletions app/controllers/snps_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class SnpsController < ApplicationController
helper_method :sort_column, :sort_direction
before_filter :find_snp, except: [:index, :json,:json_annotation]
Expand Down
1 change: 1 addition & 0 deletions app/controllers/static_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class StaticController < ApplicationController
def index
@title = "Welcome"
Expand Down
1 change: 1 addition & 0 deletions app/controllers/user_phenotypes_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class UserPhenotypesController < ApplicationController
before_filter :require_user

Expand Down
1 change: 1 addition & 0 deletions app/controllers/user_picture_phenotypes_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class UserPicturePhenotypesController < ApplicationController
before_filter :require_user

Expand Down
1 change: 1 addition & 0 deletions app/controllers/user_sessions_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class UserSessionsController < ApplicationController
before_filter :require_no_user, :only => [:new, :create]
before_filter :require_user, :only => :destroy
Expand Down
1 change: 1 addition & 0 deletions app/controllers/user_snps_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class UserSnpsController < ApplicationController
def show
@user_snps = UserSnp.where(user_id: current_user.id).paginate(page: params[:page])
Expand Down
1 change: 1 addition & 0 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class UsersController < ApplicationController

helper_method :sort_column, :sort_direction
Expand Down
1 change: 1 addition & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module ApplicationHelper
def sortable(column, title = nil)
title ||= column.titleize
Expand Down
1 change: 1 addition & 0 deletions app/helpers/snpedia_papers_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module SnpediaPapersHelper
def bold_if_matching_variation(snpedia_paper, user_snp, &block)
if snpedia_paper && user_snp &&
Expand Down
1 change: 1 addition & 0 deletions app/mailers/user_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class UserMailer < ActionMailer::Base
default :from => "donotreply@opensnp.org"

Expand Down
1 change: 1 addition & 0 deletions app/models/achievement.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class Achievement < ActiveRecord::Base
include PgSearchCommon
has_many :user_achievements
Expand Down
1 change: 1 addition & 0 deletions app/models/concerns/pg_search_common.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module PgSearchCommon
extend ActiveSupport::Concern
include PgSearch
Expand Down
1 change: 1 addition & 0 deletions app/models/fitbit_activity.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class FitbitActivity < ActiveRecord::Base
belongs_to :fitbit_profile

Expand Down
1 change: 1 addition & 0 deletions app/models/fitbit_body.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class FitbitBody < ActiveRecord::Base
belongs_to :fitbit_profile

Expand Down
1 change: 1 addition & 0 deletions app/models/fitbit_profile.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class FitbitProfile < ActiveRecord::Base
belongs_to :user
has_many :fitbit_bodies, dependent: :destroy
Expand Down
1 change: 1 addition & 0 deletions app/models/fitbit_sleep.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class FitbitSleep < ActiveRecord::Base
belongs_to :fitbit_profile

Expand Down
1 change: 1 addition & 0 deletions app/models/genome_gov_paper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class GenomeGovPaper < ActiveRecord::Base
include PgSearchCommon

Expand Down
1 change: 1 addition & 0 deletions app/models/genotype.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'fileutils'

class Genotype < ActiveRecord::Base
Expand Down
1 change: 1 addition & 0 deletions app/models/homepage.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class Homepage < ActiveRecord::Base
belongs_to :user
after_save :destroy_if_blank
Expand Down
1 change: 1 addition & 0 deletions app/models/mendeley_paper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class MendeleyPaper < ActiveRecord::Base
include PgSearchCommon

Expand Down
1 change: 1 addition & 0 deletions app/models/message.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class Message < ActiveRecord::Base
# from http://stackoverflow.com/questions/5141564/model-users-message-in-rails-3
belongs_to :user
Expand Down
1 change: 1 addition & 0 deletions app/models/pgp_annotation.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class PgpAnnotation < ActiveRecord::Base
include PgSearchCommon

Expand Down
1 change: 1 addition & 0 deletions app/models/phenotype.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class Phenotype < ActiveRecord::Base
include PgSearchCommon

Expand Down
1 change: 1 addition & 0 deletions app/models/phenotype_comment.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class PhenotypeComment < ActiveRecord::Base
include PgSearchCommon

Expand Down
1 change: 1 addition & 0 deletions app/models/phenotype_set.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class PhenotypeSet < ActiveRecord::Base
include PgSearchCommon

Expand Down
1 change: 1 addition & 0 deletions app/models/picture_phenotype.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class PicturePhenotype < ActiveRecord::Base
include PgSearchCommon

Expand Down
1 change: 1 addition & 0 deletions app/models/picture_phenotype_comment.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class PicturePhenotypeComment < ActiveRecord::Base
include PgSearchCommon

Expand Down
1 change: 1 addition & 0 deletions app/models/plos_paper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class PlosPaper < ActiveRecord::Base
include PgSearchCommon

Expand Down
1 change: 1 addition & 0 deletions app/models/search_result.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# frozen_string_literal: true
class SearchResult < ActiveRecord::Base
end
1 change: 1 addition & 0 deletions app/models/snp.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class Snp < ActiveRecord::Base
include PgSearchCommon

Expand Down
1 change: 1 addition & 0 deletions app/models/snp_comment.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class SnpComment < ActiveRecord::Base
include PgSearchCommon

Expand Down
1 change: 1 addition & 0 deletions app/models/snp_reference.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class SnpReference < ActiveRecord::Base
self.primary_keys = :snp_id, :paper_id, :paper_type
belongs_to :snp
Expand Down
1 change: 1 addition & 0 deletions app/models/snpedia_paper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class SnpediaPaper < ActiveRecord::Base
include PgSearchCommon

Expand Down
1 change: 1 addition & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class User < ActiveRecord::Base
include PgSearchCommon

Expand Down
1 change: 1 addition & 0 deletions app/models/user_achievement.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class UserAchievement < ActiveRecord::Base
belongs_to :achievement
belongs_to :user
Expand Down
1 change: 1 addition & 0 deletions app/models/user_phenotype.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class UserPhenotype < ActiveRecord::Base
include PgSearchCommon

Expand Down
1 change: 1 addition & 0 deletions app/models/user_picture_phenotype.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class UserPicturePhenotype < ActiveRecord::Base
include PgSearchCommon

Expand Down
1 change: 1 addition & 0 deletions app/models/user_session.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class UserSession < Authlogic::Session::Base

# rails 3 broke something, this is for fix
Expand Down
1 change: 1 addition & 0 deletions app/models/user_snp.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class UserSnp < ActiveRecord::Base
self.primary_keys = [:genotype_id, :snp_name]
belongs_to :snp, foreign_key: :snp_name, primary_key: :name, counter_cache: true
Expand Down
1 change: 1 addition & 0 deletions app/recommenders/concerns/recommender_delete_items.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module RecommenderDeleteItems
def delete_items
all_items.each do |i|
Expand Down
1 change: 1 addition & 0 deletions app/recommenders/phenotype_recommender.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class PhenotypeRecommender < Recommendify::Base
include RecommenderDeleteItems

Expand Down
1 change: 1 addition & 0 deletions app/recommenders/variation_recommender.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class VariationRecommender < Recommendify::Base
include RecommenderDeleteItems

Expand Down
1 change: 1 addition & 0 deletions app/workers/delete_genotype.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class DeleteGenotype
include Sidekiq::Worker
sidekiq_options queue: :user_snps, retry: 5, unique: true
Expand Down
1 change: 1 addition & 0 deletions app/workers/fitbit_dump.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@


# frozen_string_literal: true
class FitbitDump
include Sidekiq::Worker
sidekiq_options :queue => :fitbit, :retry => 5, :unique => true
Expand Down
1 change: 1 addition & 0 deletions app/workers/fitbit_edit.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@


# frozen_string_literal: true
class FitbitEdit
include Sidekiq::Worker
sidekiq_options :queue => :fitbit, :retry => 5, :unique => true
Expand Down
1 change: 1 addition & 0 deletions app/workers/fitbit_endsubscription.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@


# frozen_string_literal: true
class FitbitEndSubscription
include Sidekiq::Worker
sidekiq_options :queue => :fitbit, :retry => 5, :unique => true
Expand Down
1 change: 1 addition & 0 deletions app/workers/fitbit_init.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@


# frozen_string_literal: true
class FitbitInit
include Sidekiq::Worker
sidekiq_options :queue => :fitbit, :retry => 5, :unique => true
Expand Down
1 change: 1 addition & 0 deletions app/workers/fitbit_notification.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@


# frozen_string_literal: true
class FitbitNotification
include Sidekiq::Worker
sidekiq_options :queue => :fitbit, :retry => 5, :unique => true
Expand Down
1 change: 1 addition & 0 deletions app/workers/fixphenotypes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class Fixphenotypes
include Sidekiq::Worker
sidekiq_options :queue => :fixphenotypes, :retry => 5, :unique => true
Expand Down
1 change: 1 addition & 0 deletions app/workers/frequency.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class Frequency
include Sidekiq::Worker
sidekiq_options queue: :frequency, retry: 5, unique: true
Expand Down
1 change: 1 addition & 0 deletions app/workers/genome_gov.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'set'
require 'open-uri'

Expand Down
1 change: 1 addition & 0 deletions app/workers/mailnewphenotype.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class Mailnewphenotype
include Sidekiq::Worker
sidekiq_options queue: :mailnewgenotype, unique: true, retry: false # avoid spam on breakage
Expand Down
1 change: 1 addition & 0 deletions app/workers/mendeley_details.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require "rubygems"
require "net/http"
require "json"
Expand Down

0 comments on commit f88be45

Please sign in to comment.