Skip to content

Commit

Permalink
Merge pull request #7 from venmo/ayanonagon/or_equals
Browse files Browse the repository at this point in the history
Use `||=` instead of `unless`
  • Loading branch information
marklarr committed Jun 26, 2014
2 parents c1e76a1 + 64c557e commit 0974abb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/slather/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,19 @@ def configure_build_directory_from_yml
end

def configure_ignore_list_from_yml
self.ignore_list = [(self.class.yml["ignore"] || [])].flatten unless self.ignore_list
self.ignore_list ||= [(self.class.yml["ignore"] || [])].flatten
end

def configure_ci_service_from_yml
self.ci_service = (self.class.yml["ci_service"] || :travis_ci) unless self.ci_service
self.ci_service ||= (self.class.yml["ci_service"] || :travis_ci)
end

def ci_service=(service)
@ci_service = service && service.to_sym
end

def configure_coverage_service_from_yml
self.coverage_service = (self.class.yml["coverage_service"] || :terminal) unless coverage_service
self.coverage_service ||= (self.class.yml["coverage_service"] || :terminal)
end

def coverage_service=(service)
Expand All @@ -93,4 +93,5 @@ def setup_for_coverage
end

end
end
end

0 comments on commit 0974abb

Please sign in to comment.