string interpolation (the #{...} syntax) only works inside double quotes
On Sat, Dec 1, 2012 at 6:56 PM, Pierre-Andre M. <[email protected]>wrote:
> I'm new to Ruby...
>
> Trying to write a method that accepts username and password string.
>
> # My method
> def getRepos(username, password)
> github = Github.new do |config|
> config.basic_auth = '#{username}:#{password}'
> end
> github.repos.list :org => 'MyOrg'
>
> end
>
>
> # My Call
> repos_json = getRepos("jstew","spankyDooLittle")
>
> # My Response:
> Github::Error::Unauthorized: GET
> https://api.github.com/orgs/BbMobile/repos: 401 Bad credentials
>
> FYI, when I put the credentials directly into the method it works. I
> have tried with and without quotes...any suggestions?
>
> --
> Posted via http://www.ruby-forum.com/.
>
>
-- You received this message because you are subscribed to the Google Groups
ruby-talk-google group. To post to this group, send email to
[email protected]. To unsubscribe from this group, send email
to [email protected]. For more options, visit this
group at https://groups.google.com/d/forum/ruby-talk-google?hl=en