Skip to content

Commit

Permalink
Style fixes coyote-team#109
Browse files Browse the repository at this point in the history
  • Loading branch information
subelsky committed Jul 26, 2017
1 parent 891e447 commit f7c3786
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 74 deletions.
9 changes: 9 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
inherit_from: .rubocop_todo.yml

AllCops:
Exclude:
- 'db/**/*'
- 'config/**/*'

Bundler/OrderedGems:
Enabled: false

Layout/AlignParameters:
Exclude:
- 'bin/*' # most/all of these are autogenerated binstubs

Layout/SpaceAfterComma:
Enabled: false

Expand All @@ -17,3 +23,6 @@ Layout/EmptyLineAfterMagicComment:
Metrics/MethodLength:
Exclude:
- 'lib/coyote/strategies/mca.rb'

Layout/DotPosition:
Enabled: false
20 changes: 0 additions & 20 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,6 @@
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 24
# Cop supports --auto-correct.
Layout/CommentIndentation:
Exclude:
- 'app/controllers/meta_controller.rb'
- 'app/controllers/statuses_controller.rb'
- 'app/models/user.rb'
- 'config/environments/development.rb'
- 'config/environments/production.rb'
- 'config/environments/staging.rb'

# Offense count: 4
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: leading, trailing
Layout/DotPosition:
Exclude:
- 'app/controllers/images_controller.rb'
- 'spec/features/adding_and_describing_an_image_spec.rb'

# Offense count: 6
# Cop supports --auto-correct.
# Configuration parameters: AllowAdjacentOneLineDefs, NumberOfEmptyLines.
Expand Down
21 changes: 11 additions & 10 deletions app/controllers/meta_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,19 @@ def update

# DELETE /meta/1
#def destroy
#@metum.destroy
#redirect_to meta_url, notice: 'Metum was successfully destroyed.'
#@metum.destroy
#redirect_to meta_url, notice: 'Metum was successfully destroyed.'
#end

private
# Use callbacks to share common setup or constraints between actions.
def set_metum
@metum = Metum.find(params[:id])
end

# Only allow a trusted parameter "white list" through.
def metum_params
params.require(:metum).permit(:title, :instructions)
end
# Use callbacks to share common setup or constraints between actions.
def set_metum
@metum = Metum.find(params[:id])
end

# Only allow a trusted parameter "white list" through.
def metum_params
params.require(:metum).permit(:title, :instructions)
end
end
45 changes: 10 additions & 35 deletions app/controllers/statuses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,40 +24,15 @@ def new
def edit
end

# POST /statuses
#def create
#@status = Status.new(status_params)

#if @status.save
#redirect_to @status, notice: 'Status was successfully created.'
#else
#render :new
#end
#end

# PATCH/PUT /statuses/1
#def update
#if @status.update(status_params)
#redirect_to @status, notice: 'Status was successfully updated.'
#else
#render :edit
#end
#end

# DELETE /statuses/1
#def destroy
#@status.destroy
#redirect_to statuses_url, notice: 'Status was successfully destroyed.'
#end

private
# Use callbacks to share common setup or constraints between actions.
def set_status
@status = Status.find(params[:id])
end

# Only allow a trusted parameter "white list" through.
def status_params
params.require(:status).permit(:title)
end

# Use callbacks to share common setup or constraints between actions.
def set_status
@status = Status.find(params[:id])
end

# Only allow a trusted parameter "white list" through.
def status_params
params.require(:status).permit(:title)
end
end
15 changes: 8 additions & 7 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@ class User < ActiveRecord::Base

# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable, password_length: 8..128
devise :database_authenticatable,
:registerable,
:recoverable,
:rememberable,
:trackable,
:validatable,
:password_length => 8..128

has_many :assignments, dependent: :destroy
has_many :images, through: :assignments
Expand All @@ -49,10 +54,6 @@ def to_s
end
end

#def sorted
#all.sort{|a,b| a.last_name.dropcase <=> a.last_name.dropcase}
#end

def next_image(current_image=nil)
next_image = nil
images.each do |i|
Expand All @@ -73,7 +74,7 @@ def next_image(current_image=nil)
next_image
end

#NOTE for audit log
# @note for audit log
def username
to_s
end
Expand Down
1 change: 0 additions & 1 deletion config/environments/staging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
#expires_in: 90.minutes ,
#namespace: 'cache'
#}


# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = "http://assets.example.com"
Expand Down
7 changes: 6 additions & 1 deletion lib/tasks/coyote.rake
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@ namespace :coyote do
{ title: "events" },
])

long_metum = <<~METUM
A lengthier text than a traditional alt-text that attempts to provide a comprehensive representation of an image.
Long descriptions can range from one sentence to several paragraphs."
METUM

Metum.create!([
{ title: "Short", instructions: "A brief description enabling a user to interact with the image when it is not rendered or when the user has low vision" },
{ title: "Long", instructions: "A lengthier text than a traditional alt-text that attempts to provide a comprehensive representation of an image. Long descriptions can range from one sentence to several paragraphs." }
{ title: "Long", instructions: long_metum }
])

Status.create!([
Expand Down

0 comments on commit f7c3786

Please sign in to comment.