sem 0.2.5 → 0.3.0

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: 06a7119f3c4f475331417ead5ac9aecb46e6d4b8
4
- data.tar.gz: a6d80860bf7b81fddf2125140246774f08deb3a1
3
+ metadata.gz: f374ca6c11aac9c2a50d6dff6dcd8ffaad3e2b9a
4
+ data.tar.gz: 21e12844d0d01c57fd3ad5b3a26f278917807b9b
5
5
  SHA512:
6
- metadata.gz: 99f9ffeb5a6e9e090a05ba5466591990738b79a397dbff7aac8c4cb4b33e3213f19f0dcca2c98cd3fbbcb074a1d39cc0c0e30344b1967cccfcbb282e6f564507
7
- data.tar.gz: f46156f76e3c19c17059aa366ac30c11557ddb64cad0d7ecef687710621427547527900bbc9fec259cf4ee9f5904b2d5635369dcacd3016b58c15e3c1ca512d8
6
+ metadata.gz: f465e65b343ca78e114f0a637c5fcc3c969162315bd5208f9935d4c6d15ef0a0c97f4dbba613eb39ba6c939d2de3a28083a684b984f9d6b6d5f77da1ade55ad1
7
+ data.tar.gz: 1a0f08a57eca0688376462ac7b878a627870f4ddcfee8f4da0f72e15bc6d1495e83504f1fe6015cec695b437a44f46d0cc0dbf0e6b090f91d3dcaef4290964f9
@@ -36,7 +36,7 @@ class Sem::API::Project < SimpleDelegator
36
36
  end
37
37
 
38
38
  def shared_configs
39
- Sem::API::Base.client.shared_configs.list_for_project(id).map { |project| Sem::API::SharedConfig.new(org_name, project) }
39
+ Sem::API::Base.client.shared_configs.list_for_project(id).map { |config| Sem::API::SharedConfig.new(org_name, config) }
40
40
  end
41
41
 
42
42
  def add_shared_config(shared_config)
@@ -47,4 +47,20 @@ class Sem::API::Project < SimpleDelegator
47
47
  Sem::API::Base.client.shared_configs.detach_from_project(shared_config.id, id)
48
48
  end
49
49
 
50
+ def config_files
51
+ Sem::API::Base.client.config_files.list_for_project(id).map { |file| Sem::API::File.new(file) }
52
+ end
53
+
54
+ def env_vars
55
+ Sem::API::Base.client.env_vars.list_for_project(id).map { |var| Sem::API::EnvVar.new(var) }
56
+ end
57
+
58
+ def add_env_var(env_var)
59
+ Sem::API::Base.client.env_vars.attach_to_project(env_var.id, id)
60
+ end
61
+
62
+ def add_config_file(config_file)
63
+ Sem::API::Base.client.config_files.attach_to_project(config_file.id, id)
64
+ end
65
+
50
66
  end
@@ -18,6 +18,28 @@ class Sem::CLI::Projects < Dracula
18
18
  Sem::Views::Projects.info(project)
19
19
  end
20
20
 
21
+ class Files < Dracula
22
+
23
+ desc "list", "list configuration files on project"
24
+ def list(project_name)
25
+ project = Sem::API::Project.find!(project_name)
26
+
27
+ Sem::Views::Files.list(project.config_files)
28
+ end
29
+
30
+ end
31
+
32
+ class EnvVars < Dracula
33
+
34
+ desc "list", "list environment variables on project"
35
+ def list(project_name)
36
+ project = Sem::API::Project.find!(project_name)
37
+
38
+ Sem::Views::EnvVars.list(project.env_vars)
39
+ end
40
+
41
+ end
42
+
21
43
  class SharedConfigs < Dracula
22
44
 
23
45
  desc "list", "list shared configurations on a project"
@@ -39,6 +61,9 @@ class Sem::CLI::Projects < Dracula
39
61
 
40
62
  project.add_shared_config(shared_config)
41
63
 
64
+ shared_config.env_vars.each { |var| project.add_env_var(var) }
65
+ shared_config.files.each { |file| project.add_config_file(file) }
66
+
42
67
  puts "Shared Configuration #{shared_config_name} added to the project."
43
68
  end
44
69
 
@@ -55,4 +80,6 @@ class Sem::CLI::Projects < Dracula
55
80
  end
56
81
 
57
82
  register "shared-configs", "manage shared configurations", SharedConfigs
83
+ register "files", "manage projects' config files", Files
84
+ register "env-vars", "manage projects' environment variables", EnvVars
58
85
  end
@@ -1,3 +1,3 @@
1
1
  module Sem
2
- VERSION = "0.2.5".freeze
2
+ VERSION = "0.3.0".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Šarčević