tinybucket2 1.0.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tinybucket/api.rb +0 -1
- data/lib/tinybucket/model/issue.rb +4 -16
- data/lib/tinybucket/model/repository.rb +8 -0
- data/lib/tinybucket/resource/issues.rb +5 -5
- data/lib/tinybucket/version.rb +1 -1
- metadata +2 -4
- data/lib/tinybucket/api/helper/issues_helper.rb +0 -29
- data/lib/tinybucket/api/issues_api.rb +0 -48
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e82dbda62abf19141f62f5b9f915511f07ac64599cde37dc99bd1605e68efeab
|
4
|
+
data.tar.gz: 3ce698350165c675841efd0d1e19ef246bd4be89dc7af45d3df3bf42cf60dbbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c19a86b4f9e824f5ba9d206cba89c60ba87f12d2e214d45026cca0b83fe7dc9c12b001156c8fdfa6a9e90c66a28afc439f847cf320f21f6a9d7ee1d6f4c05992
|
7
|
+
data.tar.gz: 69c10116285f8872477d0b747dcda00d98783f7a06242974bc6b51c30ec60972c737b64a363555c0e5df23ebb9146d1f0dde5b7ab84614ad75862a21f08249da
|
data/lib/tinybucket/api.rb
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
|
3
3
|
module Tinybucket
|
4
4
|
module Model
|
5
|
-
#
|
5
|
+
# issue
|
6
6
|
#
|
7
|
-
# @see https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/
|
8
|
-
#
|
7
|
+
# @see https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/issues
|
8
|
+
# issue Resource
|
9
9
|
#
|
10
10
|
# @!attribute [rw] links
|
11
11
|
# @return [Hash]
|
@@ -20,22 +20,10 @@ module Tinybucket
|
|
20
20
|
class Issue < Base
|
21
21
|
include Tinybucket::Model::Concerns::RepositoryKeys
|
22
22
|
|
23
|
-
acceptable_attributes :links, :type, :name, :repository
|
24
|
-
|
25
|
-
# Returns the commits available for the specific branch
|
26
|
-
#
|
27
|
-
# @param options [Hash]
|
28
|
-
# @return [Tinybucket::Resource::Commits]
|
29
|
-
def commits(options = {})
|
30
|
-
commits_resource.issue(name, options)
|
31
|
-
end
|
23
|
+
acceptable_attributes :links, :type, :name, :repository
|
32
24
|
|
33
25
|
private
|
34
26
|
|
35
|
-
def commits_resource(options = {})
|
36
|
-
Tinybucket::Resource::Commits.new(self, options)
|
37
|
-
end
|
38
|
-
|
39
27
|
def issues_api
|
40
28
|
create_api('Issues', repo_keys)
|
41
29
|
end
|
@@ -128,6 +128,14 @@ module Tinybucket
|
|
128
128
|
branches_resource(options)
|
129
129
|
end
|
130
130
|
|
131
|
+
# Get issues on this repository
|
132
|
+
#
|
133
|
+
# @param options [Hash]
|
134
|
+
# @return [Tinybucket::Resource::Issues]
|
135
|
+
def issues(options = {})
|
136
|
+
issues_resource(options)
|
137
|
+
end
|
138
|
+
|
131
139
|
# Get the specific branch on this repository.
|
132
140
|
#
|
133
141
|
# @param branch [String]
|
@@ -8,13 +8,13 @@ module Tinybucket
|
|
8
8
|
@args = [options]
|
9
9
|
end
|
10
10
|
|
11
|
-
# Find the
|
11
|
+
# Find the issue
|
12
12
|
#
|
13
|
-
# @param
|
13
|
+
# @param issue [String]
|
14
14
|
# @param options [Hash]
|
15
|
-
# @return [Tinybucket::Model::
|
16
|
-
def find(
|
17
|
-
issues_api.find(
|
15
|
+
# @return [Tinybucket::Model::Issue]
|
16
|
+
def find(issue, options = {})
|
17
|
+
issues_api.find(issue, options).tap do |m|
|
18
18
|
inject_repo_keys(m, @repo.repo_keys)
|
19
19
|
end
|
20
20
|
end
|
data/lib/tinybucket/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tinybucket2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hirakiuc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -138,14 +138,12 @@ files:
|
|
138
138
|
- lib/tinybucket/api/helper/comments_helper.rb
|
139
139
|
- lib/tinybucket/api/helper/commits_helper.rb
|
140
140
|
- lib/tinybucket/api/helper/diff_helper.rb
|
141
|
-
- lib/tinybucket/api/helper/issues_helper.rb
|
142
141
|
- lib/tinybucket/api/helper/projects_helper.rb
|
143
142
|
- lib/tinybucket/api/helper/pull_requests_helper.rb
|
144
143
|
- lib/tinybucket/api/helper/repo_helper.rb
|
145
144
|
- lib/tinybucket/api/helper/repos_helper.rb
|
146
145
|
- lib/tinybucket/api/helper/team_helper.rb
|
147
146
|
- lib/tinybucket/api/helper/user_helper.rb
|
148
|
-
- lib/tinybucket/api/issues_api.rb
|
149
147
|
- lib/tinybucket/api/projects_api.rb
|
150
148
|
- lib/tinybucket/api/pull_requests_api.rb
|
151
149
|
- lib/tinybucket/api/repo_api.rb
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Tinybucket
|
4
|
-
module Api
|
5
|
-
module Helper
|
6
|
-
module IssuesHelper
|
7
|
-
include ::Tinybucket::Api::Helper::ApiHelper
|
8
|
-
|
9
|
-
private
|
10
|
-
|
11
|
-
def path_to_list
|
12
|
-
build_path(base_path)
|
13
|
-
end
|
14
|
-
|
15
|
-
def path_to_find(issue)
|
16
|
-
build_path(base_path,
|
17
|
-
[issue, 'issue'])
|
18
|
-
end
|
19
|
-
|
20
|
-
def base_path
|
21
|
-
build_path('/repositories',
|
22
|
-
[repo_owner, 'repo_owner'],
|
23
|
-
[repo_slug, 'repo_slug'],
|
24
|
-
'refs', 'issues')
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Tinybucket
|
4
|
-
module Api
|
5
|
-
# Issues Api client
|
6
|
-
#
|
7
|
-
# @!attribute [rw] repo_owner
|
8
|
-
# @return [String] repository owner name.
|
9
|
-
# @!attribute [rw] repo_slug
|
10
|
-
# @return [String] {https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D repo_slug}.
|
11
|
-
class IssuesApi < BaseApi
|
12
|
-
include Tinybucket::Api::Helper::IssuesHelper
|
13
|
-
|
14
|
-
attr_accessor :repo_owner, :repo_slug
|
15
|
-
|
16
|
-
# Send 'GET a Issues list for a repository' request
|
17
|
-
#
|
18
|
-
# @see https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/refs/Issues#get
|
19
|
-
# GET a Issues list for a repository
|
20
|
-
#
|
21
|
-
# @param options [Hash]
|
22
|
-
# @return [Tinybucket::Model::Page]
|
23
|
-
def list(options = {})
|
24
|
-
get_path(
|
25
|
-
path_to_list,
|
26
|
-
options,
|
27
|
-
get_parser(:collection, Tinybucket::Model::Issue)
|
28
|
-
)
|
29
|
-
end
|
30
|
-
|
31
|
-
# Send 'GET an individual Issue' request
|
32
|
-
#
|
33
|
-
# @see https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/refs/Issues/%7Bname%7D#get
|
34
|
-
# GET an individual Issue
|
35
|
-
#
|
36
|
-
# @param name [String] The Issue name
|
37
|
-
# @param options [Hash]
|
38
|
-
# @return [Tinybucket::Model::Issue]
|
39
|
-
def find(name, options = {})
|
40
|
-
get_path(
|
41
|
-
path_to_find(name),
|
42
|
-
options,
|
43
|
-
get_parser(:object, Tinybucket::Model::Issue)
|
44
|
-
)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|