yadecli 0.1.3 → 0.1.4

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.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/.DS_Store +0 -0
  3. data/.gitignore +2 -3
  4. data/Gemfile +5 -0
  5. data/Gemfile.lock +44 -2
  6. data/lib/yadecli/cli/application.rb +19 -4
  7. data/lib/yadecli/cli/composer.rb +70 -14
  8. data/lib/yadecli/cli/host.rb +19 -5
  9. data/lib/yadecli/cli/module.rb +14 -3
  10. data/lib/yadecli/cli/project.rb +30 -8
  11. data/lib/yadecli/cli/response/project_start_response.rb +21 -0
  12. data/lib/yadecli/cli/task.rb +9 -5
  13. data/lib/yadecli/client/gitlab_client.rb +4 -6
  14. data/lib/yadecli/command/composer/composer_install_command.rb +166 -0
  15. data/lib/yadecli/command/composer/composer_list_command.rb +63 -0
  16. data/lib/yadecli/command/composer/composer_log_command.rb +53 -0
  17. data/lib/yadecli/command/composer/composer_setup_command.rb +28 -0
  18. data/lib/yadecli/command/composer/composer_start_command.rb +70 -0
  19. data/lib/yadecli/command/composer/composer_stop_command.rb +60 -0
  20. data/lib/yadecli/command/composer/composer_switch_command.rb +51 -0
  21. data/lib/yadecli/command/composer/composer_uninstall_command.rb +44 -0
  22. data/lib/yadecli/command/connect_command.rb +29 -0
  23. data/lib/yadecli/command/host/host_bootstrap_command.rb +132 -0
  24. data/lib/yadecli/command/host/host_list_command.rb +36 -0
  25. data/lib/yadecli/command/host/host_provision_command.rb +59 -0
  26. data/lib/yadecli/command/login_command.rb +26 -0
  27. data/lib/yadecli/command/module/module_install_command.rb +79 -0
  28. data/lib/yadecli/command/module/module_list_command.rb +47 -0
  29. data/lib/yadecli/command/project/project_install_command.rb +58 -0
  30. data/lib/yadecli/command/project/project_list_command.rb +50 -0
  31. data/lib/yadecli/command/project/project_setup_command.rb +66 -0
  32. data/lib/yadecli/command/project/project_start_command.rb +110 -0
  33. data/lib/yadecli/command/project/project_uninstall_command.rb +44 -0
  34. data/lib/yadecli/command/task/task_list_command.rb +56 -0
  35. data/lib/yadecli/io/user_input.rb +1 -1
  36. data/lib/yadecli/util/cli_util.rb +11 -1
  37. data/lib/yadecli/util/maven_util.rb +35 -0
  38. data/lib/yadecli/version.rb +1 -1
  39. data/lib/yadecli.rb +38 -41
  40. data/scripts/setup-terminal.sh +1 -1
  41. data/yadecli.gemspec +6 -2
  42. metadata +81 -46
  43. data/lib/.DS_Store +0 -0
  44. data/lib/yadecli/.DS_Store +0 -0
  45. data/lib/yadecli/client/authentication_client.rb +0 -24
  46. data/lib/yadecli/client/base_client.rb +0 -78
  47. data/lib/yadecli/client/composer_container_client.rb +0 -27
  48. data/lib/yadecli/client/composer_project_client.rb +0 -27
  49. data/lib/yadecli/client/composer_service_client.rb +0 -27
  50. data/lib/yadecli/client/domain_client.rb +0 -23
  51. data/lib/yadecli/client/host_client.rb +0 -45
  52. data/lib/yadecli/client/maven_build_step_client.rb +0 -23
  53. data/lib/yadecli/client/maven_build_task_client.rb +0 -23
  54. data/lib/yadecli/client/nvm_runtime_client.rb +0 -23
  55. data/lib/yadecli/client/project_client.rb +0 -28
  56. data/lib/yadecli/client/project_module_client.rb +0 -35
  57. data/lib/yadecli/client/pyenv_runtime_client.rb +0 -23
  58. data/lib/yadecli/client/role_client.rb +0 -23
  59. data/lib/yadecli/client/rvm_runtime_client.rb +0 -23
  60. data/lib/yadecli/client/sdk_package_client.rb +0 -28
  61. data/lib/yadecli/client/vcs_client.rb +0 -23
  62. data/lib/yadecli/config/app_config.rb +0 -70
  63. data/lib/yadecli/model/composer_container.rb +0 -19
  64. data/lib/yadecli/model/composer_project.rb +0 -37
  65. data/lib/yadecli/model/composer_service.rb +0 -19
  66. data/lib/yadecli/model/domain.rb +0 -24
  67. data/lib/yadecli/model/host.rb +0 -24
  68. data/lib/yadecli/model/ide_type.rb +0 -7
  69. data/lib/yadecli/model/maven_build_step.rb +0 -19
  70. data/lib/yadecli/model/maven_build_task.rb +0 -19
  71. data/lib/yadecli/model/nvm_runtime.rb +0 -18
  72. data/lib/yadecli/model/project.rb +0 -26
  73. data/lib/yadecli/model/project_module.rb +0 -29
  74. data/lib/yadecli/model/pyenv_runtime.rb +0 -18
  75. data/lib/yadecli/model/role.rb +0 -24
  76. data/lib/yadecli/model/rvm_runtime.rb +0 -18
  77. data/lib/yadecli/model/sdk_package.rb +0 -18
  78. data/lib/yadecli/model/vcs.rb +0 -19
  79. data/lib/yadecli/service/authentication_service.rb +0 -31
  80. data/lib/yadecli/service/build_step_service.rb +0 -24
  81. data/lib/yadecli/service/build_task_service.rb +0 -70
  82. data/lib/yadecli/service/composer_service.rb +0 -416
  83. data/lib/yadecli/service/connect_service.rb +0 -19
  84. data/lib/yadecli/service/host_service.rb +0 -191
  85. data/lib/yadecli/service/module_service.rb +0 -78
  86. data/lib/yadecli/service/project_service.rb +0 -205
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- cd $1
3
+ cd $1
data/yadecli.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
19
19
  # to allow pushing to a single host or delete this section to allow pushing to any host.
20
20
  # if spec.respond_to?(:metadata)
21
- # spec.metadata['allowed_push_host'] = 'TODO: Set to \'http://mygemserver.com\''
21
+ # spec.metadata['allowed_push_host'] = 'TODO: Set to 'http://mygemserver.com'
22
22
  # else
23
23
  # raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
24
24
  # end
@@ -32,6 +32,10 @@ Gem::Specification.new do |spec|
32
32
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
33
33
  spec.require_paths = ['lib', 'scripts']
34
34
 
35
+ spec.add_dependency 'yade-domain-rest-client', '~> 0.1'
36
+ spec.add_dependency 'yade-project-rest-client', '~> 0.1'
37
+ spec.add_dependency 'yade-composer-rest-client', '~> 0.1'
38
+
35
39
  spec.add_dependency 'activemodel', '~> 5.2'
36
40
  spec.add_dependency 'artii', '~> 2.1'
37
41
  spec.add_dependency 'colorize', '~> 0.8'
@@ -45,6 +49,7 @@ Gem::Specification.new do |spec|
45
49
  spec.add_dependency 'tty-command', '~> 0.8'
46
50
  spec.add_dependency 'tty-prompt', '~> 0.16'
47
51
  spec.add_dependency 'tty-table', '~> 0.10'
52
+ spec.add_dependency 'mutations', '~> 0.8'
48
53
 
49
54
  spec.add_development_dependency 'aruba', '~> 0.14'
50
55
  spec.add_development_dependency 'bundler', '~> 1.16'
@@ -52,5 +57,4 @@ Gem::Specification.new do |spec|
52
57
  spec.add_development_dependency 'rspec', '~> 3.0'
53
58
  spec.add_development_dependency 'rspec-json_expectations', '~> 2.1'
54
59
  spec.add_development_dependency 'rubocop', '~> 0.58.0'
55
-
56
60
  end
metadata CHANGED
@@ -1,15 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yadecli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Freund
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-05 00:00:00.000000000 Z
11
+ date: 2018-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: yade-domain-rest-client
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: yade-project-rest-client
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: yade-composer-rest-client
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.1'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.1'
13
55
  - !ruby/object:Gem::Dependency
14
56
  name: activemodel
15
57
  requirement: !ruby/object:Gem::Requirement
@@ -192,6 +234,20 @@ dependencies:
192
234
  - - "~>"
193
235
  - !ruby/object:Gem::Version
194
236
  version: '0.10'
237
+ - !ruby/object:Gem::Dependency
238
+ name: mutations
239
+ requirement: !ruby/object:Gem::Requirement
240
+ requirements:
241
+ - - "~>"
242
+ - !ruby/object:Gem::Version
243
+ version: '0.8'
244
+ type: :runtime
245
+ prerelease: false
246
+ version_requirements: !ruby/object:Gem::Requirement
247
+ requirements:
248
+ - - "~>"
249
+ - !ruby/object:Gem::Version
250
+ version: '0.8'
195
251
  - !ruby/object:Gem::Dependency
196
252
  name: aruba
197
253
  requirement: !ruby/object:Gem::Requirement
@@ -296,63 +352,42 @@ files:
296
352
  - Rakefile
297
353
  - bin/yadecli
298
354
  - config-example.yml
299
- - lib/.DS_Store
300
355
  - lib/yadecli.rb
301
- - lib/yadecli/.DS_Store
302
356
  - lib/yadecli/cli/application.rb
303
357
  - lib/yadecli/cli/composer.rb
304
358
  - lib/yadecli/cli/host.rb
305
359
  - lib/yadecli/cli/module.rb
306
360
  - lib/yadecli/cli/project.rb
361
+ - lib/yadecli/cli/response/project_start_response.rb
307
362
  - lib/yadecli/cli/task.rb
308
- - lib/yadecli/client/authentication_client.rb
309
- - lib/yadecli/client/base_client.rb
310
- - lib/yadecli/client/composer_container_client.rb
311
- - lib/yadecli/client/composer_project_client.rb
312
- - lib/yadecli/client/composer_service_client.rb
313
- - lib/yadecli/client/domain_client.rb
314
363
  - lib/yadecli/client/gitlab_client.rb
315
- - lib/yadecli/client/host_client.rb
316
- - lib/yadecli/client/maven_build_step_client.rb
317
- - lib/yadecli/client/maven_build_task_client.rb
318
- - lib/yadecli/client/nvm_runtime_client.rb
319
- - lib/yadecli/client/project_client.rb
320
- - lib/yadecli/client/project_module_client.rb
321
- - lib/yadecli/client/pyenv_runtime_client.rb
322
- - lib/yadecli/client/role_client.rb
323
- - lib/yadecli/client/rvm_runtime_client.rb
324
- - lib/yadecli/client/sdk_package_client.rb
325
- - lib/yadecli/client/vcs_client.rb
326
- - lib/yadecli/config/app_config.rb
364
+ - lib/yadecli/command/composer/composer_install_command.rb
365
+ - lib/yadecli/command/composer/composer_list_command.rb
366
+ - lib/yadecli/command/composer/composer_log_command.rb
367
+ - lib/yadecli/command/composer/composer_setup_command.rb
368
+ - lib/yadecli/command/composer/composer_start_command.rb
369
+ - lib/yadecli/command/composer/composer_stop_command.rb
370
+ - lib/yadecli/command/composer/composer_switch_command.rb
371
+ - lib/yadecli/command/composer/composer_uninstall_command.rb
372
+ - lib/yadecli/command/connect_command.rb
373
+ - lib/yadecli/command/host/host_bootstrap_command.rb
374
+ - lib/yadecli/command/host/host_list_command.rb
375
+ - lib/yadecli/command/host/host_provision_command.rb
376
+ - lib/yadecli/command/login_command.rb
377
+ - lib/yadecli/command/module/module_install_command.rb
378
+ - lib/yadecli/command/module/module_list_command.rb
379
+ - lib/yadecli/command/project/project_install_command.rb
380
+ - lib/yadecli/command/project/project_list_command.rb
381
+ - lib/yadecli/command/project/project_setup_command.rb
382
+ - lib/yadecli/command/project/project_start_command.rb
383
+ - lib/yadecli/command/project/project_uninstall_command.rb
384
+ - lib/yadecli/command/task/task_list_command.rb
327
385
  - lib/yadecli/io/user_input.rb
328
- - lib/yadecli/model/composer_container.rb
329
- - lib/yadecli/model/composer_project.rb
330
- - lib/yadecli/model/composer_service.rb
331
- - lib/yadecli/model/domain.rb
332
386
  - lib/yadecli/model/git_status.rb
333
- - lib/yadecli/model/host.rb
334
- - lib/yadecli/model/ide_type.rb
335
387
  - lib/yadecli/model/installation_status.rb
336
- - lib/yadecli/model/maven_build_step.rb
337
- - lib/yadecli/model/maven_build_task.rb
338
- - lib/yadecli/model/nvm_runtime.rb
339
- - lib/yadecli/model/project.rb
340
- - lib/yadecli/model/project_module.rb
341
- - lib/yadecli/model/pyenv_runtime.rb
342
- - lib/yadecli/model/role.rb
343
- - lib/yadecli/model/rvm_runtime.rb
344
- - lib/yadecli/model/sdk_package.rb
345
- - lib/yadecli/model/vcs.rb
346
- - lib/yadecli/service/authentication_service.rb
347
- - lib/yadecli/service/build_step_service.rb
348
- - lib/yadecli/service/build_task_service.rb
349
- - lib/yadecli/service/composer_service.rb
350
- - lib/yadecli/service/connect_service.rb
351
- - lib/yadecli/service/host_service.rb
352
- - lib/yadecli/service/module_service.rb
353
- - lib/yadecli/service/project_service.rb
354
388
  - lib/yadecli/util/cli_util.rb
355
389
  - lib/yadecli/util/file_util.rb
390
+ - lib/yadecli/util/maven_util.rb
356
391
  - lib/yadecli/util/nvm_util.rb
357
392
  - lib/yadecli/util/pyenv_util.rb
358
393
  - lib/yadecli/util/rvm_util.rb
data/lib/.DS_Store DELETED
Binary file
Binary file
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'httparty'
4
-
5
- # yadecli cli
6
- module Yadecli
7
- module Client
8
-
9
- # authentication client
10
- class AuthenticationClient
11
- include HTTParty
12
-
13
- # request yade token
14
- def request_token(auth_url, username, password)
15
-
16
- options = { headers: { Accept: 'application/json', Authorization: 'Basic d2ViX2FwcDpjaGFuZ2VpdA==' } }
17
-
18
- self.class.base_uri auth_url
19
-
20
- self.class.post("/oauth/token?username=#{username}&password=#{password}&grant_type=password", options)
21
- end
22
- end
23
- end
24
- end
@@ -1,78 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # yadecli cli
4
- module Yadecli
5
- module Client
6
-
7
- # base client
8
- class BaseClient
9
-
10
- # initialize
11
- # prepare options hash with authorization header for httpparty requests
12
- def initialize(microservice, resource_name)
13
- @microservice = microservice
14
- @resource_name = resource_name
15
-
16
- expiration_time = Time.parse(AppConfig['expiration_time'].to_s)
17
-
18
- access_token = AppConfig['access_token']
19
-
20
- if Time.now > expiration_time
21
- @authentication_client = Yadecli::Client::AuthenticationClient.new
22
-
23
- response = @authentication_client.request_token AppConfig['auth_url'], AppConfig['username'], AppConfig['password']
24
-
25
- AppConfig['access_token'] = response['access_token']
26
- AppConfig['refresh_token'] = response['refresh_token']
27
- AppConfig['expiration_time'] = Time.now + response['expires_in']
28
-
29
- AppConfig.write!
30
-
31
- access_token = response['access_token']
32
- end
33
-
34
- @options = { headers: { Authorization: "Bearer #{access_token}", 'Content-Type' => 'application/json' } }
35
- end
36
-
37
- # list all
38
- def list
39
- response = self.class.get(base_path, @options)
40
-
41
- response.parsed_response.map do |p|
42
- create_instance.new(p)
43
- end
44
- end
45
-
46
- # get by id
47
- def get(id)
48
- response = get_request("#{id}")
49
-
50
- create_instance.new(response.parsed_response)
51
- end
52
-
53
- def base_path
54
- if @resource_name.end_with? 's'
55
- "/#{@microservice}/api/#{@resource_name}"
56
- else
57
- "/#{@microservice}/api/#{@resource_name}s"
58
- end
59
- end
60
-
61
- def get_request(path = nil)
62
- full_path = base_path
63
-
64
- full_path += "/#{path}" if path != nil
65
-
66
- self.class.get(full_path, @options)
67
- end
68
-
69
- private
70
-
71
- def create_instance
72
- class_name = @resource_name.split('-').map!(&:capitalize).join
73
-
74
- Object.const_get(class_name)
75
- end
76
- end
77
- end
78
- end
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'httparty'
4
- require 'logger'
5
- require 'yadecli/client/base_client'
6
-
7
- # yadecli cli
8
- module Yadecli
9
- module Client
10
-
11
- # project client
12
- class ComposerContainerClient < BaseClient
13
- include HTTParty
14
- #logger ::Logger.new(STDOUT), :debug
15
-
16
- base_uri AppConfig[:url]
17
-
18
- def initialize
19
- super('yadecomposer', 'composer-container')
20
- end
21
-
22
- def get_by_composer_service_id(composer_service_id)
23
- list.select { |composer_container| composer_container.composerServiceId == composer_service_id }
24
- end
25
- end
26
- end
27
- end
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'httparty'
4
- require 'logger'
5
- require 'yadecli/client/base_client'
6
-
7
- # yadecli cli
8
- module Yadecli
9
- module Client
10
-
11
- # project client
12
- class ComposerProjectClient < BaseClient
13
- include HTTParty
14
- #logger ::Logger.new(STDOUT), :debug
15
-
16
- base_uri AppConfig[:url]
17
-
18
- def initialize
19
- super('yadecomposer', 'composer-project')
20
- end
21
-
22
- def get_by_name(name)
23
- list.select { |composer_project| composer_project.name == name }.first
24
- end
25
- end
26
- end
27
- end
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'httparty'
4
- require 'logger'
5
- require 'yadecli/client/base_client'
6
-
7
- # yadecli cli
8
- module Yadecli
9
- module Client
10
-
11
- # project client
12
- class ComposerServiceClient < BaseClient
13
- include HTTParty
14
- #logger ::Logger.new(STDOUT), :debug
15
-
16
- base_uri AppConfig[:url]
17
-
18
- def initialize
19
- super('yadecomposer', 'composer-service')
20
- end
21
-
22
- def get_by_composer_project_id(composer_project_id)
23
- list.select { |composer_service| composer_service.composerProjectId == composer_project_id }
24
- end
25
- end
26
- end
27
- end
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'httparty'
4
- require 'logger'
5
- require 'yadecli/client/base_client'
6
-
7
- # yadecli cli
8
- module Yadecli
9
- module Client
10
-
11
- # domain client
12
- class DomainClient < BaseClient
13
- include HTTParty
14
- #logger ::Logger.new(STDOUT), :debug
15
-
16
- base_uri AppConfig[:url]
17
-
18
- def initialize
19
- super('yadedomain', 'domain')
20
- end
21
- end
22
- end
23
- end
@@ -1,45 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'httparty'
4
- require 'logger'
5
- require 'yadecli/client/base_client'
6
-
7
- # yadecli cli
8
- module Yadecli
9
- module Client
10
-
11
- # host client
12
- class HostClient < BaseClient
13
- include HTTParty
14
- #logger ::Logger.new(STDOUT), :debug
15
-
16
- base_uri AppConfig[:url]
17
-
18
- def initialize
19
- super('yadedomain', 'host')
20
- end
21
-
22
- # get master host
23
- def master
24
- list.select(&:isMaster).first
25
- end
26
-
27
- # get host by fqdn
28
- def host_by_fqdn(host_fqdn)
29
- splitted = host_fqdn.split('.')
30
-
31
- hostname = splitted.first
32
- fqdn = splitted.last(splitted.size - 1).join('.')
33
-
34
- all_hosts_with_name = list.select { |h| h.name == hostname }
35
-
36
- domain_client = Yadecli::Client::DomainClient.new
37
-
38
- all_hosts_with_name.each do |h|
39
- domain = domain_client.get(h.domainId)
40
- return h if domain.name == fqdn
41
- end
42
- end
43
- end
44
- end
45
- end
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'httparty'
4
- require 'logger'
5
- require 'yadecli/client/base_client'
6
-
7
- # yadecli cli
8
- module Yadecli
9
- module Client
10
-
11
- # maven build step client
12
- class MavenBuildStepClient < BaseClient
13
- include HTTParty
14
- #logger ::Logger.new(STDOUT), :debug
15
-
16
- base_uri AppConfig[:url]
17
-
18
- def initialize
19
- super('yadeproject', 'maven-build-step')
20
- end
21
- end
22
- end
23
- end
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'httparty'
4
- require 'logger'
5
- require 'yadecli/client/base_client'
6
-
7
- # yadecli cli
8
- module Yadecli
9
- module Client
10
-
11
- # maven build task client
12
- class MavenBuildTaskClient < BaseClient
13
- include HTTParty
14
- #logger ::Logger.new(STDOUT), :debug
15
-
16
- base_uri AppConfig[:url]
17
-
18
- def initialize
19
- super('yadeproject', 'maven-build-task')
20
- end
21
- end
22
- end
23
- end
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'httparty'
4
- require 'logger'
5
- require 'yadecli/client/base_client'
6
-
7
- # yadecli cli
8
- module Yadecli
9
- module Client
10
-
11
- # rvm runtime client
12
- class NvmRuntimeClient < BaseClient
13
- include HTTParty
14
- #logger ::Logger.new(STDOUT), :debug
15
-
16
- base_uri AppConfig[:url]
17
-
18
- def initialize
19
- super('yadeproject', 'nvm-runtime')
20
- end
21
- end
22
- end
23
- end
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'httparty'
4
- require 'logger'
5
- require 'yadecli/client/base_client'
6
-
7
- # yadecli cli
8
- module Yadecli
9
- module Client
10
-
11
- # project client
12
- class ProjectClient < BaseClient
13
- include HTTParty
14
- #logger ::Logger.new(STDOUT), :debug
15
-
16
- base_uri AppConfig[:url]
17
-
18
- def initialize
19
- super('yadeproject', 'project')
20
- end
21
-
22
- # get project by name
23
- def project_by_name(project_name)
24
- list.select { |p| p.name == project_name }.first
25
- end
26
- end
27
- end
28
- end
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'httparty'
4
- require 'logger'
5
- require 'yadecli/client/base_client'
6
-
7
- # yadecli cli
8
- module Yadecli
9
- module Client
10
-
11
- # authentication client
12
- class ProjectModuleClient < BaseClient
13
- include HTTParty
14
- #logger ::Logger.new(STDOUT), :info
15
-
16
- base_uri AppConfig[:url]
17
-
18
- def initialize
19
- super('yadeproject', 'project-module')
20
- end
21
-
22
- # get modules for project with id
23
- def modules_for_project(project_id)
24
- list.select { |m| m.projectId == project_id }
25
- end
26
-
27
- # get module by name from project with id
28
- def module_for_project(project_id, module_name)
29
- modules = modules_for_project(project_id)
30
-
31
- modules.select { |m| m.name == module_name }.first
32
- end
33
- end
34
- end
35
- end
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'httparty'
4
- require 'logger'
5
- require 'yadecli/client/base_client'
6
-
7
- # yadecli cli
8
- module Yadecli
9
- module Client
10
-
11
- # pyenv runtime client
12
- class PyenvRuntimeClient < BaseClient
13
- include HTTParty
14
- #logger ::Logger.new(STDOUT), :debug
15
-
16
- base_uri AppConfig[:url]
17
-
18
- def initialize
19
- super('yadeproject', 'pyenv-runtime')
20
- end
21
- end
22
- end
23
- end
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'httparty'
4
- require 'logger'
5
- require 'yadecli/client/base_client'
6
-
7
- # yadecli cli
8
- module Yadecli
9
- module Client
10
-
11
- # role client
12
- class RoleClient < BaseClient
13
- include HTTParty
14
- #logger ::Logger.new(STDOUT), :debug
15
-
16
- base_uri AppConfig[:url]
17
-
18
- def initialize
19
- super('yadedomain', 'role')
20
- end
21
- end
22
- end
23
- end
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'httparty'
4
- require 'logger'
5
- require 'yadecli/client/base_client'
6
-
7
- # yadecli cli
8
- module Yadecli
9
- module Client
10
-
11
- # rvm runtime client
12
- class RvmRuntimeClient < BaseClient
13
- include HTTParty
14
- #logger ::Logger.new(STDOUT), :debug
15
-
16
- base_uri AppConfig[:url]
17
-
18
- def initialize
19
- super('yadeproject', 'rvm-runtime')
20
- end
21
- end
22
- end
23
- end