Skip to content

HowToUse

hirakiuc edited this page Jul 15, 2017 · 9 revisions

The first step to use tinybucket gem.

At first, you must configure oauth_token/oauth_secret and create Tinybucket::Client instance.

bucket = Tinybucket.new do |config|
  config.oauth_key    = 'Your OAuth Token'
  config.oauth_secret = 'Your OAuth Secret'
end

Repository

# get Repository model.
repo = bucket.repo('owner', 'slug')

# just call `load` method if you need more attributes
repo.load

[How to use Repository](HowToUse Repository)

Team

# get Repository model.
team = bucket.team('team_name')

# just call `load` method if you need more attributes
team.load
role = 'admin'
teams = bucket.teams(role)

teams.each do |team|
  puts team.username
end

=> Check the bitbucket document about role.

[How to use Team](HowToUse Team)

User

# get Repository model.
user = bucket.user('user_name')

# just call `load` method if you need more attributes
user.load

[How to use User](HowToUse User)

Clone this wiki locally