bitbucket-rest-api / bitbucket

BitBucket API gem - bitbucket_rest_api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

download repos

hienmvvn opened this issue · comments

I cant download repos and recieve message " bad URI(is not URI?): /api/1.0/repositories/#User:0x000000045aff10/demo_1 "
I think this gem version api 1.0, so cant download
Please, help me.
def index
@repositories = set_bitbucket(current_user).repos
@repos = @repositories.get(current_user,"demo_1")
end
def set_bitbucket(user)
bitbucket = BitBucket.new do |config|
config.oauth_token = user.oauth_token
config.oauth_secret = user.oauth_secret
config.client_id = Settings.BITBUCKET_CLIENT_ID
config.client_secret = Settings.BITBUCKET_CLIENT_SECRET
config.adapter = :net_http
end
end

Check the line of code "@repositories.get(current_user, "demo_1")". You are
passing the user object from Active Record directly to bitbucket, instead
of the username. Pass only the username as a string.

Apologies for poor formatting, I am responding from my phone.

Sent from my Google Nexus 5
On Feb 28, 2016 9:32 AM, "Mai Van Hien" notifications@github.com wrote:

I cant download repos and recieve message " bad URI(is not URI?):
/api/1.0/repositories/#User:0x000000045aff10/demo_1 "
def index
@repositories = set_bitbucket(current_user).repos
@repos = @repositories.get(current_user,"demo_1")
end
def set_bitbucket(user)
bitbucket = BitBucket.new do |config|
config.oauth_token = user.oauth_token
config.oauth_secret = user.oauth_secret
config.client_id = Settings.BITBUCKET_CLIENT_ID
config.client_secret = Settings.BITBUCKET_CLIENT_SECRET
config.adapter = :net_http
end
end


Reply to this email directly or view it on GitHub
#46.

done. 👍
thanks you very much.