Skip to content

Commit

Permalink
Enable & auto-correct Style/EmptyLines cop
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez committed May 8, 2017
1 parent 3d10e14 commit d0b93ab
Show file tree
Hide file tree
Showing 29 changed files with 3 additions and 39 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Expand Up @@ -17,6 +17,9 @@ AllCops:

StyleGuideCopsOnly: false

Style/EmptyLines:
Enabled: true

Style/ExtraSpacing:
Enabled: true

Expand Down
3 changes: 0 additions & 3 deletions lib/active_admin/authorization_adapter.rb
Expand Up @@ -10,7 +10,6 @@ module Authorization

Auth = Authorization


# Active Admin's default authorization adapter. This adapter returns true
# for all requests to `#authorized?`. It should be the starting point for
# implementing your own authorization adapter.
Expand All @@ -19,7 +18,6 @@ module Authorization
class AuthorizationAdapter
attr_reader :resource, :user


# Initialize a new authorization adapter. This happens on each and
# every request to a controller.
#
Expand Down Expand Up @@ -54,7 +52,6 @@ def authorized?(action, subject = nil)
true
end


# A hook method for authorization libraries to scope the collection. By
# default, we just return the same collection. The returned scope is used
# as the starting point for all queries to the db in the controller.
Expand Down
1 change: 0 additions & 1 deletion lib/active_admin/base_controller.rb
Expand Up @@ -59,7 +59,6 @@ def active_admin_namespace
end
helper_method :active_admin_namespace


ACTIVE_ADMIN_ACTIONS = [:index, :show, :new, :create, :edit, :update, :destroy]

# Determine which layout to use.
Expand Down
1 change: 0 additions & 1 deletion lib/active_admin/base_controller/authorization.rb
Expand Up @@ -38,7 +38,6 @@ def authorized?(action, subject = nil)
active_admin_authorization.authorized?(action, subject)
end


# Authorize the action and subject. Available in the controller
# as well as all the views. If the action is not allowd, it raises
# an ActiveAdmin::AccessDenied exception.
Expand Down
1 change: 0 additions & 1 deletion lib/active_admin/filters/forms.rb
Expand Up @@ -41,7 +41,6 @@ def default_input_type(method, options = {})
end
end


# This module is included into the view
module ViewHelper

Expand Down
1 change: 0 additions & 1 deletion lib/active_admin/helpers/settings.rb
Expand Up @@ -70,7 +70,6 @@ def default_settings

end


# Allows you to define child classes that should receive the same
# settings, as well as the same default values.
#
Expand Down
2 changes: 0 additions & 2 deletions lib/active_admin/menu_collection.rb
Expand Up @@ -86,8 +86,6 @@ def find_or_create(menu_name)
@menus[menu_name] ||= ActiveAdmin::Menu.new
end



end

end
1 change: 0 additions & 1 deletion lib/active_admin/resource/routes.rb
Expand Up @@ -102,7 +102,6 @@ def route_name(resource_path_name, options = {})
route.compact.join('_').to_sym # :admin_category_posts_path
end


# @return params to pass to instance path
def route_instance_params(instance)
if nested?
Expand Down
5 changes: 0 additions & 5 deletions lib/active_admin/resource_controller/data_access.rb
Expand Up @@ -45,7 +45,6 @@ def collection
end
end


# Does the actual work of retrieving the current collection from the db.
# This is a great method to override if you would like to perform
# some additional db # work before your controller returns and
Expand All @@ -60,7 +59,6 @@ def find_collection(options = {})
collection
end


# Override this method in your controllers to modify the start point
# of our searches and index.
#
Expand Down Expand Up @@ -103,7 +101,6 @@ def find_resource
scoped_collection.send method_for_find, params[:id]
end


# Builds, memoize and authorize a new instance of the resource. The
# actual work of building the new instance is delegated to the
# #build_new_resource method.
Expand Down Expand Up @@ -180,12 +177,10 @@ def destroy_resource(object)
end
end


#
# Collection Helper Methods
#


# Gives the authorization library a change to pre-scope the collection.
#
# In the case of the CanCan adapter, it calls `#accessible_by` on
Expand Down
1 change: 0 additions & 1 deletion lib/active_admin/views/components/scopes.rb
Expand Up @@ -12,7 +12,6 @@ class Scopes < ActiveAdmin::Component
include ActiveAdmin::ScopeChain
include ::ActiveAdmin::Helpers::Collection


def default_class_name
"scopes table_tools_segmented_control"
end
Expand Down
1 change: 0 additions & 1 deletion lib/active_admin/views/header.rb
Expand Up @@ -14,7 +14,6 @@ def build(namespace, menu)
build_utility_navigation
end


def build_site_title
insert_tag view_factory.site_title, @namespace
end
Expand Down
1 change: 0 additions & 1 deletion lib/active_admin/views/index_as_blog.rb
Expand Up @@ -89,7 +89,6 @@ def title(method = nil, &block)
@title
end


# Setter method for the configuration of the body
#
def body(method = nil, &block)
Expand Down
1 change: 0 additions & 1 deletion spec/bug_report_templates_spec.rb
Expand Up @@ -23,5 +23,4 @@
end
end


end
1 change: 0 additions & 1 deletion spec/support/templates/policies/application_policy.rb
Expand Up @@ -38,7 +38,6 @@ def destroy_all?
true
end


def scope
Pundit.policy_scope!(user, record.class)
end
Expand Down
1 change: 0 additions & 1 deletion spec/unit/abstract_view_factory_spec.rb
Expand Up @@ -75,5 +75,4 @@ def my_subclassed_view
end
end


end
1 change: 0 additions & 1 deletion spec/unit/belongs_to_spec.rb
Expand Up @@ -13,7 +13,6 @@
let(:post_config){ ActiveAdmin.register Post do belongs_to :user end }
let(:belongs_to){ post_config.belongs_to_config }


it "should have an owner" do
expect(belongs_to.owner).to eq post_config
end
Expand Down
2 changes: 0 additions & 2 deletions spec/unit/dsl_spec.rb
@@ -1,6 +1,5 @@
require 'rails_helper'


module MockModuleToInclude
def self.included(dsl)
end
Expand All @@ -24,7 +23,6 @@ def self.included(dsl)

end


describe '#action_item' do
before do
@default_items_count = resource_config.action_items.size
Expand Down
1 change: 0 additions & 1 deletion spec/unit/menu_item_spec.rb
Expand Up @@ -128,7 +128,6 @@ module ActiveAdmin
end
end # accessing ancestory


describe "#id" do
it "should be normalized" do
expect(MenuItem.new(id: "Foo Bar").id).to eq "foo_bar"
Expand Down
1 change: 0 additions & 1 deletion spec/unit/namespace_spec.rb
Expand Up @@ -61,7 +61,6 @@
end
end


describe "#fetch_menu" do
let(:namespace){ ActiveAdmin::Namespace.new(application, :admin) }

Expand Down
1 change: 0 additions & 1 deletion spec/unit/page_spec.rb
Expand Up @@ -71,7 +71,6 @@ def config(options = {})
expect(config.belongs_to?).to eq false
end


it "should not have any action_items" do
expect(config.action_items?).to eq false
end
Expand Down
1 change: 0 additions & 1 deletion spec/unit/resource/ordering_spec.rb
Expand Up @@ -20,7 +20,6 @@ module ActiveAdmin
expect(resource_config.ordering.size).to eq(1)
end


it "should allow to setup custom ordering class" do
MyOrderClause = Class.new(ActiveAdmin::OrderClause)
dsl.run_registration_block do
Expand Down
1 change: 0 additions & 1 deletion spec/unit/resource_controller_spec.rb
Expand Up @@ -217,7 +217,6 @@ def call_after_destroy(obj); end
end
end


describe "performing batch_action" do
let(:batch_action) { ActiveAdmin::BatchAction.new :flag, "Flag", &batch_action_block }
let(:batch_action_block) { proc { } }
Expand Down
2 changes: 0 additions & 2 deletions spec/unit/resource_spec.rb
Expand Up @@ -49,7 +49,6 @@ def config(options = {})
end
end


describe "controller name" do
it "should return a namespaced controller name" do
expect(config.controller_name).to eq "Admin::CategoriesController"
Expand Down Expand Up @@ -146,7 +145,6 @@ def config(options = {})
end
end


describe "sort order" do
class MockResource
end
Expand Down
1 change: 0 additions & 1 deletion spec/unit/settings_spec.rb
Expand Up @@ -45,7 +45,6 @@

end


RSpec.describe ActiveAdmin::Settings::Inheritance do

subject do
Expand Down
1 change: 0 additions & 1 deletion spec/unit/view_helpers/method_or_proc_helper_spec.rb
Expand Up @@ -87,7 +87,6 @@

end


end

describe "#render_or_call_method_or_proc_on" do
Expand Down
1 change: 0 additions & 1 deletion spec/unit/views/components/attributes_table_spec.rb
Expand Up @@ -235,7 +235,6 @@
end # describe rendering rows
end # with a collection


context "when using a single Hash" do
let(:table) do
render_arbre_component nil, helpers do
Expand Down
2 changes: 0 additions & 2 deletions spec/unit/views/components/columns_spec.rb
Expand Up @@ -81,7 +81,6 @@
expect(cols.children.size).to eq 4
end


(0..2).to_a.each do |index|
it "should have column #{index + 1} with width 49% and margin 2%" do
expect(cols.children[index].attr(:style)).to eq "width: 23.5%; margin-right: 2%;"
Expand All @@ -93,7 +92,6 @@
end
end


describe "Column Spans" do
let(:cols) do
render_arbre_component do
Expand Down
2 changes: 0 additions & 2 deletions spec/unit/views/components/site_title_spec.rb
Expand Up @@ -73,6 +73,4 @@ def build_title(namespace)

end



end
1 change: 0 additions & 1 deletion tasks/test.rake
Expand Up @@ -23,7 +23,6 @@ namespace :spec do

end


require 'cucumber/rake/task'

Cucumber::Rake::Task.new(:cucumber) do |t|
Expand Down

0 comments on commit d0b93ab

Please sign in to comment.