semaphore_client 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0f4bc17c6d4eda2082b22fe409cb60f00081643c
4
- data.tar.gz: 741171ffe6d211d8b8a0de652f4fd49603d0768a
3
+ metadata.gz: 233f6445c0fea8148557b7b1ddf8b5ab09104d02
4
+ data.tar.gz: 1d57cc7003b566b378dbe462291378717c3865aa
5
5
  SHA512:
6
- metadata.gz: 2d6c01a59e2fa74405d5f175fba287c68c1610a102afdb8fed454ae2df7e847ec74072bbb57c34db22f2f9c1e53dac73dddae8b569b8ac6661d783e5ccf5660f
7
- data.tar.gz: aecf1c47769bac934ecbe71fbbe35220367d82a727057264ed4130881e849886c50e5882113eb549c6615350d7f11468643451466e33a664b909e0f424c84245
6
+ metadata.gz: 798d8b603c162d9e39503218da46ebc1dfe7dab4e861ac3e304a651989ac88d142ec8c1b4ba2f4013c8b8daa1c94bd5d21a6f7649311924daf652ecbbd06c68a
7
+ data.tar.gz: cb7ee819ae73ccfc02c66aea7e7d0da755640454086b908964ea8169988565a7d2d19f8fd580c99a75961e7a1fe004b25884c18d14f8599940189229de5c986c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- semaphore_client (2.1.1)
4
+ semaphore_client (2.1.2)
5
5
  faraday
6
6
 
7
7
  GEM
@@ -5,8 +5,8 @@ class SemaphoreClient
5
5
  @http_client = http_client
6
6
  end
7
7
 
8
- def list_for_project(project_id)
9
- list_for_project!(project_id)
8
+ def list_for_project(project_id, query = nil)
9
+ list_for_project!(project_id, query)
10
10
  rescue SemaphoreClient::Exceptions::RequestFailed
11
11
  end
12
12
 
@@ -20,8 +20,8 @@ class SemaphoreClient
20
20
  rescue SemaphoreClient::Exceptions::RequestFailed
21
21
  end
22
22
 
23
- def list_for_shared_config(shared_config_id)
24
- list_for_shared_config!(shared_config_id)
23
+ def list_for_shared_config(shared_config_id, query = nil)
24
+ list_for_shared_config!(shared_config_id, query)
25
25
  rescue SemaphoreClient::Exceptions::RequestFailed
26
26
  end
27
27
 
@@ -45,8 +45,10 @@ class SemaphoreClient
45
45
  rescue SemaphoreClient::Exceptions::RequestFailed
46
46
  end
47
47
 
48
- def list_for_project!(project_id)
49
- response = @http_client.get([:projects, project_id, :config_files])
48
+ def list_for_project!(project_id, query = nil)
49
+ query_string = query.nil? ? nil : "?#{query}"
50
+
51
+ response = @http_client.get([:projects, project_id, :config_files, query_string].compact)
50
52
 
51
53
  assert_response_status(response, 200)
52
54
 
@@ -69,8 +71,10 @@ class SemaphoreClient
69
71
  assert_response_status(response, 204)
70
72
  end
71
73
 
72
- def list_for_shared_config!(shared_config_id)
73
- response = @http_client.get([:shared_configs, shared_config_id, :config_files])
74
+ def list_for_shared_config!(shared_config_id, query = nil)
75
+ query_string = query.nil? ? nil : "?#{query}"
76
+
77
+ response = @http_client.get([:shared_configs, shared_config_id, :config_files, query_string].compact)
74
78
 
75
79
  assert_response_status(response, 200)
76
80
 
@@ -5,8 +5,8 @@ class SemaphoreClient
5
5
  @http_client = http_client
6
6
  end
7
7
 
8
- def list_for_project(project_id)
9
- list_for_project!(project_id)
8
+ def list_for_project(project_id, query = nil)
9
+ list_for_project!(project_id, query)
10
10
  rescue SemaphoreClient::Exceptions::RequestFailed
11
11
  end
12
12
 
@@ -20,8 +20,8 @@ class SemaphoreClient
20
20
  rescue SemaphoreClient::Exceptions::RequestFailed
21
21
  end
22
22
 
23
- def list_for_shared_config(shared_config_id)
24
- list_for_shared_config!(shared_config_id)
23
+ def list_for_shared_config(shared_config_id, query = nil)
24
+ list_for_shared_config!(shared_config_id, query)
25
25
  rescue SemaphoreClient::Exceptions::RequestFailed
26
26
  end
27
27
 
@@ -45,8 +45,10 @@ class SemaphoreClient
45
45
  rescue SemaphoreClient::Exceptions::RequestFailed
46
46
  end
47
47
 
48
- def list_for_project!(project_id)
49
- response = @http_client.get([:projects, project_id, :env_vars])
48
+ def list_for_project!(project_id, query = nil)
49
+ query_string = query.nil? ? nil : "?#{query}"
50
+
51
+ response = @http_client.get([:projects, project_id, :env_vars, query_string].compact)
50
52
 
51
53
  assert_response_status(response, 200)
52
54
 
@@ -69,8 +71,10 @@ class SemaphoreClient
69
71
  assert_response_status(response, 204)
70
72
  end
71
73
 
72
- def list_for_shared_config!(shared_config_id)
73
- response = @http_client.get([:shared_configs, shared_config_id, :env_vars])
74
+ def list_for_shared_config!(shared_config_id, query = nil)
75
+ query_string = query.nil? ? nil : "?#{query}"
76
+
77
+ response = @http_client.get([:shared_configs, shared_config_id, :env_vars, query_string].compact)
74
78
 
75
79
  assert_response_status(response, 200)
76
80
 
@@ -5,13 +5,13 @@ class SemaphoreClient
5
5
  @http_client = http_client
6
6
  end
7
7
 
8
- def list_for_org(org_id)
9
- list_for_org!(org_id)
8
+ def list_for_org(org_id, query = nil)
9
+ list_for_org!(org_id, query)
10
10
  rescue SemaphoreClient::Exceptions::RequestFailed
11
11
  end
12
12
 
13
- def list_for_team(team_id)
14
- list_for_team!(team_id)
13
+ def list_for_team(team_id, query = nil)
14
+ list_for_team!(team_id, query)
15
15
  rescue SemaphoreClient::Exceptions::RequestFailed
16
16
  end
17
17
 
@@ -25,13 +25,15 @@ class SemaphoreClient
25
25
  rescue SemaphoreClient::Exceptions::RequestFailed
26
26
  end
27
27
 
28
- def list_for_shared_config(shared_config_id)
29
- list_for_shared_config!(shared_config_id)
28
+ def list_for_shared_config(shared_config_id, query = nil)
29
+ list_for_shared_config!(shared_config_id, query)
30
30
  rescue SemaphoreClient::Exceptions::RequestFailed
31
31
  end
32
32
 
33
- def list_for_org!(org_id)
34
- response = @http_client.get([:orgs, org_id, :projects])
33
+ def list_for_org!(org_id, query = nil)
34
+ query_string = query.nil? ? nil : "?#{query}"
35
+
36
+ response = @http_client.get([:orgs, org_id, :projects, query_string].compact)
35
37
 
36
38
  assert_response_status(response, 200)
37
39
 
@@ -42,8 +44,10 @@ class SemaphoreClient
42
44
  end
43
45
  end
44
46
 
45
- def list_for_team!(team_id)
46
- response = @http_client.get([:teams, team_id, :projects])
47
+ def list_for_team!(team_id, query = nil)
48
+ query_string = query.nil? ? nil : "?#{query}"
49
+
50
+ response = @http_client.get([:teams, team_id, :projects, query_string].compact)
47
51
 
48
52
  assert_response_status(response, 200)
49
53
 
@@ -66,8 +70,10 @@ class SemaphoreClient
66
70
  assert_response_status(response, 204)
67
71
  end
68
72
 
69
- def list_for_shared_config!(shared_config_id)
70
- response = @http_client.get([:shared_configs, shared_config_id, :projects])
73
+ def list_for_shared_config!(shared_config_id, query = nil)
74
+ query_string = query.nil? ? nil : "?#{query}"
75
+
76
+ response = @http_client.get([:shared_configs, shared_config_id, :projects, query_string].compact)
71
77
 
72
78
  assert_response_status(response, 200)
73
79
 
@@ -5,8 +5,8 @@ class SemaphoreClient
5
5
  @http_client = http_client
6
6
  end
7
7
 
8
- def list_for_org(org_id)
9
- list_for_org!(org_id)
8
+ def list_for_org(org_id, query = nil)
9
+ list_for_org!(org_id, query)
10
10
  rescue SemaphoreClient::Exceptions::RequestFailed
11
11
  end
12
12
 
@@ -15,8 +15,8 @@ class SemaphoreClient
15
15
  rescue SemaphoreClient::Exceptions::RequestFailed
16
16
  end
17
17
 
18
- def list_for_team(team_id)
19
- list_for_team!(team_id)
18
+ def list_for_team(team_id, query = nil)
19
+ list_for_team!(team_id, query)
20
20
  rescue SemaphoreClient::Exceptions::RequestFailed
21
21
  end
22
22
 
@@ -30,8 +30,8 @@ class SemaphoreClient
30
30
  rescue SemaphoreClient::Exceptions::RequestFailed
31
31
  end
32
32
 
33
- def list_for_project(project_id)
34
- list_for_project!(project_id)
33
+ def list_for_project(project_id, query = nil)
34
+ list_for_project!(project_id, query)
35
35
  rescue SemaphoreClient::Exceptions::RequestFailed
36
36
  end
37
37
 
@@ -60,8 +60,10 @@ class SemaphoreClient
60
60
  rescue SemaphoreClient::Exceptions::RequestFailed
61
61
  end
62
62
 
63
- def list_for_org!(org_id)
64
- response = @http_client.get([:orgs, org_id, :shared_configs])
63
+ def list_for_org!(org_id, query = nil)
64
+ query_string = query.nil? ? nil : "?#{query}"
65
+
66
+ response = @http_client.get([:orgs, org_id, :shared_configs, query_string].compact)
65
67
 
66
68
  assert_response_status(response, 200)
67
69
 
@@ -82,8 +84,10 @@ class SemaphoreClient
82
84
  SemaphoreClient::Model::SharedConfig.load(content)
83
85
  end
84
86
 
85
- def list_for_team!(team_id)
86
- response = @http_client.get([:teams, team_id, :shared_configs])
87
+ def list_for_team!(team_id, query = nil)
88
+ query_string = query.nil? ? nil : "?#{query}"
89
+
90
+ response = @http_client.get([:teams, team_id, :shared_configs, query_string].compact)
87
91
 
88
92
  assert_response_status(response, 200)
89
93
 
@@ -106,8 +110,10 @@ class SemaphoreClient
106
110
  assert_response_status(response, 204)
107
111
  end
108
112
 
109
- def list_for_project!(project_id)
110
- response = @http_client.get([:projects, project_id, :shared_configs])
113
+ def list_for_project!(project_id, query = nil)
114
+ query_string = query.nil? ? nil : "?#{query}"
115
+
116
+ response = @http_client.get([:projects, project_id, :shared_configs, query_string].compact)
111
117
 
112
118
  assert_response_status(response, 200)
113
119
 
@@ -5,8 +5,8 @@ class SemaphoreClient
5
5
  @http_client = http_client
6
6
  end
7
7
 
8
- def list_for_org(org_id)
9
- list_for_org!(org_id)
8
+ def list_for_org(org_id, query = nil)
9
+ list_for_org!(org_id, query)
10
10
  rescue SemaphoreClient::Exceptions::RequestFailed
11
11
  end
12
12
 
@@ -30,18 +30,20 @@ class SemaphoreClient
30
30
  rescue SemaphoreClient::Exceptions::RequestFailed
31
31
  end
32
32
 
33
- def list_for_project(project_id)
34
- list_for_project!(project_id)
33
+ def list_for_project(project_id, query = nil)
34
+ list_for_project!(project_id, query)
35
35
  rescue SemaphoreClient::Exceptions::RequestFailed
36
36
  end
37
37
 
38
- def list_for_shared_config(shared_config_id)
39
- list_for_shared_config!(shared_config_id)
38
+ def list_for_shared_config(shared_config_id, query = nil)
39
+ list_for_shared_config!(shared_config_id, query)
40
40
  rescue SemaphoreClient::Exceptions::RequestFailed
41
41
  end
42
42
 
43
- def list_for_org!(org_id)
44
- response = @http_client.get([:orgs, org_id, :teams])
43
+ def list_for_org!(org_id, query = nil)
44
+ query_string = query.nil? ? nil : "?#{query}"
45
+
46
+ response = @http_client.get([:orgs, org_id, :teams, query_string].compact)
45
47
 
46
48
  assert_response_status(response, 200)
47
49
 
@@ -88,8 +90,10 @@ class SemaphoreClient
88
90
  SemaphoreClient::Model::Team.load(content)
89
91
  end
90
92
 
91
- def list_for_project!(project_id)
92
- response = @http_client.get([:projects, project_id, :teams])
93
+ def list_for_project!(project_id, query = nil)
94
+ query_string = query.nil? ? nil : "?#{query}"
95
+
96
+ response = @http_client.get([:projects, project_id, :teams, query_string].compact)
93
97
 
94
98
  assert_response_status(response, 200)
95
99
 
@@ -100,8 +104,10 @@ class SemaphoreClient
100
104
  end
101
105
  end
102
106
 
103
- def list_for_shared_config!(shared_config_id)
104
- response = @http_client.get([:shared_configs, shared_config_id, :teams])
107
+ def list_for_shared_config!(shared_config_id, query = nil)
108
+ query_string = query.nil? ? nil : "?#{query}"
109
+
110
+ response = @http_client.get([:shared_configs, shared_config_id, :teams, query_string].compact)
105
111
 
106
112
  assert_response_status(response, 200)
107
113
 
@@ -5,13 +5,13 @@ class SemaphoreClient
5
5
  @http_client = http_client
6
6
  end
7
7
 
8
- def list_for_org(org_id)
9
- list_for_org!(org_id)
8
+ def list_for_org(org_id, query = nil)
9
+ list_for_org!(org_id, query)
10
10
  rescue SemaphoreClient::Exceptions::RequestFailed
11
11
  end
12
12
 
13
- def list_for_team(team_id)
14
- list_for_team!(team_id)
13
+ def list_for_team(team_id, query = nil)
14
+ list_for_team!(team_id, query)
15
15
  rescue SemaphoreClient::Exceptions::RequestFailed
16
16
  end
17
17
 
@@ -25,13 +25,15 @@ class SemaphoreClient
25
25
  rescue SemaphoreClient::Exceptions::RequestFailed
26
26
  end
27
27
 
28
- def list_for_project(project_id)
29
- list_for_project!(project_id)
28
+ def list_for_project(project_id, query = nil)
29
+ list_for_project!(project_id, query)
30
30
  rescue SemaphoreClient::Exceptions::RequestFailed
31
31
  end
32
32
 
33
- def list_for_org!(org_id)
34
- response = @http_client.get([:orgs, org_id, :users])
33
+ def list_for_org!(org_id, query = nil)
34
+ query_string = query.nil? ? nil : "?#{query}"
35
+
36
+ response = @http_client.get([:orgs, org_id, :users, query_string].compact)
35
37
 
36
38
  assert_response_status(response, 200)
37
39
 
@@ -42,8 +44,10 @@ class SemaphoreClient
42
44
  end
43
45
  end
44
46
 
45
- def list_for_team!(team_id)
46
- response = @http_client.get([:teams, team_id, :users])
47
+ def list_for_team!(team_id, query = nil)
48
+ query_string = query.nil? ? nil : "?#{query}"
49
+
50
+ response = @http_client.get([:teams, team_id, :users, query_string].compact)
47
51
 
48
52
  assert_response_status(response, 200)
49
53
 
@@ -66,8 +70,10 @@ class SemaphoreClient
66
70
  assert_response_status(response, 204)
67
71
  end
68
72
 
69
- def list_for_project!(project_id)
70
- response = @http_client.get([:projects, project_id, :users])
73
+ def list_for_project!(project_id, query = nil)
74
+ query_string = query.nil? ? nil : "?#{query}"
75
+
76
+ response = @http_client.get([:projects, project_id, :users, query_string].compact)
71
77
 
72
78
  assert_response_status(response, 200)
73
79
 
@@ -1,3 +1,3 @@
1
1
  class SemaphoreClient
2
- VERSION = "2.1.1"
2
+ VERSION = "2.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semaphore_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jovan Ivanović
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-22 00:00:00.000000000 Z
11
+ date: 2017-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday