Class: Tinybucket::Model::Repository

Inherits:
Base
  • Object
show all
Includes:
Concerns::RepositoryKeys
Defined in:
lib/tinybucket/model/repository.rb

Overview

Repository

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#attributes, #attributes=, concern_included?

Constructor Details

#initialize(json) ⇒ Repository

Returns a new instance of Repository.



57
58
59
60
61
62
# File 'lib/tinybucket/model/repository.rb', line 57

def initialize(json)
  super(json)

  return unless full_name && full_name.split('/').size == 2
  @repo_owner, @repo_slug = full_name.split('/')
end

Instance Attribute Details

#created_onString

Returns:

  • (String)


48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def commits_resource(options = {})
    Tinybucket::Resource::Commits.new(self, options)
  end

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#descriptionString

Returns:

  • (String)


48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def commits_resource(options = {})
    Tinybucket::Resource::Commits.new(self, options)
  end

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#fork_policyString

Returns:

  • (String)


48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def commits_resource(options = {})
    Tinybucket::Resource::Commits.new(self, options)
  end

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#full_nameString

Returns:

  • (String)


48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def commits_resource(options = {})
    Tinybucket::Resource::Commits.new(self, options)
  end

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#has_issuestrue, false

Returns:

  • (true, false)


48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def commits_resource(options = {})
    Tinybucket::Resource::Commits.new(self, options)
  end

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#has_wikitrue, false

Returns:

  • (true, false)


48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def commits_resource(options = {})
    Tinybucket::Resource::Commits.new(self, options)
  end

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#is_privatetrue, false

Returns:

  • (true, false)


48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def commits_resource(options = {})
    Tinybucket::Resource::Commits.new(self, options)
  end

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#languageString

Returns:

  • (String)


48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def commits_resource(options = {})
    Tinybucket::Resource::Commits.new(self, options)
  end

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

Returns:

  • (Hash)


48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def commits_resource(options = {})
    Tinybucket::Resource::Commits.new(self, options)
  end

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#nameString

Returns:

  • (String)


48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def commits_resource(options = {})
    Tinybucket::Resource::Commits.new(self, options)
  end

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#ownerHash

Returns:

  • (Hash)


48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def commits_resource(options = {})
    Tinybucket::Resource::Commits.new(self, options)
  end

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#parentHash, NillClass

Returns:

  • (Hash, NillClass)


48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def commits_resource(options = {})
    Tinybucket::Resource::Commits.new(self, options)
  end

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#projectHash

Returns:

  • (Hash)


48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def commits_resource(options = {})
    Tinybucket::Resource::Commits.new(self, options)
  end

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#scmString

Returns:

  • (String)


48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def commits_resource(options = {})
    Tinybucket::Resource::Commits.new(self, options)
  end

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#sizeFixnum

Returns:

  • (Fixnum)


48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def commits_resource(options = {})
    Tinybucket::Resource::Commits.new(self, options)
  end

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#typeString

Returns:

  • (String)


48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def commits_resource(options = {})
    Tinybucket::Resource::Commits.new(self, options)
  end

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#updated_onString

Returns:

  • (String)


48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def commits_resource(options = {})
    Tinybucket::Resource::Commits.new(self, options)
  end

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#uuidString

Returns:

  • (String)


48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def commits_resource(options = {})
    Tinybucket::Resource::Commits.new(self, options)
  end

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#websiteString

Returns:

  • (String)


48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def commits_resource(options = {})
    Tinybucket::Resource::Commits.new(self, options)
  end

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

Instance Method Details

#branch(branch, options = {}) ⇒ Tinybucket::Model::Branches

Get the specific branch on this repository.

Parameters:

  • branch (String)
  • options (Hash) (defaults to: {})

Returns:

  • (Tinybucket::Model::Branches)


136
137
138
# File 'lib/tinybucket/model/repository.rb', line 136

def branch(branch, options = {})
  branches_resource.find(branch, options)
end

#branch_restriction(restriction_id, options = {}) ⇒ Tinybucket::Model::BranchRestriction

Get the specific branch restriction information on this repository.

Parameters:

  • restriction_id (String)
  • options (Hash) (defaults to: {})

Returns:



153
154
155
# File 'lib/tinybucket/model/repository.rb', line 153

def branch_restriction(restriction_id, options = {})
  branch_restrictions_resource.find(restriction_id, options)
end

#branch_restrictions(options = {}) ⇒ Tinybucket::Resource::BranchRestrictions

Get the branch restriction information associated with this repository.

Parameters:

  • options (Hash) (defaults to: {})

Returns:



144
145
146
# File 'lib/tinybucket/model/repository.rb', line 144

def branch_restrictions(options = {})
  branch_restrictions_resource(options)
end

#branches(options = {}) ⇒ Tinybucket::Resource::Branches

Get branches on this repository

Parameters:

  • options (Hash) (defaults to: {})

Returns:



127
128
129
# File 'lib/tinybucket/model/repository.rb', line 127

def branches(options = {})
  branches_resource(options)
end

#commit(revision, options = {}) ⇒ Tinybucket::Model::Commit

Get the specific commit on this repository.

Parameters:

  • revision (String)
  • options (Hash) (defaults to: {})

Returns:



119
120
121
# File 'lib/tinybucket/model/repository.rb', line 119

def commit(revision, options = {})
  commits_resource.find(revision, options)
end

#commits(options = {}) ⇒ Tinybucket::Resource::Commits

Get commits on this repository.

Parameters:

  • options (Hash) (defaults to: {})

Returns:



110
111
112
# File 'lib/tinybucket/model/repository.rb', line 110

def commits(options = {})
  commits_resource(options)
end

#destroyObject

TODO:

to be implemented.

Remove this repository

Raises:

  • (NotImplementedError)

    to be implemented.



68
69
70
# File 'lib/tinybucket/model/repository.rb', line 68

def destroy
  raise NotImplementedError
end

#diff(spec, options = {}) ⇒ String

Get the diff for this repository.

Parameters:

  • spec (String)

    A specification such as a branch name, revision, or commit SHA.

  • options (Hash) (defaults to: {})

Returns:

  • (String)

    diff as raw text.



163
164
165
# File 'lib/tinybucket/model/repository.rb', line 163

def diff(spec, options = {})
  diff_api.find(spec, options)
end

#forks(options = {}) ⇒ Tinybucket::Resource::Forks

Get repository forks.

Parameters:

  • options (Hash) (defaults to: {})

Returns:



102
103
104
# File 'lib/tinybucket/model/repository.rb', line 102

def forks(options = {})
  forks_resource(options)
end

#patch(spec, options = {}) ⇒ String

Get the patch for the specification.

Parameters:

  • spec (String)

    A specification such as a branch name, revision, or commit SHA.

Returns:

  • (String)

    patch as raw text.



172
173
174
# File 'lib/tinybucket/model/repository.rb', line 172

def patch(spec, options = {})
  diff_api.find_patch(spec, options)
end

#pull_request(pullrequest_id, options = {}) ⇒ Tinybucket::Model::PullRequest

Get the specific pull request on this repository.

Parameters:

  • pullrequest_id (String)
  • options (Hash) (defaults to: {})

Returns:



86
87
88
# File 'lib/tinybucket/model/repository.rb', line 86

def pull_request(pullrequest_id, options = {})
  pull_requests_resource.find(pullrequest_id, options)
end

#pull_requests(options = {}) ⇒ Tinybucket::Enumerator

Get pull requests on thie repository.

Parameters:

  • options (Hash) (defaults to: {})

Returns:



77
78
79
# File 'lib/tinybucket/model/repository.rb', line 77

def pull_requests(options = {})
  pull_requests_resource(options)
end

#watchers(options = {}) ⇒ Tinybucket::Resource::Watchers

Get watchers on this repository.

Parameters:

  • options (Hash) (defaults to: {})

Returns:



94
95
96
# File 'lib/tinybucket/model/repository.rb', line 94

def watchers(options = {})
  watchers_resource(options)
end