Skip to content

Commit

Permalink
and so long to the easy stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
whoward committed Feb 6, 2016
1 parent cfc6af3 commit e65e76e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
5 changes: 0 additions & 5 deletions .rubocop_todo.yml
Expand Up @@ -6,11 +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: 3
Lint/NestedMethodDefinition:
Exclude:
- 'lib/cadenza/library.rb'

# Offense count: 17
Metrics/AbcSize:
Max: 53
Expand Down
12 changes: 6 additions & 6 deletions lib/cadenza/library.rb
Expand Up @@ -25,17 +25,17 @@ def self.extended(base)
base.extend Cadenza::Library::Functions

if base.is_a?(Class)
def base.inherited(base)
base.filters.merge!(filters)
base.blocks.merge!(blocks)
base.functions.merge!(functions)
base.define_singleton_method(:inherited) do |subclass|
subclass.filters.merge!(filters)
subclass.blocks.merge!(blocks)
subclass.functions.merge!(functions)
end
else
def base.enhance(&block)
base.define_singleton_method(:enhance) do |&block|
Cadenza::Library.send(:__build, self, &block)
end

def base.included(library)
base.define_singleton_method(:included) do |library|
library.filters.merge!(filters)
library.blocks.merge!(blocks)
library.functions.merge!(functions)
Expand Down

0 comments on commit e65e76e

Please sign in to comment.