kumogata 0.2.9 → 0.2.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/kumogata.gemspec +1 -0
- data/lib/kumogata/client.rb +18 -7
- data/lib/kumogata/version.rb +1 -1
- data/lib/kumogata.rb +1 -0
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7714e5c2958803eaaf35cc7abd7baf55966b77b5
|
4
|
+
data.tar.gz: d8527b89ff3c250ba7474b36c4ceb2cecf2f3380
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f0bfed5c800a6151067419c9a680ef98b103c738c3e64444b29ca4e2401bd29faf53940320473ab332a98d6effde015d902e16481592cd1fa3e7b5b07b4b44d
|
7
|
+
data.tar.gz: 6a1b6488c40e320326668d87866a07303f6d104a7251aa84ba8caf5bb719e5ddfc86fed2178c7ee8ae186403b6c4feceeeb7c733cc9fee184af24d41ecf62724
|
data/README.md
CHANGED
@@ -5,8 +5,8 @@
|
|
5
5
|
|
6
6
|
Kumogata is a tool for [AWS CloudFormation](https://aws.amazon.com/cloudformation/).
|
7
7
|
|
8
|
-
[![Gem Version](https://badge.fury.io/rb/kumogata.png?
|
9
|
-
[![Build Status](https://drone.io/github.com/winebarrel/kumogata/status.png?
|
8
|
+
[![Gem Version](https://badge.fury.io/rb/kumogata.png?201403062015)](http://badge.fury.io/rb/kumogata)
|
9
|
+
[![Build Status](https://drone.io/github.com/winebarrel/kumogata/status.png?201403062015)](https://drone.io/github.com/winebarrel/kumogata/latest)
|
10
10
|
|
11
11
|
It can define a template in Ruby DSL, such as:
|
12
12
|
|
data/kumogata.gemspec
CHANGED
@@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_dependency 'hashie'
|
25
25
|
spec.add_dependency 'highline'
|
26
26
|
spec.add_dependency 'json'
|
27
|
+
spec.add_dependency 'json_color'
|
27
28
|
spec.add_dependency 'term-ansicolor'
|
28
29
|
spec.add_dependency 'uuidtools'
|
29
30
|
spec.add_development_dependency 'bundler'
|
data/lib/kumogata/client.rb
CHANGED
@@ -29,7 +29,7 @@ class Kumogata::Client
|
|
29
29
|
template = open_template(path_or_url)
|
30
30
|
|
31
31
|
if ruby_template?(path_or_url)
|
32
|
-
JSON.pretty_generate(template)
|
32
|
+
colorize_json(JSON.pretty_generate(template))
|
33
33
|
else
|
34
34
|
devaluate_template(template).chomp
|
35
35
|
end
|
@@ -54,7 +54,7 @@ class Kumogata::Client
|
|
54
54
|
|
55
55
|
def list(stack_name = nil)
|
56
56
|
stacks = describe_stacks(stack_name)
|
57
|
-
JSON.pretty_generate(stacks)
|
57
|
+
colorize_json(JSON.pretty_generate(stacks))
|
58
58
|
end
|
59
59
|
|
60
60
|
def export(stack_name)
|
@@ -64,17 +64,17 @@ class Kumogata::Client
|
|
64
64
|
|
65
65
|
def show_events(stack_name)
|
66
66
|
events = describe_events(stack_name)
|
67
|
-
JSON.pretty_generate(events)
|
67
|
+
colorize_json(JSON.pretty_generate(events))
|
68
68
|
end
|
69
69
|
|
70
70
|
def show_outputs(stack_name)
|
71
71
|
outputs = describe_outputs(stack_name)
|
72
|
-
JSON.pretty_generate(outputs)
|
72
|
+
colorize_json(JSON.pretty_generate(outputs))
|
73
73
|
end
|
74
74
|
|
75
75
|
def show_resources(stack_name)
|
76
76
|
resources = describe_resources(stack_name)
|
77
|
-
JSON.pretty_generate(resources)
|
77
|
+
colorize_json(JSON.pretty_generate(resources))
|
78
78
|
end
|
79
79
|
|
80
80
|
def diff(path_or_url1, path_or_url2)
|
@@ -409,10 +409,10 @@ class Kumogata::Client
|
|
409
409
|
puts <<-EOS
|
410
410
|
|
411
411
|
Outputs:
|
412
|
-
#{JSON.pretty_generate(outputs)}
|
412
|
+
#{colorize_json(JSON.pretty_generate(outputs))}
|
413
413
|
|
414
414
|
Stack Resource Summaries:
|
415
|
-
#{JSON.pretty_generate(summaries)}
|
415
|
+
#{colorize_json(JSON.pretty_generate(summaries))}
|
416
416
|
|
417
417
|
(Save to `#{@options.result_log}`)
|
418
418
|
EOS
|
@@ -431,4 +431,15 @@ Stack Resource Summaries:
|
|
431
431
|
i[0, 1].upcase + i[1..-1].downcase
|
432
432
|
}.join
|
433
433
|
end
|
434
|
+
|
435
|
+
def colorize_json(str)
|
436
|
+
if $stdout.tty? and @options.color?
|
437
|
+
begin
|
438
|
+
return JsonColor.colorize(str)
|
439
|
+
rescue Racc::ParseError
|
440
|
+
end
|
441
|
+
end
|
442
|
+
|
443
|
+
return str
|
444
|
+
end
|
434
445
|
end
|
data/lib/kumogata/version.rb
CHANGED
data/lib/kumogata.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kumogata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Genki Sugawara
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: json_color
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: term-ansicolor
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|