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 +4 -4
- data/lib/sem/api/project.rb +17 -1
- data/lib/sem/cli/projects.rb +27 -0
- data/lib/sem/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f374ca6c11aac9c2a50d6dff6dcd8ffaad3e2b9a
|
4
|
+
data.tar.gz: 21e12844d0d01c57fd3ad5b3a26f278917807b9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f465e65b343ca78e114f0a637c5fcc3c969162315bd5208f9935d4c6d15ef0a0c97f4dbba613eb39ba6c939d2de3a28083a684b984f9d6b6d5f77da1ade55ad1
|
7
|
+
data.tar.gz: 1a0f08a57eca0688376462ac7b878a627870f4ddcfee8f4da0f72e15bc6d1495e83504f1fe6015cec695b437a44f46d0cc0dbf0e6b090f91d3dcaef4290964f9
|
data/lib/sem/api/project.rb
CHANGED
@@ -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 { |
|
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
|
data/lib/sem/cli/projects.rb
CHANGED
@@ -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
|
data/lib/sem/version.rb
CHANGED