tinybucket 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (212) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +10 -1
  3. data/Gemfile +8 -7
  4. data/README.md +28 -5
  5. data/Rakefile +1 -0
  6. data/lib/faraday_middleware/follow_oauth_redirects.rb +5 -2
  7. data/lib/tinybucket.rb +2 -0
  8. data/lib/tinybucket/api.rb +3 -0
  9. data/lib/tinybucket/api/base_api.rb +2 -0
  10. data/lib/tinybucket/api/branch_restrictions_api.rb +6 -5
  11. data/lib/tinybucket/api/branches_api.rb +48 -0
  12. data/lib/tinybucket/api/build_status_api.rb +15 -1
  13. data/lib/tinybucket/api/comments_api.rb +7 -6
  14. data/lib/tinybucket/api/commits_api.rb +25 -4
  15. data/lib/tinybucket/api/diff_api.rb +4 -3
  16. data/lib/tinybucket/api/helper.rb +3 -0
  17. data/lib/tinybucket/api/helper/api_helper.rb +2 -0
  18. data/lib/tinybucket/api/helper/branch_restrictions_helper.rb +2 -0
  19. data/lib/tinybucket/api/helper/branches_helper.rb +29 -0
  20. data/lib/tinybucket/api/helper/build_status_helper.rb +11 -0
  21. data/lib/tinybucket/api/helper/comments_helper.rb +2 -0
  22. data/lib/tinybucket/api/helper/commits_helper.rb +8 -0
  23. data/lib/tinybucket/api/helper/diff_helper.rb +2 -0
  24. data/lib/tinybucket/api/helper/pull_requests_helper.rb +2 -0
  25. data/lib/tinybucket/api/helper/repo_helper.rb +2 -0
  26. data/lib/tinybucket/api/helper/repos_helper.rb +2 -0
  27. data/lib/tinybucket/api/helper/team_helper.rb +2 -0
  28. data/lib/tinybucket/api/helper/user_helper.rb +2 -0
  29. data/lib/tinybucket/api/pull_requests_api.rb +4 -3
  30. data/lib/tinybucket/api/repo_api.rb +4 -3
  31. data/lib/tinybucket/api/repos_api.rb +3 -1
  32. data/lib/tinybucket/api/team_api.rb +4 -2
  33. data/lib/tinybucket/api/user_api.rb +3 -1
  34. data/lib/tinybucket/api_factory.rb +2 -0
  35. data/lib/tinybucket/client.rb +3 -2
  36. data/lib/tinybucket/config.rb +5 -1
  37. data/lib/tinybucket/connection.rb +21 -8
  38. data/lib/tinybucket/constants.rb +2 -0
  39. data/lib/tinybucket/enumerator.rb +2 -0
  40. data/lib/tinybucket/error.rb +2 -0
  41. data/lib/tinybucket/error/base_error.rb +2 -0
  42. data/lib/tinybucket/error/conflict.rb +2 -0
  43. data/lib/tinybucket/error/not_found.rb +2 -0
  44. data/lib/tinybucket/error/service_error.rb +2 -0
  45. data/lib/tinybucket/iterator.rb +4 -2
  46. data/lib/tinybucket/model.rb +3 -0
  47. data/lib/tinybucket/model/base.rb +2 -2
  48. data/lib/tinybucket/model/branch.rb +48 -0
  49. data/lib/tinybucket/model/branch_restriction.rb +4 -2
  50. data/lib/tinybucket/model/build_status.rb +3 -1
  51. data/lib/tinybucket/model/comment.rb +4 -2
  52. data/lib/tinybucket/model/commit.rb +6 -2
  53. data/lib/tinybucket/model/concerns.rb +2 -0
  54. data/lib/tinybucket/model/concerns/acceptable_attributes.rb +2 -0
  55. data/lib/tinybucket/model/concerns/api_callable.rb +2 -0
  56. data/lib/tinybucket/model/concerns/enumerable.rb +2 -0
  57. data/lib/tinybucket/model/concerns/reloadable.rb +2 -0
  58. data/lib/tinybucket/model/concerns/repository_keys.rb +2 -0
  59. data/lib/tinybucket/model/error_response.rb +4 -2
  60. data/lib/tinybucket/model/page.rb +4 -2
  61. data/lib/tinybucket/model/profile.rb +4 -2
  62. data/lib/tinybucket/model/pull_request.rb +4 -2
  63. data/lib/tinybucket/model/repository.rb +31 -5
  64. data/lib/tinybucket/model/team.rb +4 -2
  65. data/lib/tinybucket/null_logger.rb +2 -0
  66. data/lib/tinybucket/parser.rb +5 -0
  67. data/lib/tinybucket/parser/base_parser.rb +3 -2
  68. data/lib/tinybucket/parser/branch_parser.rb +13 -0
  69. data/lib/tinybucket/parser/branch_restriction_parser.rb +2 -0
  70. data/lib/tinybucket/parser/branch_restrictions_parser.rb +2 -0
  71. data/lib/tinybucket/parser/branches_parser.rb +11 -0
  72. data/lib/tinybucket/parser/build_status_parser.rb +2 -0
  73. data/lib/tinybucket/parser/builds_parser.rb +11 -0
  74. data/lib/tinybucket/parser/comment_parser.rb +2 -0
  75. data/lib/tinybucket/parser/comments_parser.rb +2 -0
  76. data/lib/tinybucket/parser/commit_parser.rb +2 -0
  77. data/lib/tinybucket/parser/commits_parser.rb +2 -0
  78. data/lib/tinybucket/parser/profile_parser.rb +2 -0
  79. data/lib/tinybucket/parser/profiles_parser.rb +2 -0
  80. data/lib/tinybucket/parser/pull_request_parser.rb +2 -0
  81. data/lib/tinybucket/parser/pull_requests_parser.rb +2 -0
  82. data/lib/tinybucket/parser/repo_parser.rb +2 -0
  83. data/lib/tinybucket/parser/repos_parser.rb +2 -0
  84. data/lib/tinybucket/parser/team_parser.rb +2 -0
  85. data/lib/tinybucket/parser/teams_parser.rb +2 -0
  86. data/lib/tinybucket/request.rb +2 -0
  87. data/lib/tinybucket/resource.rb +3 -0
  88. data/lib/tinybucket/resource/base.rb +6 -0
  89. data/lib/tinybucket/resource/branch_restrictions.rb +2 -0
  90. data/lib/tinybucket/resource/branches.rb +35 -0
  91. data/lib/tinybucket/resource/commit/base.rb +2 -0
  92. data/lib/tinybucket/resource/commit/build_statuses.rb +6 -3
  93. data/lib/tinybucket/resource/commit/comments.rb +2 -0
  94. data/lib/tinybucket/resource/commits.rb +13 -0
  95. data/lib/tinybucket/resource/forks.rb +2 -0
  96. data/lib/tinybucket/resource/pull_request/base.rb +2 -0
  97. data/lib/tinybucket/resource/pull_request/comments.rb +2 -0
  98. data/lib/tinybucket/resource/pull_request/commits.rb +2 -0
  99. data/lib/tinybucket/resource/pull_requests.rb +2 -0
  100. data/lib/tinybucket/resource/repos.rb +2 -0
  101. data/lib/tinybucket/resource/team/base.rb +2 -0
  102. data/lib/tinybucket/resource/team/followers.rb +2 -0
  103. data/lib/tinybucket/resource/team/following.rb +2 -0
  104. data/lib/tinybucket/resource/team/members.rb +2 -0
  105. data/lib/tinybucket/resource/team/repos.rb +2 -0
  106. data/lib/tinybucket/resource/user/base.rb +2 -0
  107. data/lib/tinybucket/resource/user/followers.rb +2 -0
  108. data/lib/tinybucket/resource/user/following.rb +2 -0
  109. data/lib/tinybucket/resource/user/repos.rb +2 -0
  110. data/lib/tinybucket/resource/watchers.rb +2 -0
  111. data/lib/tinybucket/response.rb +2 -0
  112. data/lib/tinybucket/response/handler.rb +2 -0
  113. data/lib/tinybucket/version.rb +3 -1
  114. data/tinybucket.gemspec +1 -1
  115. metadata +11 -193
  116. data/.coveralls.yml +0 -1
  117. data/.gitignore +0 -33
  118. data/.rspec +0 -1
  119. data/.travis.yml +0 -13
  120. data/Guardfile +0 -13
  121. data/spec/fixtures/branch_restriction.json +0 -17
  122. data/spec/fixtures/build_status.json +0 -16
  123. data/spec/fixtures/comment.json +0 -30
  124. data/spec/fixtures/commit.json +0 -83
  125. data/spec/fixtures/profile.json +0 -29
  126. data/spec/fixtures/pull_request.json +0 -106
  127. data/spec/fixtures/repositories/get.json +0 -78
  128. data/spec/fixtures/repositories/test_owner/get.json +0 -78
  129. data/spec/fixtures/repositories/test_owner/test_repo/branch-restrictions/1/get.json +0 -17
  130. data/spec/fixtures/repositories/test_owner/test_repo/branch-restrictions/get.json +0 -101
  131. data/spec/fixtures/repositories/test_owner/test_repo/commit/1/approve/post.json +0 -16
  132. data/spec/fixtures/repositories/test_owner/test_repo/commit/1/comments/1/get.json +0 -38
  133. data/spec/fixtures/repositories/test_owner/test_repo/commit/1/comments/get.json +0 -40
  134. data/spec/fixtures/repositories/test_owner/test_repo/commit/1/get.json +0 -83
  135. data/spec/fixtures/repositories/test_owner/test_repo/commit/1/statuses/build/post.json +0 -16
  136. data/spec/fixtures/repositories/test_owner/test_repo/commit/1/statuses/build/test_status/get.json +0 -16
  137. data/spec/fixtures/repositories/test_owner/test_repo/commit/1/statuses/build/test_status/put.json +0 -16
  138. data/spec/fixtures/repositories/test_owner/test_repo/commits/get.json +0 -73
  139. data/spec/fixtures/repositories/test_owner/test_repo/diff/1/get.json +0 -21
  140. data/spec/fixtures/repositories/test_owner/test_repo/forks/get.json +0 -78
  141. data/spec/fixtures/repositories/test_owner/test_repo/get.json +0 -71
  142. data/spec/fixtures/repositories/test_owner/test_repo/patch/1/get.json +0 -29
  143. data/spec/fixtures/repositories/test_owner/test_repo/pullrequests/1/approve/delete.json +0 -3
  144. data/spec/fixtures/repositories/test_owner/test_repo/pullrequests/1/approve/post.json +0 -3
  145. data/spec/fixtures/repositories/test_owner/test_repo/pullrequests/1/comments/1/get.json +0 -30
  146. data/spec/fixtures/repositories/test_owner/test_repo/pullrequests/1/comments/get.json +0 -44
  147. data/spec/fixtures/repositories/test_owner/test_repo/pullrequests/1/commits/get.json +0 -66
  148. data/spec/fixtures/repositories/test_owner/test_repo/pullrequests/1/decline/post.json +0 -116
  149. data/spec/fixtures/repositories/test_owner/test_repo/pullrequests/1/diff/get.txt +0 -13
  150. data/spec/fixtures/repositories/test_owner/test_repo/pullrequests/1/get.json +0 -164
  151. data/spec/fixtures/repositories/test_owner/test_repo/pullrequests/1/merge/post.json +0 -123
  152. data/spec/fixtures/repositories/test_owner/test_repo/pullrequests/get.json +0 -112
  153. data/spec/fixtures/repositories/test_owner/test_repo/pullrequests/get_state_declined.json +0 -112
  154. data/spec/fixtures/repositories/test_owner/test_repo/pullrequests/get_state_merged.json +0 -112
  155. data/spec/fixtures/repositories/test_owner/test_repo/pullrequests/get_state_open.json +0 -112
  156. data/spec/fixtures/repositories/test_owner/test_repo/watchers/get.json +0 -32
  157. data/spec/fixtures/repository.json +0 -72
  158. data/spec/fixtures/team.json +0 -32
  159. data/spec/fixtures/teams/test_team/followers/get.json +0 -36
  160. data/spec/fixtures/teams/test_team/following/get.json +0 -39
  161. data/spec/fixtures/teams/test_team/get.json +0 -32
  162. data/spec/fixtures/teams/test_team/members/get.json +0 -36
  163. data/spec/fixtures/teams/test_team/repositories/get.json +0 -125
  164. data/spec/fixtures/users/test_owner/followers/get.json +0 -65
  165. data/spec/fixtures/users/test_owner/following/get.json +0 -100
  166. data/spec/fixtures/users/test_owner/get.json +0 -29
  167. data/spec/lib/tinybucket/api/branch_restrictions_api_spec.rb +0 -77
  168. data/spec/lib/tinybucket/api/build_status_api_spec.rb +0 -65
  169. data/spec/lib/tinybucket/api/comments_api_spec.rb +0 -132
  170. data/spec/lib/tinybucket/api/commits_api_spec.rb +0 -152
  171. data/spec/lib/tinybucket/api/diff_api_spec.rb +0 -5
  172. data/spec/lib/tinybucket/api/pull_requests_api_spec.rb +0 -259
  173. data/spec/lib/tinybucket/api/repo_api_spec.rb +0 -99
  174. data/spec/lib/tinybucket/api/repos_api_spec.rb +0 -27
  175. data/spec/lib/tinybucket/api/team_api_spec.rb +0 -82
  176. data/spec/lib/tinybucket/api/user_api_spec.rb +0 -73
  177. data/spec/lib/tinybucket/api_factory_spec.rb +0 -18
  178. data/spec/lib/tinybucket/client_spec.rb +0 -100
  179. data/spec/lib/tinybucket/connection_spec.rb +0 -30
  180. data/spec/lib/tinybucket/error/service_error_spec.rb +0 -23
  181. data/spec/lib/tinybucket/model/branch_restriction_spec.rb +0 -35
  182. data/spec/lib/tinybucket/model/build_status_spec.rb +0 -66
  183. data/spec/lib/tinybucket/model/comment_spec.rb +0 -37
  184. data/spec/lib/tinybucket/model/commit_spec.rb +0 -108
  185. data/spec/lib/tinybucket/model/page_spec.rb +0 -28
  186. data/spec/lib/tinybucket/model/profile_spec.rb +0 -52
  187. data/spec/lib/tinybucket/model/pull_request_spec.rb +0 -141
  188. data/spec/lib/tinybucket/model/repository_spec.rb +0 -131
  189. data/spec/lib/tinybucket/model/team_spec.rb +0 -70
  190. data/spec/lib/tinybucket/null_logger_spec.rb +0 -53
  191. data/spec/lib/tinybucket/resource/branch_restrictions_spec.rb +0 -60
  192. data/spec/lib/tinybucket/resource/commit/build_statuses_spec.rb +0 -50
  193. data/spec/lib/tinybucket/resource/commit/comments_spec.rb +0 -49
  194. data/spec/lib/tinybucket/resource/commits_spec.rb +0 -43
  195. data/spec/lib/tinybucket/resource/forks_spec.rb +0 -36
  196. data/spec/lib/tinybucket/resource/pull_request/comments_spec.rb +0 -41
  197. data/spec/lib/tinybucket/resource/pull_request/commits_spec.rb +0 -41
  198. data/spec/lib/tinybucket/resource/pull_requests_spec.rb +0 -59
  199. data/spec/lib/tinybucket/resource/repos_spec.rb +0 -76
  200. data/spec/lib/tinybucket/resource/team/followers_spec.rb +0 -27
  201. data/spec/lib/tinybucket/resource/team/following_spec.rb +0 -27
  202. data/spec/lib/tinybucket/resource/team/members_spec.rb +0 -27
  203. data/spec/lib/tinybucket/resource/team/repos_spec.rb +0 -27
  204. data/spec/lib/tinybucket/resource/user/followers_spec.rb +0 -27
  205. data/spec/lib/tinybucket/resource/user/following_spec.rb +0 -27
  206. data/spec/lib/tinybucket/resource/user/repos_spec.rb +0 -27
  207. data/spec/lib/tinybucket/resource/watchers_spec.rb +0 -38
  208. data/spec/lib/tinybucket_spec.rb +0 -42
  209. data/spec/spec_helper.rb +0 -45
  210. data/spec/support/api_response_macros.rb +0 -74
  211. data/spec/support/fixture_macros.rb +0 -5
  212. data/spec/support/model_macros.rb +0 -103
@@ -1,36 +0,0 @@
1
- {
2
- "pagelen": 50,
3
- "values": [
4
- {
5
- "username": "tutorials",
6
- "kind": "team",
7
- "website": "https://tutorials.bitbucket.org/",
8
- "display_name": "first name last",
9
- "links": {
10
- "self": {
11
- "href": "https://api.bitbucket.org/2.0/users/tutorials"
12
- },
13
- "repositories": {
14
- "href": "https://api.bitbucket.org/2.0/users/tutorials/repositories"
15
- },
16
- "html": {
17
- "href": "https://api.bitbucket.org/tutorials"
18
- },
19
- "followers": {
20
- "href": "https://api.bitbucket.org/2.0/users/tutorials/followers"
21
- },
22
- "avatar": {
23
- "href": "https://bitbucket-assetroot.s3.amazonaws.com/c/photos/2013/Jul/17/tutorials-avatar-1826704565-4_avatar.png"
24
- },
25
- "following": {
26
- "href": "https://api.bitbucket.org/2.0/users/tutorials/following"
27
- }
28
- },
29
- "created_on": "2011-12-20T16:34:07.132459+00:00",
30
- "location": "Santa Monica, CA",
31
- "type": "team"
32
- }
33
- ],
34
- "page": 1,
35
- "size": 1
36
- }
@@ -1,125 +0,0 @@
1
- {
2
- "pagelen": 10,
3
- "values": [
4
- {
5
- "scm": "hg",
6
- "has_wiki": true,
7
- "description": "This repository is used by the Bitbucket tutorial documentation.  It is referenced from this page:\r\n\r\nhttps://confluence.atlassian.com/display/BITBUCKET/Split+a+Repository+in+Two ",
8
- "links": {
9
- "watchers": {
10
- "href": "https://api.bitbucket.org/2.0/repositories/tutorials/hgsplitpractice/watchers"
11
- },
12
- "commits": {
13
- "href": "https://api.bitbucket.org/2.0/repositories/tutorials/hgsplitpractice/commits"
14
- },
15
- "self": {
16
- "href": "https://api.bitbucket.org/2.0/repositories/tutorials/hgsplitpractice"
17
- },
18
- "html": {
19
- "href": "https://api.bitbucket.org/tutorials/hgsplitpractice"
20
- },
21
- "avatar": {
22
- "href": "https://bitbucket-assetroot.s3.amazonaws.com/c/photos/2012/Nov/28hgsplitpractice-logo-129947197-5_avatar.png"
23
- },
24
- "forks": {
25
- "href": "https://api.bitbucket.org/2.0/repositories/tutorials/hgsplitpractice/forks"
26
- },
27
- "clone": [
28
- {
29
- "href": "https://tutorials@bitbucket.org/tutorials/hgsplitpractice",
30
- "name": "https"
31
- },
32
- {
33
- "href": "ssh://hg@bitbucket.org/tutorials/hgsplitpractice",
34
- "name": "ssh"
35
- }
36
- ],
37
- "pullrequests": {
38
- "href": "https://api.bitbucket.org/2.0/repositories/tutorials/hgsplitpractice/pullrequests"
39
- }
40
- },
41
- "fork_policy": "allow_forks",
42
- "language": "",
43
- "created_on": "2012-11-27T19:19:33.315067+00:00",
44
- "full_name": "tutorials/hgsplitpractice",
45
- "has_issues": false,
46
- "owner": {
47
- "teamname": "tutorials",
48
- "display_name": "first name last",
49
- "links": {
50
- "self": {
51
- "href": "https://api.bitbucket.org/2.0/teams/tutorials"
52
- },
53
- "avatar": {
54
- "href": "https://bitbucket-assetroot.s3.amazonaws.com/c/photos/2013/Jul/17/tutorials-avatar-1826704565-4_avatar.png"
55
- }
56
- }
57
- },
58
- "updated_on": "2013-02-04T17:04:13.612906+00:00",
59
- "size": 19065,
60
- "is_private": false,
61
- "name": "hgsplitpractice"
62
- },
63
- {
64
- "scm": "git",
65
- "has_wiki": false,
66
- "description": "Example scripts using OAuth to connect to Bitbucket. Please contribute more by issuing a Pull Request here!",
67
- "links": {
68
- "watchers": {
69
- "href": "https://api.bitbucket.org/2.0/repositories/tutorials/oauth-examples/watchers"
70
- },
71
- "commits": {
72
- "href": "https://api.bitbucket.org/2.0/repositories/tutorials/oauth-examples/commits"
73
- },
74
- "self": {
75
- "href": "https://api.bitbucket.org/2.0/repositories/tutorials/oauth-examples"
76
- },
77
- "html": {
78
- "href": "https://api.bitbucket.org/tutorials/oauth-examples"
79
- },
80
- "avatar": {
81
- "href": "https://d3oaxc4q5k2d6q.cloudfront.net/m/bc85d1577e04/img/language-avatars/default_16.png"
82
- },
83
- "forks": {
84
- "href": "https://api.bitbucket.org/2.0/repositories/tutorials/oauth-examples/forks"
85
- },
86
- "clone": [
87
- {
88
- "href": "https://tutorials@bitbucket.org/tutorials/oauth-examples.git",
89
- "name": "https"
90
- },
91
- {
92
- "href": "ssh://git@bitbucket.org/tutorials/oauth-examples.git",
93
- "name": "ssh"
94
- }
95
- ],
96
- "pullrequests": {
97
- "href": "https://api.bitbucket.org/2.0/repositories/tutorials/oauth-examples/pullrequests"
98
- }
99
- },
100
- "fork_policy": "allow_forks",
101
- "language": "",
102
- "created_on": "2013-04-01T21:19:07.973032+00:00",
103
- "full_name": "tutorials/oauth-examples",
104
- "has_issues": false,
105
- "owner": {
106
- "teamname": "tutorials",
107
- "display_name": "first name last",
108
- "links": {
109
- "self": {
110
- "href": "https://api.bitbucket.org/2.0/teams/tutorials"
111
- },
112
- "avatar": {
113
- "href": "https://bitbucket-assetroot.s3.amazonaws.com/c/photos/2013/Jul/17/tutorials-avatar-1826704565-4_avatar.png"
114
- }
115
- }
116
- },
117
- "updated_on": "2013-04-01T21:20:22.492622+00:00",
118
- "size": 1794,
119
- "is_private": false,
120
- "name": "OAuth Examples"
121
- }
122
- ],
123
- "page": 1,
124
- "size": 2
125
- }
@@ -1,65 +0,0 @@
1
- {
2
- "pagelen": 10,
3
- "values": [
4
- {
5
- "username": "RagnarArdal",
6
- "kind": "user",
7
- "website": null,
8
- "display_name": "Ragnar Árdal",
9
- "links": {
10
- "self": {
11
- "href": "https://api.bitbucket.org/2.0/users/RagnarArdal"
12
- },
13
- "repositories": {
14
- "href": "https://api.bitbucket.org/2.0/users/RagnarArdal/repositories"
15
- },
16
- "html": {
17
- "href": "https://api.bitbucket.org/RagnarArdal"
18
- },
19
- "followers": {
20
- "href": "https://api.bitbucket.org/2.0/users/RagnarArdal/followers"
21
- },
22
- "avatar": {
23
- "href": "https://secure.gravatar.com/avatar/27ca0dc0bb96722af4f0222f6260fbb5?d=https%3A%2F%2Fd3oaxc4q5k2d6q.cloudfront.net%2Fm%2Fb376619db485%2Fimg%2Fdefault_avatar%2F32%2Fuser_blue.png&s=32"
24
- },
25
- "following": {
26
- "href": "https://api.bitbucket.org/2.0/users/RagnarArdal/following"
27
- }
28
- },
29
- "created_on": "2013-04-19T19:10:54.044200+00:00",
30
- "location": null,
31
- "type":"user"
32
- },
33
- {
34
- "username": "ericko",
35
- "kind": "user",
36
- "website": "",
37
- "display_name": "ericko",
38
- "links": {
39
- "self": {
40
- "href": "https://api.bitbucket.org/2.0/users/ericko"
41
- },
42
- "repositories": {
43
- "href": "https://api.bitbucket.org/2.0/users/ericko/repositories"
44
- },
45
- "html": {
46
- "href": "https://api.bitbucket.org/ericko"
47
- },
48
- "followers": {
49
- "href": "https://api.bitbucket.org/2.0/users/ericko/followers"
50
- },
51
- "avatar": {
52
- "href": "https://secure.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=https%3A%2F%2Fd3oaxc4q5k2d6q.cloudfront.net%2Fm%2Fb376619db485%2Fimg%2Fdefault_avatar%2F32%2Fuser_blue.png&s=32"
53
- },
54
- "following": {
55
- "href": "https://api.bitbucket.org/2.0/users/ericko/following"
56
- }
57
- },
58
- "created_on": "2013-10-20T16:29:04.388755+00:00",
59
- "location": "",
60
- "type":"user"
61
- }
62
- ],
63
- "page": 1,
64
- "size": 2
65
- }
@@ -1,100 +0,0 @@
1
- {
2
- "pagelen": 10,
3
- "values": [
4
- {
5
- "username": "jdoklovic",
6
- "kind": "user",
7
- "website": "http://www.sysbliss.com/",
8
- "display_name": "Jonathan Doklovic",
9
- "links": {
10
- "self": {
11
- "href": "https://api.bitbucket.org/2.0/users/jdoklovic"
12
- },
13
- "repositories": {
14
- "href": "https://api.bitbucket.org/2.0/users/jdoklovic/repositories"
15
- },
16
- "html": {
17
- "href": "https://api.bitbucket.org/jdoklovic"
18
- },
19
- "followers": {
20
- "href": "https://api.bitbucket.org/2.0/users/jdoklovic/followers"
21
- },
22
- "avatar": {
23
- "href": "https://bitbucket-assetroot.s3.amazonaws.com/c/photos/2010/Sep/30/jd_profile_avatar.jpg"
24
- },
25
- "following": {
26
- "href": "https://api.bitbucket.org/2.0/users/jdoklovic/following"
27
- }
28
- },
29
- "created_on": "2010-09-30T13:44:45.049874+00:00",
30
- "location": "Minneapolis, MN",
31
- "type":"user"
32
- },
33
- {
34
- "username": "atlassian_tutorial",
35
- "kind": "team",
36
- "website": "",
37
- "display_name": "Atlassian Tutorials",
38
- "links": {
39
- "self": {
40
- "href": "https://api.bitbucket.org/2.0/teams/atlassian_tutorial"
41
- },
42
- "repositories": {
43
- "href": "https://api.bitbucket.org/2.0/teams/atlassian_tutorial/repositories"
44
- },
45
- "html": {
46
- "href": "https://api.bitbucket.org/atlassian_tutorial"
47
- },
48
- "followers": {
49
- "href": "https://api.bitbucket.org/2.0/teams/atlassian_tutorial/followers"
50
- },
51
- "avatar": {
52
- "href": "https://secure.gravatar.com/avatar/eb4e0ad6934518b3e335345a4ceeef21?d=https%3A%2F%2Fd3oaxc4q5k2d6q.cloudfront.net%2Fm%2Fbc85d1577e04%2Fimg%2Fdefault_team_avatar%2F32%2Fteam_blue.png&s=32"
53
- },
54
- "members": {
55
- "href": "https://api.bitbucket.org/2.0/teams/atlassian_tutorial/members"
56
- },
57
- "following": {
58
- "href": "https://api.bitbucket.org/2.0/teams/atlassian_tutorial/following"
59
- }
60
- },
61
- "created_on": "2011-11-29T05:38:01.075233+00:00",
62
- "location": "",
63
- "type":"team"
64
- },
65
- {
66
- "username": "cat_vasja",
67
- "kind": "team",
68
- "website": "",
69
- "display_name": "cat_vasja",
70
- "links": {
71
- "self": {
72
- "href": "https://api.bitbucket.org/2.0/teams/cat_vasja"
73
- },
74
- "repositories": {
75
- "href": "https://api.bitbucket.org/2.0/teams/cat_vasja/repositories"
76
- },
77
- "html": {
78
- "href": "https://api.bitbucket.org/cat_vasja"
79
- },
80
- "followers": {
81
- "href": "https://api.bitbucket.org/2.0/teams/cat_vasja/followers"
82
- },
83
- "avatar": {
84
- "href": "https://secure.gravatar.com/avatar/e16be80e861baccc5ed4691737faeb05?d=https%3A%2F%2Fd3oaxc4q5k2d6q.cloudfront.net%2Fm%2Fbc85d1577e04%2Fimg%2Fdefault_team_avatar%2F32%2Fteam_blue.png&s=32"
85
- },
86
- "members": {
87
- "href": "https://api.bitbucket.org/2.0/teams/cat_vasja/members"
88
- },
89
- "following": {
90
- "href": "https://api.bitbucket.org/2.0/teams/cat_vasja/following"
91
- }
92
- },
93
- "created_on": "2012-10-09T19:45:37.292078+00:00",
94
- "location": "Deutschland",
95
- "type":"team"
96
- }
97
- ],
98
- "page": 1,
99
- "size": 3
100
- }
@@ -1,29 +0,0 @@
1
- {
2
- "username": "tutorials",
3
- "kind": "user",
4
- "website": "https://tutorials.bitbucket.org/",
5
- "display_name": "first name last",
6
- "links": {
7
- "self": {
8
- "href": "https://api.bitbucket.org/2.0/users/tutorials"
9
- },
10
- "repositories": {
11
- "href": "https://api.bitbucket.org/2.0/users/tutorials/repositories"
12
- },
13
- "html": {
14
- "href": "https://api.bitbucket.org/tutorials"
15
- },
16
- "followers": {
17
- "href": "https://api.bitbucket.org/2.0/users/tutorials/followers"
18
- },
19
- "avatar": {
20
- "href": "https://bitbucket-assetroot.s3.amazonaws.com/c/photos/2013/Jul/17/tutorials-avatar-1826704565-4_avatar.png"
21
- },
22
- "following": {
23
- "href": "https://api.bitbucket.org/2.0/users/tutorials/following"
24
- }
25
- },
26
- "created_on": "2011-12-20T16:34:07.132459+00:00",
27
- "location": "San Francisco, CA",
28
- "type": "user"
29
- }
@@ -1,77 +0,0 @@
1
- require 'spec_helper'
2
-
3
- RSpec.describe Tinybucket::Api::BranchRestrictionsApi do
4
- include ApiResponseMacros
5
-
6
- let(:owner) { 'test_owner' }
7
- let(:slug) { 'test_repo' }
8
- let(:request_path) { nil }
9
-
10
- let(:api) do
11
- api = Tinybucket::Api::BranchRestrictionsApi.new
12
- api.repo_owner = owner
13
- api.repo_slug = slug
14
- api
15
- end
16
-
17
- it { expect(api).to be_a_kind_of(Tinybucket::Api::BaseApi) }
18
-
19
- before { stub_apiresponse(:get, request_path) if request_path }
20
-
21
- describe '#list' do
22
- subject { api.list }
23
-
24
- context 'without repo_owner and repo_slug' do
25
- let(:owner) { nil }
26
- let(:slug) { nil }
27
- it { expect { subject }.to raise_error(ArgumentError) }
28
- end
29
-
30
- context 'without repo_owner' do
31
- let(:owner) { nil }
32
- it { expect { subject }.to raise_error(ArgumentError) }
33
- end
34
-
35
- context 'without repo_slug' do
36
- let(:slug) { nil }
37
- it { expect { subject }.to raise_error(ArgumentError) }
38
- end
39
-
40
- context 'with repo_owner and repo_slug' do
41
- let(:request_path) do
42
- "/repositories/#{owner}/#{slug}/branch-restrictions"
43
- end
44
- it { expect(subject).to be_an_instance_of(Tinybucket::Model::Page) }
45
- end
46
- end
47
-
48
- describe '#find' do
49
- let(:restriction_id) { '1' }
50
- subject { api.find(restriction_id) }
51
-
52
- context 'without repo_owner and repo_slug' do
53
- let(:owner) { nil }
54
- let(:slug) { nil }
55
- it { expect { subject }.to raise_error(ArgumentError) }
56
- end
57
-
58
- context 'without repo_owner' do
59
- let(:owner) { nil }
60
- it { expect { subject }.to raise_error(ArgumentError) }
61
- end
62
-
63
- context 'without repo_slug' do
64
- let(:slug) { nil }
65
- it { expect { subject }.to raise_error(ArgumentError) }
66
- end
67
-
68
- context 'with repo_owner and repo_slug' do
69
- let(:request_path) do
70
- "/repositories/#{owner}/#{slug}/branch-restrictions/#{restriction_id}"
71
- end
72
- it 'return BranchRestriction Model' do
73
- expect(subject).to be_an_instance_of(Tinybucket::Model::BranchRestriction)
74
- end
75
- end
76
- end
77
- end
@@ -1,65 +0,0 @@
1
- require 'spec_helper'
2
-
3
- RSpec.describe Tinybucket::Api::BuildStatusApi do
4
- include ApiResponseMacros
5
-
6
- let(:owner) { 'test_owner' }
7
- let(:slug) { 'test_repo' }
8
- let(:revision) { '1' }
9
- let(:status_key) { 'test_status' }
10
- let(:options) { {} }
11
-
12
- let(:api) do
13
- Tinybucket::Api::BuildStatusApi.new.tap do |api|
14
- api.repo_owner = owner
15
- api.repo_slug = slug
16
- end
17
- end
18
-
19
- it { expect(api).to be_a_kind_of(Tinybucket::Api::BaseApi) }
20
-
21
- describe '#find' do
22
- let(:request_path) do
23
- "/repositories/#{owner}/#{slug}/commit/#{revision}/statuses/build/#{status_key}"
24
- end
25
- subject { api.find(revision, status_key) }
26
- before { stub_apiresponse(:get, request_path) }
27
- it { expect(subject).to be_an_instance_of(Tinybucket::Model::BuildStatus) }
28
- end
29
-
30
- describe '#post' do
31
- let(:request_path) do
32
- "/repositories/#{owner}/#{slug}/commit/#{revision}/statuses/build"
33
- end
34
- let(:params) do
35
- {
36
- state: 'INPROGRESS',
37
- name: 'test_repo test #10',
38
- url: 'https://example.com/path/to/build/info',
39
- description: 'Changes by test_owner'
40
- }
41
- end
42
-
43
- subject { api.post(revision, status_key, params) }
44
- before { stub_apiresponse(:post, request_path) }
45
- it { expect(subject).to be_an_instance_of(Tinybucket::Model::BuildStatus) }
46
- end
47
-
48
- describe '#put' do
49
- let(:request_path) do
50
- "/repositories/#{owner}/#{slug}/commit/#{revision}/statuses/build/#{status_key}"
51
- end
52
- let(:params) do
53
- {
54
- state: 'SUCCESSFUL',
55
- name: 'test_repo test #10',
56
- url: 'https://example.com/path/to/build/info',
57
- description: 'Changes by test_owner'
58
- }
59
- end
60
-
61
- subject { api.put(revision, status_key, params) }
62
- before { stub_apiresponse(:put, request_path) }
63
- it { expect(subject).to be_an_instance_of(Tinybucket::Model::BuildStatus) }
64
- end
65
- end