5
3
mirror of https://github.com/tildeverse/lobsters synced 2024-06-24 09:17:05 +00:00

rubocop: Layout/EmptyLines*, 4797

This commit is contained in:
Peter Bhat Harkins 2018-03-01 22:50:11 -06:00
parent 988aa22dac
commit 5476a77aef
12 changed files with 13 additions and 11 deletions

View File

@ -6,6 +6,7 @@ AllCops:
- '**/Rakefile'
- '**/config.ru'
Exclude:
- 'bin/**/*'
- 'db/**/*'
# Cop configuration:
@ -17,6 +18,8 @@ AllCops:
# Layout
Layout/AccessModifierIndentation:
EnforcedStyle: outdent
Layout/EmptyLinesAroundExceptionHandlingKeywords:
Enabled: false
# Lint

View File

@ -253,6 +253,7 @@ class HomeController < ApplicationController
end
private
def filtered_tag_ids
if @user
@user.tag_filters.map{|tf| tf.tag_id }

View File

@ -172,6 +172,7 @@ class LoginController < ApplicationController
end
private
def find_twofa_user
if session[:twofa_u].present?
return User.where(:session_token => session[:twofa_u]).first

View File

@ -144,6 +144,7 @@ class MessagesController < ApplicationController
end
private
def message_params
params.require(:message).permit(
:recipient_username, :subject, :body,

View File

@ -58,6 +58,7 @@ class SignupController < ApplicationController
end
private
def user_params
params.require(:user).permit(
:username, :email, :password, :password_confirmation, :about,

View File

@ -19,6 +19,7 @@ class ShortId
end
private
class CandidateId
attr_accessor :klass, :id

View File

@ -18,6 +18,7 @@ class StoriesPaginator
end
private
def with_pagination_info(scope)
scope = scope.to_a
show_more = scope.count > per_page

View File

@ -443,6 +443,7 @@ class Story < ActiveRecord::Base
def is_unavailable
self.unavailable_at != nil
end
def is_unavailable=(what)
self.unavailable_at = (what.to_i == 1 && !self.is_unavailable ?
Time.now : nil)

View File

@ -100,6 +100,7 @@ class StoryRepository
end
private
def base_scope
Story.unmerged.where(is_expired: false)
end

View File

@ -21,6 +21,7 @@ module Net
end
private
def conn_address
if self.custom_conn_address.to_s != ""
self.custom_conn_address
@ -250,6 +251,7 @@ class Sponge
end
private
def dputs(string)
if self.debug
puts string

View File

@ -6,22 +6,17 @@ describe ApplicationHelper do
expect(helper.page_numbers_for_pagination(10, 1)).
to eq([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ])
expect(helper.page_numbers_for_pagination(20, 1)).
to eq([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, "...", 20 ])
expect(helper.page_numbers_for_pagination(25, 1)).
to eq([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, "...", 25 ])
expect(helper.page_numbers_for_pagination(25, 10)).
to eq([ 1, "...", 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, "...", 25 ])
expect(helper.page_numbers_for_pagination(25, 20)).
to eq([ 1, "...", 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 ])
end
end
end

View File

@ -4,7 +4,6 @@ describe Markdowner do
it "parses simple markdown" do
expect(Markdowner.to_html("hello there *italics* and **bold**!")).
to eq("<p>hello there <em>italics</em> and <strong>bold</strong>!</p>\n")
end
it "turns @username into a link if @username exists" do
@ -13,7 +12,6 @@ describe Markdowner do
expect(Markdowner.to_html("hi @blahblah test")).
to eq("<p>hi <a href=\"/u/blahblah\">@blahblah</a> test</p>\n")
expect(Markdowner.to_html("hi @flimflam test")).
to eq("<p>hi @flimflam test</p>\n")
end
@ -36,7 +34,6 @@ describe Markdowner do
expect(Markdowner.to_html("hi [test](http://example.com/@blahblah/)")).
to eq("<p>hi <a href=\"http://example.com/@blahblah/\" rel=\"nofollow\">" +
"test</a></p>\n")
end
it "correctly adds nofollow" do
@ -44,14 +41,11 @@ describe Markdowner do
to eq("<p><a href=\"http://example.com\" rel=\"nofollow\">" +
"ex</a></p>\n")
expect(Markdowner.to_html("[ex](//example.com)")).
to eq("<p><a href=\"//example.com\" rel=\"nofollow\">" +
"ex</a></p>\n")
expect(Markdowner.to_html("[ex](/u/abc)")).
to eq("<p><a href=\"/u/abc\">ex</a></p>\n")
end
end