Skip to content

Instantly share code, notes, and snippets.

@veganstraightedge
Last active June 29, 2019 23:00
Show Gist options
  • Save veganstraightedge/159a4e536fcf3834cde5fb617ec8c1cd to your computer and use it in GitHub Desktop.
Save veganstraightedge/159a4e536fcf3834cde5fb617ec8c1cd to your computer and use it in GitHub Desktop.
StandardRB and I think different things are better. ¯\_(ツ)_/¯

TO MY EYES, the first is worse than the second.

class Opinions
# StandardRB's opinion
def standardrb
if foo == bar ||
foo == baz
puts "do stuff"
end
end
# My opinion
def mine
if foo == bar ||
foo == baz
puts "do stuff"
end
end
end
# StandardRB's opinion
config.cache_store = if ENV["MEMCACHEDCLOUD_SERVERS"]
[
:dalli_store,
ENV["MEMCACHEDCLOUD_SERVERS"].split(","),
{
username: ENV["MEMCACHEDCLOUD_USERNAME"],
password: ENV["MEMCACHEDCLOUD_PASSWORD"],
},
]
else
# Cache in memory otherwise
[:memory_store, {size: 64.megabytes}]
end
# My opinion
config.cache_store = if ENV['MEMCACHEDCLOUD_SERVERS']
[
:dalli_store,
ENV['MEMCACHEDCLOUD_SERVERS'].split(','),
{
username: ENV['MEMCACHEDCLOUD_USERNAME'],
password: ENV['MEMCACHEDCLOUD_PASSWORD']
}
]
else
# Cache in memory otherwise
[:memory_store, { size: 64.megabytes }]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment