Skip to content

Commit

Permalink
Decrease ABC complexity in Releaser#initialize.
Browse files Browse the repository at this point in the history
  • Loading branch information
fnichol committed Aug 6, 2014
1 parent e6e0663 commit af86607
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/emeril/releaser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ def initialize(options = {})
@metadata = options.fetch(:metadata) { default_metadata }
@category = options.fetch(:category) { default_category }
@git_tagger = options.fetch(:git_tagger) { default_git_tagger }
@publish_to_supermarket = options.fetch(:publish_to_supermarket) do
@publish_to_supermarket = options.fetch(
:publish_to_supermarket,
options.fetch(:publish_to_community, true)
end
setup_publisher(options.fetch(:publisher, nil)) if publish_to_supermarket
)
setup_publisher(options.fetch(:publisher, nil))
end

# Tags and releases a cookbook.
Expand Down Expand Up @@ -83,6 +84,8 @@ def default_publisher
end

def setup_publisher(publisher)
return unless publish_to_supermarket

@publisher = publisher || default_publisher
end

Expand Down

0 comments on commit af86607

Please sign in to comment.