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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1de1cae7f04183d6596d4a9511330de6ae3d0ba8
4
- data.tar.gz: 0d2125b5c8e8d31f8233a860f2280baf8dcc4c95
3
+ metadata.gz: 59538d598247e83a071f993c73be0891c2c9923e
4
+ data.tar.gz: 48824b646fd1d938fdc83e69d323b3be2cb89c5b
5
5
  SHA512:
6
- metadata.gz: e755bae661d0f3be00f388b5ead9e73ec138b00d048357212313fab290035eb0e50e414e2b2593c456c869fab5095ab9e745e682a5ddc08ddb21603d9e1998ab
7
- data.tar.gz: a3e00edbd37e7c4909b7b2ef69a12f5c20bd2717af1f473c5e1a95dd734528d5ebacd9eb501b43296f93d522a141d0b51744f7cde2ef470a97c8660b4b9e2734
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
@@ -1,7 +1,7 @@
1
1
  module BBC
2
2
  module Cosmos
3
3
  module Tools
4
- VERSION = "0.2.1"
4
+ VERSION = "0.2.2"
5
5
  end
6
6
  end
7
7
  end
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.1
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-13 00:00:00.000000000 Z
11
+ date: 2014-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler