Skip to content

Commit

Permalink
added get_password using highline
Browse files Browse the repository at this point in the history
  • Loading branch information
swdyh committed Mar 19, 2012
1 parent ad4e7e6 commit 31789e4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/gisty.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,15 @@ def auth
user.empty? ? {} : { 'login' => user, 'token' => token }
end

def get_password
pw = `git config --global github.password`.strip
if pw.size == 0
ask("Enter your password: ") { |q| q.echo = false }.strip
else
pw
end
end

def post params
url = URI.parse('https://gist.github.com/gists')
req = Net::HTTP::Post.new url.path
Expand Down

0 comments on commit 31789e4

Please sign in to comment.