Browse files

Change defaults (private) method.

Remove line in defaults (private) method and put the same
functionality in the method that it calls, config (private). Also,
get rid of comma in the defaults method's return hash. Remove a
comma after the variable 'extension' in that return hash, as it
causes confusion as to whether that var. is referencing the first
element of an array instead of a string.
  • Loading branch information...
1 parent 627ac48 commit a017df6b9ad6e9af9e8e913b0ca64b329a626aff @luke-gru luke-gru committed Jun 19, 2011
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/gist.rb
@@ -220,12 +220,11 @@ def auth
# gist.extension - string
def defaults
extension = config("gist.extension")
- extension = nil if extension && extension.empty?
return {
"private" => config("gist.private"),
"browse" => config("gist.browse"),
- "extension" => extension,
+ "extension" => extension
@@ -237,7 +236,7 @@ def defaults
# return something useful or nil
def config(key)
env_key = ENV[key.upcase.gsub(/\./, '_')]
- return env_key if env_key and not env_key.empty?
+ return env_key if env_key and not env_key.strip.empty?
str_to_bool `git config --global #{key}`.strip

0 comments on commit a017df6

Please sign in to comment.