Permalink
Browse files

Double quotes everywhere.

Using rubocop's auto-correct.
  • Loading branch information...
1 parent 782b012 commit d61e30ff7efbd006071682e1fcd49047efd58a06 @nanaya nanaya committed Aug 23, 2014
Showing with 721 additions and 721 deletions.
  1. +2 −2 Rakefile
  2. +5 −5 app/controllers/advertisements_controller.rb
  3. +10 −10 app/controllers/application_controller.rb
  4. +1 −1 app/controllers/artist_controller.rb
  5. +1 −1 app/controllers/banned_controller.rb
  6. +2 −2 app/controllers/batch_controller.rb
  7. +2 −2 app/controllers/comment_controller.rb
  8. +1 −1 app/controllers/dmail_controller.rb
  9. +4 −4 app/controllers/history_controller.rb
  10. +1 −1 app/controllers/note_controller.rb
  11. +2 −2 app/controllers/pool_controller.rb
  12. +11 −11 app/controllers/post_controller.rb
  13. +2 −2 app/controllers/report_controller.rb
  14. +1 −1 app/controllers/settings/base_controller.rb
  15. +3 −3 app/controllers/tag_controller.rb
  16. +3 −3 app/controllers/tag_implication_controller.rb
  17. +13 −13 app/controllers/user_controller.rb
  18. +4 −4 app/controllers/wiki_controller.rb
  19. +6 −6 app/helpers/application_helper.rb
  20. +1 −1 app/helpers/cache_helper.rb
  21. +6 −6 app/helpers/favorite_helper.rb
  22. +4 −4 app/helpers/history_helper.rb
  23. +1 −1 app/helpers/post_helper.rb
  24. +15 −15 app/helpers/tag_helper.rb
  25. +2 −2 app/helpers/tag_subscription_helper.rb
  26. +5 −5 app/helpers/wiki_helper.rb
  27. +1 −1 app/mailers/d_mailer.rb
  28. +2 −2 app/mailers/user_mailer.rb
  29. +4 −4 app/models/advertisement.rb
  30. +2 −2 app/models/artist.rb
  31. +2 −2 app/models/artist_url.rb
  32. +2 −2 app/models/batch_upload.rb
  33. +4 −4 app/models/comment.rb
  34. +3 −3 app/models/forum_post.rb
  35. +1 −1 app/models/history_change.rb
  36. +2 −2 app/models/inline_image.rb
  37. +3 −3 app/models/note.rb
  38. +7 −7 app/models/pool.rb
  39. +1 −1 app/models/pool_post.rb
  40. +6 −6 app/models/post.rb
  41. +1 −1 app/models/post/count_methods.rb
  42. +7 −7 app/models/post/file_methods.rb
  43. +1 −1 app/models/post/image_store/local_flat.rb
  44. +1 −1 app/models/post/image_store/local_flat_with_amazon_s3_backup.rb
  45. +1 −1 app/models/post/image_store/local_hierarchy.rb
  46. +1 −1 app/models/post/rating_methods.rb
  47. +6 −6 app/models/post/sql_methods.rb
  48. +1 −1 app/models/post/status_methods.rb
  49. +1 −1 app/models/post_frames.rb
  50. +3 −3 app/models/tag.rb
  51. +3 −3 app/models/tag/related_tag_methods.rb
  52. +1 −1 app/models/tag/type_methods.rb
  53. +2 −2 app/models/tag_subscription.rb
  54. +9 −9 app/models/user.rb
  55. +2 −2 app/models/wiki_page.rb
  56. +2 −2 bin/bundle
  57. +3 −3 bin/rails
  58. +2 −2 bin/rake
  59. +11 −11 config/application.rb
  60. +3 −3 config/boot.rb
  61. +8 −8 config/default_config.rb
  62. +1 −1 config/environment.rb
  63. +6 −6 config/environments/production.rb
  64. +3 −3 config/init_config.rb
  65. +25 −25 config/initializers/000_load_config.rb
  66. +1 −1 config/initializers/activesupport_xmlmini_backend.rb
  67. +2 −2 config/initializers/legacy.rb
  68. +1 −1 config/initializers/mime_types.rb
  69. +1 −1 config/initializers/newrelic_gc.rb
  70. +1 −1 config/initializers/secret_token.rb
  71. +1 −1 config/initializers/session_store.rb
  72. +197 −197 config/routes.rb
  73. +2 −2 db/migrate/058_remove_notes_from_artists.rb
  74. +1 −1 db/migrate/065_remove_yaml.rb
  75. +1 −1 db/migrate/071_create_flagged_post_details.rb
  76. +1 −1 db/migrate/077_create_server_keys.rb
  77. +1 −1 db/migrate/082_add_post_votes.rb
  78. +1 −1 db/migrate/20080901000000_no_really_add_post_votes.rb
  79. +1 −1 db/migrate/20081015004938_convert_favorites_to_votes.rb
  80. +1 −1 db/migrate/20081209221550_add_slave_pool_posts.rb
  81. +1 −1 db/migrate/20140427041839_remove_non_votes.rb
  82. +3 −3 lib/core_ext/ext-string.rb
  83. +7 −7 lib/core_ext/patch-login_check_on_links_and_buttons.rb
  84. +2 −2 lib/core_ext/patch-remove_commit_search_from_form.rb
  85. +2 −2 lib/core_ext/patch-remove_utf8_enforcer_tag_in_form.rb
  86. +2 −2 lib/core_ext/patch-useful_json_escape.rb
  87. +11 −11 lib/diff.rb
  88. +4 −4 lib/download.rb
  89. +10 −10 lib/dtext.rb
  90. +2 −2 lib/extract_urls.rb
  91. +40 −40 lib/legacy/prototype_helper.rb
  92. +6 −6 lib/legacy/prototype_legacy_helper.rb
  93. +1 −1 lib/mirror.rb
  94. +2 −2 lib/moebooru/cache_helper.rb
  95. +6 −6 lib/moebooru/resizer.rb
  96. +1 −1 lib/moebooru/tempfile_prefix.rb
  97. +2 −2 lib/multipart.rb
  98. +9 −9 lib/similar_images.rb
  99. +2 −2 lib/tasks/create_user_blacklisted_tags.rake
  100. +1 −1 lib/tasks/db.rake
  101. +5 −5 lib/tasks/i18n.rake
  102. +9 −9 lib/tasks/job.rake
  103. +3 −3 lib/tasks/maint.rake
  104. +2 −2 lib/tasks/make_sample_images.rake
  105. +7 −7 lib/tasks/posts.rake
  106. +7 −7 lib/translate.rb
  107. +3 −3 lib/versioning.rb
  108. +2 −2 script/daemons/job_task_processor.rb
  109. +4 −4 script/daemons/job_task_processor_ctl.rb
  110. +2 −2 script/donmai/backup_db_to_s3
  111. +2 −2 script/donmai/backup_svn_to_s3
  112. +1 −1 script/donmai/fix_artist_urls
  113. +1 −1 script/donmai/prune_old_job_tasks
  114. +1 −1 script/donmai/prune_unactivated_users
  115. +1 −1 script/donmai/prune_unapproved_posts
  116. +1 −1 script/donmai/send_moderator_report
  117. +1 −1 test/functional/admin_controller_test.rb
  118. +1 −1 test/functional/artist_controller_test.rb
  119. +1 −1 test/functional/comment_controller_test.rb
  120. +1 −1 test/functional/dmail_controller_test.rb
  121. +1 −1 test/functional/favorite_controller_test.rb
  122. +1 −1 test/functional/forum_controller_test.rb
  123. +1 −1 test/functional/job_task_controller_test.rb
  124. +2 −2 test/functional/note_controller_test.rb
  125. +2 −2 test/functional/pool_controller_test.rb
  126. +3 −3 test/functional/post_controller_test.rb
  127. +3 −3 test/functional/post_tag_history_controller_test.rb
  128. +3 −3 test/functional/report_controller_test.rb
  129. +1 −1 test/functional/tag_alias_controller_test.rb
  130. +2 −2 test/functional/tag_controller_test.rb
  131. +1 −1 test/functional/tag_implication_controller_test.rb
  132. +1 −1 test/functional/user_controller_test.rb
  133. +1 −1 test/functional/user_record_controller_test.rb
  134. +1 −1 test/functional/wiki_controller_test.rb
  135. +3 −3 test/performance/browsing_test.rb
  136. +2 −2 test/test_helper.rb
  137. +1 −1 test/unit/advertisement_test.rb
  138. +2 −2 test/unit/application_test.rb
  139. +1 −1 test/unit/artist_test.rb
  140. +1 −1 test/unit/artist_url_test.rb
  141. +1 −1 test/unit/ban_test.rb
  142. +1 −1 test/unit/comment_test.rb
  143. +2 −2 test/unit/dmail_test.rb
  144. +2 −2 test/unit/dtext/dtext_test.rb
  145. +3 −3 test/unit/dtext/helper.rb
  146. +15 −15 test/unit/dtext_test.rb
  147. +1 −1 test/unit/favorite_test.rb
  148. +1 −1 test/unit/flagged_post_detail_test.rb
  149. +1 −1 test/unit/forum_post_test.rb
  150. +1 −1 test/unit/job_task_test.rb
  151. +1 −1 test/unit/note_test.rb
  152. +1 −1 test/unit/pool_test.rb
  153. +3 −3 test/unit/post_tag_history_test.rb
  154. +3 −3 test/unit/post_test.rb
  155. +3 −3 test/unit/tag_alias_test.rb
  156. +2 −2 test/unit/tag_implication_test.rb
  157. +2 −2 test/unit/tag_subscription_test.rb
  158. +4 −4 test/unit/tag_test.rb
  159. +3 −3 test/unit/user_mailer_test.rb
  160. +1 −1 test/unit/user_record_test.rb
  161. +2 −2 test/unit/user_test.rb
  162. +1 −1 test/unit/wiki_page_test.rb
View
@@ -1,7 +1,7 @@
# 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.
-require File.expand_path('../config/application', __FILE__)
-require 'rake'
+require File.expand_path("../config/application", __FILE__)
+require "rake"
Moebooru::Application.load_tasks
@@ -1,5 +1,5 @@
class AdvertisementsController < ApplicationController
- layout 'default'
+ layout "default"
before_filter :admin_only, :except => :redirect
def index
@@ -17,7 +17,7 @@ def new
def create
@ad = Advertisement.new(params[:advertisement])
if @ad.save
- flash[:success] = 'Advertisement added'
+ flash[:success] = "Advertisement added"
redirect_to @ad
else
render :new
@@ -31,7 +31,7 @@ def edit
def update
@ad = Advertisement.find(params[:id])
if @ad.update_attributes(params[:advertisement])
- flash[:success] = 'Advertisement updated'
+ flash[:success] = "Advertisement updated"
redirect_to @ad
else
render :edit
@@ -42,15 +42,15 @@ def update_multiple
if params[:advertisement_ids]
ids = params[:advertisement_ids].map{ |a| a.to_i }
else
- flash[:notice] = 'No advertisement selected'
+ flash[:notice] = "No advertisement selected"
redirect_to advertisements_path and return
end
if params[:do_delete]
Advertisement.destroy_all :id => ids
elsif params[:do_reset_hit_count]
Advertisement.reset_hit_count ids
end
- flash[:success] = 'Advertisements updated'
+ flash[:success] = "Advertisements updated"
redirect_to advertisements_path
end
@@ -1,5 +1,5 @@
# encoding: utf-8
-require 'digest/md5'
+require "digest/md5"
class ApplicationController < ActionController::Base
rescue_from ActiveRecord::StatementInvalid, :with => :rescue_pg_invalid_query
@@ -141,9 +141,9 @@ def set_current_user
def set_country
@current_user_country = Rails.cache.fetch({ :type => :geoip, :ip => request.remote_ip }, :expires_in => 1.month) do
begin
- GeoIP.new(Rails.root.join('db', 'GeoIP.dat').to_s).country(request.remote_ip).country_code2
+ GeoIP.new(Rails.root.join("db", "GeoIP.dat").to_s).country(request.remote_ip).country_code2
rescue
- '--'
+ "--"
end
end
end
@@ -306,7 +306,7 @@ def cache_action
yield
- if key && response.headers['Status'] =~ /^200/
+ if key && response.headers["Status"] =~ /^200/
Rails.cache.write(key, response.body, :expires_in => expiry)
end
else
@@ -351,7 +351,7 @@ def init_cookies
if @current_user.is_blocked?
if @current_user.ban
- cookies["block_reason"] = "You have been blocked. Reason: #{@current_user.ban.reason}. Expires: #{@current_user.ban.expires_at.strftime('%Y-%m-%d')}"
+ cookies["block_reason"] = "You have been blocked. Reason: #{@current_user.ban.reason}. Expires: #{@current_user.ban.expires_at.strftime("%Y-%m-%d")}"
else
cookies["block_reason"] = "You have been blocked."
end
@@ -414,13 +414,13 @@ def set_query_date
end
def set_locale
- if params[:locale] and CONFIG['available_locales'].include?(params[:locale])
- cookies['locale'] = { :value => params[:locale], :expires => 1.year.from_now }
+ if params[:locale] and CONFIG["available_locales"].include?(params[:locale])
+ cookies["locale"] = { :value => params[:locale], :expires => 1.year.from_now }
I18n.locale = params[:locale].to_sym
- elsif cookies['locale'] and CONFIG['available_locales'].include?(cookies['locale'])
- I18n.locale = cookies['locale'].to_sym
+ elsif cookies["locale"] and CONFIG["available_locales"].include?(cookies["locale"])
+ I18n.locale = cookies["locale"].to_sym
else
- I18n.locale = CONFIG['default_locale']
+ I18n.locale = CONFIG["default_locale"]
end
end
@@ -59,7 +59,7 @@ def create
if params[:name]
@artist.name = params[:name]
- post = Post.has_any_tags(params[:name].to_s).where('source LIKE ?', 'http*'.to_escaped_for_sql_like).available.first
+ post = Post.has_any_tags(params[:name].to_s).where("source LIKE ?", "http*".to_escaped_for_sql_like).available.first
unless post == nil || post.source.blank?
@artist.urls = post.source
end
@@ -1,5 +1,5 @@
class BannedController < ApplicationController
- layout 'bare'
+ layout "bare"
def index
@ban = get_ip_ban()
if not @ban
@@ -1,7 +1,7 @@
-require 'extract_urls'
+require "extract_urls"
class BatchController < ApplicationController
- layout 'default'
+ layout "default"
before_filter :contributor_only, :only => [:index, :create, :enqueue, :update]
def index
@@ -102,8 +102,8 @@ def search
}
if keywords.any?
- conds << 'text_search_index @@ to_tsquery(?)'
- cond_params << keywords.map { |k| k.to_escaped_for_tsquery }.join(' & ')
+ conds << "text_search_index @@ to_tsquery(?)"
+ cond_params << keywords.map { |k| k.to_escaped_for_tsquery }.join(" & ")
end
options[:conditions] = [conds.join(" AND "), *cond_params]
@@ -16,7 +16,7 @@ def compose
end
def create
- if Dmail.where(:from_id => @current_user.id).where('created_at > ?', 1.hour.ago).count > 10
+ if Dmail.where(:from_id => @current_user.id).where("created_at > ?", 1.hour.ago).count > 10
flash[:notice] = "You can't send more than 10 dmails per hour."
redirect_to :action => :inbox
return
@@ -1,15 +1,15 @@
-require 'versioning'
+require "versioning"
class HistoryController < ApplicationController
- layout 'default'
+ layout "default"
# before_filter :member_only
def index
search = params[:search] || ""
q = Hash.new {|h, k| h[k] = []}
- search.split(' ').each { |s|
+ search.split(" ").each { |s|
if s =~ /^(.+?):(.*)/
search_type = $1
param = $2
@@ -100,7 +100,7 @@ def index
end
if q[:keywords].any? then
- value_index_query = '(' + Array(q[:keywords]).map { |k| k.to_escaped_for_tsquery }.join(' & ') + ')'
+ value_index_query = "(" + Array(q[:keywords]).map { |k| k.to_escaped_for_tsquery }.join(" & ") + ")"
hc_conds << "hc.value_index @@ to_tsquery('danbooru', ?)"
hc_cond_params << value_index_query
end
@@ -1,5 +1,5 @@
class NoteController < ApplicationController
- layout 'default', :only => [:index, :history, :search]
+ layout "default", :only => [:index, :history, :search]
before_filter :post_member_only, :only => [:destroy, :update, :revert]
helper :post
@@ -43,7 +43,7 @@ def index
end
if not search_tokens.empty? then
- value_index_query = '(' + Array(search_tokens).map { |t| t.to_escaped_for_tsquery }.join(' & ') + ')'
+ value_index_query = "(" + Array(search_tokens).map { |t| t.to_escaped_for_tsquery }.join(" & ") + ")"
conds << "search_index @@ to_tsquery('pg_catalog.english', ?)"
cond_params << value_index_query
@@ -105,7 +105,7 @@ def show
begin
@pool = Pool.find(params[:id].to_i, :include => [:pool_posts => :post])
rescue
- flash[:notice] = t('c.pool.not_found', :id => params[:id].to_i)
+ flash[:notice] = t("c.pool.not_found", :id => params[:id].to_i)
redirect_to :action => :index
return
end
@@ -4,7 +4,7 @@ class PostController < ApplicationController
#ignore upload/similar/create since they're user controlled and not worth measuring in newrelic
newrelic_ignore :only => [:upload, :similar, :create]
- layout 'default'
+ layout "default"
helper :avatar
before_filter :member_only, :only => [:create, :destroy, :delete, :flag, :revert_tags, :activate, :update_batch, :vote]
@@ -47,13 +47,13 @@ def create
status = "pending"
end
- if params[:anonymous] == '1' and @current_user.is_contributor_or_higher?
+ if params[:anonymous] == "1" and @current_user.is_contributor_or_higher?
user_id = nil
# FIXME: someone track down the user of Thread evilry here and nuke
# it please?
- Thread.current['danbooru-user'] = nil
- Thread.current['danbooru-user_id'] = nil
- Thread.current['danbooru-ip_addr'] = request.remote_ip
+ Thread.current["danbooru-user"] = nil
+ Thread.current["danbooru-user_id"] = nil
+ Thread.current["danbooru-ip_addr"] = request.remote_ip
else
user_id = @current_user.id
end
@@ -146,7 +146,7 @@ def moderate
def update
@post = Post.find(params[:id])
if @post.is_deleted? and not @current_user.is_mod_or_higher?
- respond_to_error('Post Locked', { :action => :show, :id => params[:id] }, { :status => 422 })
+ respond_to_error("Post Locked", { :action => :show, :id => params[:id] }, { :status => 422 })
return
end
user_id = @current_user.id
@@ -169,7 +169,7 @@ def update_batch
user_id = @current_user.id
ids = {}
- (params['post'] || []).each do |post|
+ (params["post"] || []).each do |post|
if post.is_a?(Array) then
# We prefer { :id => 1, :rating => 's' }, but accept ["123", {:rating => 's'}], since that's
# what we'll get from HTML forms.
@@ -271,7 +271,7 @@ def acknowledge_new_deleted_posts
end
def index
- params[:tags] = Tag.scan_query(params[:tags]).join(' ')
+ params[:tags] = Tag.scan_query(params[:tags]).join(" ")
tags = params[:tags]
split_tags = QueryParser.parse(tags)
page = page_number
@@ -392,7 +392,7 @@ def index
def atom
@posts = Post.find_by_sql(Post.generate_sql(params[:tags], :limit => 20, :order => "p.id DESC"))
respond_to do |format|
- format.atom { render 'index' }
+ format.atom { render "index" }
end
end
@@ -698,7 +698,7 @@ def search(params)
end
if params[:search_id] then
- options[:source] = File.open(file_path, 'rb')
+ options[:source] = File.open(file_path, "rb")
options[:source_filename] = params[:search_id]
options[:source_thumb] = "/data/search/#{params[:search_id]}"
options[:type] = :file
@@ -841,7 +841,7 @@ def exception
end
def download
- require 'base64'
+ require "base64"
data = params[:data]
filename = params[:filename]
@@ -1,12 +1,12 @@
class ReportController < ApplicationController
- layout 'default'
+ layout "default"
before_filter :set_dates
helper :user
def tag_updates
@users = Report.tag_updates(@start_date, @end_date, @limit, @level)
@report_title = "Tag Updates"
- @change_params = lambda {|user_id| { :controller => 'history', :action => 'index', :search => "type:post user:#{User.find(user_id).name}" } }
+ @change_params = lambda {|user_id| { :controller => "history", :action => "index", :search => "type:post user:#{User.find(user_id).name}" } }
render :action => "common"
end
@@ -1,7 +1,7 @@
class Settings::BaseController < ApplicationController
before_action :no_anonymous
before_action :set_user
- layout 'settings'
+ layout "settings"
private
def set_user
@@ -1,5 +1,5 @@
class TagController < ApplicationController
- layout 'default'
+ layout "default"
before_filter :mod_only, :only => [:mass_edit, :edit_preview]
before_filter :member_only, :only => [:update, :edit]
before_action :set_query_date, :only => [:popular_by_day, :popular_by_week, :popular_by_month]
@@ -11,7 +11,7 @@ def cloud
# Generates list of tag names matching parameter term.
# Used by jquery-ui/autocomplete.
def autocomplete_name
- @tags = Tag.where(['name ILIKE ?', "*#{params[:term]}*".to_escaped_for_sql_like]).pluck(:name)
+ @tags = Tag.where(["name ILIKE ?", "*#{params[:term]}*".to_escaped_for_sql_like]).pluck(:name)
respond_to do |format|
format.json { render :json => @tags }
end
@@ -187,7 +187,7 @@ def show
begin
name = Tag.find(params[:id], :select => :name).name
rescue
- raise ActionController::RoutingError.new('Not Found')
+ raise ActionController::RoutingError.new("Not Found")
end
redirect_to :controller => :wiki, :action => :show, :title => name
end
@@ -54,12 +54,12 @@ def index
end
# FIXME: subquery in order
- @implications = TagImplication.order('is_pending DESC, (SELECT name FROM tags WHERE id = tag_implications.predicate_id), (SELECT name FROM tags WHERE id = tag_implications.consequent_id)')
+ @implications = TagImplication.order("is_pending DESC, (SELECT name FROM tags WHERE id = tag_implications.predicate_id), (SELECT name FROM tags WHERE id = tag_implications.consequent_id)")
if params[:query]
- tag_ids = Tag.where('name ILIKE ?', "*#{params[:query]}*".to_escaped_for_sql_like).select(:id)
+ tag_ids = Tag.where("name ILIKE ?", "*#{params[:query]}*".to_escaped_for_sql_like).select(:id)
@implications = @implications
- .where('predicate_id IN (?) OR consequent_id IN (?)', tag_ids, tag_ids)
+ .where("predicate_id IN (?) OR consequent_id IN (?)", tag_ids, tag_ids)
.order(:is_pending => :desc, :consequent_id => :asc)
end
Oops, something went wrong.

0 comments on commit d61e30f

Please sign in to comment.