Reduce nesting and remove extra whitespace in python_helper
This commit is contained in:
parent
5db5740cc2
commit
eafa7a141d
@ -1,4 +1,3 @@
|
||||
|
||||
# This is used in the Formula class when the user calls
|
||||
# `python`, `python2` or `python3`.
|
||||
|
||||
@ -19,11 +18,12 @@ def python_helper(options={:allowed_major_versions => [2, 3]}, &block)
|
||||
# We are already inside of a `python do ... end` block, so just return
|
||||
# the current_python or false if the version.major is not allowed.
|
||||
if options[:allowed_major_versions].include?(@current_python.version.major)
|
||||
@current_python
|
||||
return @current_python
|
||||
else
|
||||
false
|
||||
return false
|
||||
end
|
||||
else
|
||||
end
|
||||
|
||||
# Look for PythonInstalled requirements for this formula
|
||||
python_reqs = requirements.select{ |r| r.kind_of?(PythonInstalled) }
|
||||
if python_reqs.empty?
|
||||
@ -88,4 +88,3 @@ def python_helper(options={:allowed_major_versions => [2, 3]}, &block)
|
||||
end
|
||||
end
|
||||
end
|
||||
end # enf of python_helper method
|
||||
|
Loading…
x
Reference in New Issue
Block a user