You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i read file download.rb in api, but i dont how to get params[:commit_hash] and understand REQUIRED_KEY_PARAM_NAMES. @vongrippen please help me, thank you.
in download.rb :
`module BitBucket
class Repos::Download < API
REQUIRED_KEY_PARAM_NAMES = %w[ commit_hash ].freeze
def get(user_name, repo_name, params={})
_update_user_repo_params(user_name, repo_name)
_validate_user_repo_params(user, repo) unless user? && repo?
how to download repos?
this is my code, but cant download repos
in controller :
`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
def index
<%= link_to "download", @repositories.download.get('dongpp_57', 'demo') %> ` **it's result:** https://bitbucket.org/dongpp_57/demo/get/.tar.gz (**error)**@repositories = set_bitbucket(current_user).repos
end
**in view :**
i read file download.rb in api, but i dont how to get params[:commit_hash] and understand REQUIRED_KEY_PARAM_NAMES.
@vongrippen please help me, thank you.
in download.rb :
`module BitBucket
class Repos::Download < API
REQUIRED_KEY_PARAM_NAMES = %w[ commit_hash ].freeze
def get(user_name, repo_name, params={})
_update_user_repo_params(user_name, repo_name)
_validate_user_repo_params(user, repo) unless user? && repo?
normalize! params
#assert_required_keys(REQUIRED_KEY_PARAM_NAMES, params)
https://bitbucket.org/jhanley85/eternum_canvas_demo/get/fd931f96f12d.zip
"https://bitbucket.org/#{user}/#{repo.downcase}/get/#{params[:commit_hash]}.tar.gz"
end
end # Repos::Keys
end # BitBucket
`
The text was updated successfully, but these errors were encountered: