bbc-cosmos-tools 0.2.1 → 0.2.2
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 +4 -4
- data/lib/bbc/cosmos/tools/commands/config.rb +24 -0
- data/lib/bbc/cosmos/tools/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59538d598247e83a071f993c73be0891c2c9923e
|
4
|
+
data.tar.gz: 48824b646fd1d938fdc83e69d323b3be2cb89c5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efa0c81aebed8d38e5937c36c7c00b029c25ec87663e0c9961621580aef1ea4435274366b74a8a206f74bd79f8a77c23bfdbbaf4b83f93efa88dadd18c40d405
|
7
|
+
data.tar.gz: 1dd9ab89324643e752c5b1bbe89176967d9c8fffcf21f81a04c65e9ecdec5609c03f0c6e8bca4a6d12156aa44a58c95ffc256a10d092549ad0e1f63349c26e19
|
@@ -17,8 +17,23 @@ module BBC
|
|
17
17
|
end
|
18
18
|
|
19
19
|
desc "config generate [COMPONENT]", "Generates config for the given component optionally in the cosmos format"
|
20
|
+
method_option :output, :type => :string, :desc => "Output type", :default => "normal"
|
21
|
+
method_option :write, :type => :boolean, :desc => "write output to file", :default => false
|
20
22
|
method_option :cosmos_format, :type => :boolean, :desc => "Toogles if the output should be in the cosmos format"
|
21
23
|
def generate(component)
|
24
|
+
if options[:write]
|
25
|
+
File.open("#{component}.json", 'w') do |f|
|
26
|
+
f.write(JSON.pretty_generate(cosmos_config.component(component)))
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
|
31
|
+
if options[:output] == "machine"
|
32
|
+
say JSON.pretty_generate(cosmos_config.cosmos_component(component)), :white
|
33
|
+
|
34
|
+
exit 0
|
35
|
+
end
|
36
|
+
|
22
37
|
begin
|
23
38
|
|
24
39
|
say "#{banner(component)}\n"
|
@@ -35,7 +50,16 @@ module BBC
|
|
35
50
|
end
|
36
51
|
|
37
52
|
desc "config list", "Lists all components for a given project"
|
53
|
+
method_option :output, :type => :string, :desc => "Output type", :default => "normal"
|
38
54
|
def list
|
55
|
+
if options[:output] == "machine"
|
56
|
+
cosmos_config.component_keys.each do |component_id|
|
57
|
+
puts "#{component_id}"
|
58
|
+
end
|
59
|
+
|
60
|
+
exit 0
|
61
|
+
end
|
62
|
+
|
39
63
|
begin
|
40
64
|
|
41
65
|
say banner
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bbc-cosmos-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Jack
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|