lib/alexandria/preferences.rb in alexandria-book-collection-manager-0.7.0 vs lib/alexandria/preferences.rb in alexandria-book-collection-manager-0.7.1
- old
+ new
@@ -255,25 +255,25 @@
# Make a judgement about the type of the settings we get back from
# gconftool. This is not fool-proof, but it *does* work for the
# range of values used by Alexandria.
def discriminate(value)
if value == 'true' # bool
- return true
+ true
elsif value == 'false' # bool
- return false
+ false
elsif value =~ /^[0-9]+$/ # int
- return value.to_i
+ value.to_i
elsif value =~ /^\[(.*)\]$/ # list (assume of type String)
- return Regexp.last_match[1].split(',')
+ Regexp.last_match[1].split(',')
elsif value =~ /^\((.*)\)$/ # pair (assume of type int)
begin
pair = Regexp.last_match[1].split(',')
return [discriminate(pair.first), discriminate(pair.last)]
rescue
return [0, 0]
end
else
- return value # string
+ value # string
end
end
end
end