labclient 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8a76c9e9a1408f2c357f82a955359b36b16341f2c83cdd4d3224a90fea884acf
4
- data.tar.gz: 8348d2cf615d5b3911ce71f77f71830ba5020015a02d43e4bac6c572105131be
3
+ metadata.gz: a4c0988633436f9872d93e241ceb4c85e5b780b5f419a08054231138d8448dc5
4
+ data.tar.gz: '06268afb4c985bd5dbffebf72c610aa0c4fe1083af0b86d30d5624a69e25f52e'
5
5
  SHA512:
6
- metadata.gz: 1072af5523d2a6773e329d6674a35f3122eadc488b0961b90b38e9c7b79b5f6cfe516909b16a54f3ad39e227c0a920462cc2b0353b9bd95dbd1e4ce216c8b15b
7
- data.tar.gz: e4917da6a4d9d202604fc11b54d6d36f0ec675b2faef38ebbcf9529d9cfb56d883d64508b538dcf3cfb7d8c0c82434ad33fc5a7d3570a2bc7ecc961e64946191
6
+ metadata.gz: c558d37e33b7efdad2b9e0621c3a0d437e2345cc987403af2c15bed6e1d0a04c926de86442e1595a7fbfb6b0aae63af8583430f4046782edea2362a0ebf946f7
7
+ data.tar.gz: 211e88abab828ddc51c7b6a8965a962ec34f95fb4f7e3106611f3af5b5d72e6c75431c3eabedb618a838f29b3b64e4301ed173d38120c9ef4bb0e5b0d45a8e69
@@ -6,6 +6,10 @@ module LabClient
6
6
  client.commits.list(id, query)
7
7
  end
8
8
 
9
+ def commit(commit_id, query = {})
10
+ client.commits.show(id, commit_id, query)
11
+ end
12
+
9
13
  def commit_create(query = {})
10
14
  client.commits.create(id, query)
11
15
  end
@@ -16,10 +16,19 @@ module LabClient
16
16
  DOC
17
17
  end
18
18
 
19
+ doc 'Show' do
20
+ desc 'Via Project'
21
+ example <<~DOC
22
+ project = client.projects.show(16)
23
+ project.commit("b539e5d3")
24
+ DOC
25
+ end
26
+
19
27
  # Show
20
- def show(project_id, commit_id)
28
+ def show(project_id, commit_id, query = {})
21
29
  project_id = format_id(project_id)
22
- client.request(:get, "projects/#{project_id}/repository/commits/#{commit_id}", Commit)
30
+
31
+ client.request(:get, "projects/#{project_id}/repository/commits/#{commit_id}", Commit, query)
23
32
  end
24
33
  end
25
34
  end
@@ -33,7 +33,7 @@ module LabClient
33
33
  desc 'via Project'
34
34
  example <<~DOC
35
35
  project = client.projects.show(264)
36
- project.file_create('other.md',
36
+ project.file_update('other.md',
37
37
  branch: :master,
38
38
  commit_message: "New File!",
39
39
  content: "Content!")
@@ -13,5 +13,9 @@ module LabClient
13
13
  def as_json(*args)
14
14
  super.as_json['table']
15
15
  end
16
+
17
+ def slice(*opts)
18
+ to_h.slice(*opts)
19
+ end
16
20
  end
17
21
  end
@@ -230,6 +230,7 @@ module LabClient
230
230
  User
231
231
  - client.users.show(5)
232
232
  - client.users.show(5)
233
+
233
234
  DOC
234
235
  end
235
236
 
@@ -248,6 +249,9 @@ module LabClient
248
249
  # Awesome Print all details
249
250
  project.valid_group_project_levels
250
251
  # => [:guest, :reporter, :developer, :maintainer, :owner]
252
+
253
+ # Select Data from objects with `slice`
254
+ project.slice(:readme_url, :owner)
251
255
  DOC
252
256
  end
253
257
 
@@ -24,6 +24,14 @@ module LabClient
24
24
  client.projects.environments.delete(project_id, id)
25
25
  end
26
26
 
27
+ def show
28
+ project_id = collect_project_id
29
+
30
+ update_self client.projects.environments.show(project_id, id)
31
+ end
32
+
33
+ alias reload show
34
+
27
35
  def stop
28
36
  project_id = collect_project_id
29
37
 
@@ -35,6 +43,8 @@ module LabClient
35
43
  help do
36
44
  subtitle 'ProjectEnvironment'
37
45
  option 'project', 'Show Project'
46
+ option 'show', 'Collect/reload environment'
47
+ option 'reload', 'Collect/reload environment'
38
48
  option 'update', 'Update this environment [Hash]'
39
49
  option 'delete', 'Delete this environment'
40
50
  option 'stop', 'Stop this environment'
@@ -476,6 +476,8 @@ module LabClient
476
476
  client.projects.environments.show(id, environment_id)
477
477
  end
478
478
 
479
+ alias environment environment_show
480
+
479
481
  def environment_create(query)
480
482
  client.projects.environments.create(id, query)
481
483
  end
@@ -139,6 +139,7 @@ module LabClient
139
139
 
140
140
  # Commits
141
141
  option 'commits', 'List Commits [Hash]'
142
+ option 'commit', 'Show Commit [String/Commit Sha]'
142
143
  option 'commit_create', 'Create new commit [Hash]'
143
144
  option 'commit_refs', 'Get all references (from branches or tags) a commit is pushed to. [Commit ID, Scope]'
144
145
  option 'commit_cherry_pick', 'Cherry picks a commit to a target branch. [Commit ID, Branch]'
@@ -1,3 +1,3 @@
1
1
  module LabClient
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.2.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: labclient
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Davin Walker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-20 00:00:00.000000000 Z
11
+ date: 2020-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport