Permalink
Browse files

Merge pull request #52 from luke-gru/defaults_method

Change defaults (private) method.
  • Loading branch information...
2 parents 627ac48 + a017df6 commit 04ffbef4d482c17e4b78b99c2fddcab34873be10 Andre Arko committed Jun 19, 2011
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/gist.rb
View
@@ -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
}
end
@@ -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
end

0 comments on commit 04ffbef

Please sign in to comment.