simnos 0.1.1 → 0.1.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: 46ece4215baf7e53e68422ab22855f8758440803
4
- data.tar.gz: 7cfe5d14b3f5780f5009e6050cb5491e71212ef1
3
+ metadata.gz: 73fc966ae4921824425776121a1e1ebd4d37565a
4
+ data.tar.gz: 96ecfd4f27f3623f298146756bf12a96feadd0f1
5
5
  SHA512:
6
- metadata.gz: 5873c87f7b86b96102d11b52ac0280d34a4f3688e60995804a6f26c5454e9f2c764369e58d69b0b9bef6766f1a47a357dab27275115d23f59bf83dc3c7ab15f7
7
- data.tar.gz: f7321d521535d66abcc420353d7bd478a2e6210ed7c70859b60ec362efd0b8e16b19ab6198c9c11e39e77839831543113c300af4e572d0d7e0c9edc24c574b47
6
+ metadata.gz: d07e4938a546a9f96f0fc6676dcb8b5eafd39484a90875507039c5f2878f5f739107eefc8c1db1cc353dfaf88eb3ac2c4acd733e7cb54113d4cf1e03bb5fc679
7
+ data.tar.gz: c218d9d6faf53d223188d23e048a84024f52edcc0a977cef0aa0ee40f65043645fd52dda7243905d06b43d4e1a2a1499f92f3e288f225b163353ba7446e82e72
@@ -1,3 +1,4 @@
1
+ require 'colorize'
1
2
  require 'pp'
2
3
  require 'simnos/client_wrapper'
3
4
  require 'simnos/converter'
@@ -74,7 +75,7 @@ module Simnos
74
75
 
75
76
  def delete_subscriptions(aws_topic, aws_sub_by_key)
76
77
  aws_sub_by_key.each do |key, aws_sub|
77
- Simnos.logger.info("Delete Topic(#{aws_topic[:topic].topic_arn.split(':').last}) Subscription. protocol: #{key[0].inspect}, endpoint: #{key[1].inspect}.#{@options[:dry_run] ? ' [dry-run]' : ''}")
78
+ Simnos.logger.info("Delete Topic(#{aws_topic[:topic].topic_arn.split(':').last}) Subscription. protocol: #{key[0].inspect}, endpoint: #{key[1].inspect}.#{@options[:dry_run] ? ' [dry-run]' : ''}".colorize(:red))
78
79
  if aws_sub.subscription_arn.split(':').length < 6
79
80
  Simnos.logger.warn("Can not delete Subscription `#{aws_sub.subscription_arn}`")
80
81
  next
@@ -139,7 +140,7 @@ module Simnos
139
140
 
140
141
  # delete
141
142
  aws_topics_by_name.each do |name, aws_topic|
142
- Simnos.logger.info("Delete Topic #{name}.#{@options[:dry_run] ? ' [dry-run]' : ''}")
143
+ Simnos.logger.info("Delete Topic #{name}.#{@options[:dry_run] ? ' [dry-run]' : ''}".colorize(:red))
143
144
  next if @options[:dry_run]
144
145
 
145
146
  client.delete_topic(topic_arn: aws_topic[:topic].topic_arn)
@@ -1,3 +1,4 @@
1
+ require 'colorize'
1
2
  require 'simnos/utils'
2
3
 
3
4
  module Simnos
@@ -6,7 +7,7 @@ module Simnos
6
7
  include Simnos::TemplateHelper
7
8
 
8
9
  def create
9
- Simnos.logger.info("Create Topic(#{@aws_topic[:topic].topic_arn.split(':').last}) Subscription. protocol: #{protocol.inspect}, endpoint: #{masked_endpoint.inspect}#{@options[:dry_run] ? ' [dry-run]' : ''}")
10
+ Simnos.logger.info("Create Topic(#{@aws_topic[:topic].topic_arn.split(':').last}) Subscription. protocol: #{protocol.inspect}, endpoint: #{masked_endpoint.inspect}#{@options[:dry_run] ? ' [dry-run]' : ''}".colorize(:green))
10
11
  return if @options[:dry_run]
11
12
 
12
13
  client.subscribe(
@@ -1,3 +1,4 @@
1
+ require 'colorize'
1
2
  require 'simnos/utils'
2
3
  require 'simnos/dsl/subscriptions'
3
4
 
@@ -26,7 +27,7 @@ module Simnos
26
27
  end
27
28
 
28
29
  def create
29
- Simnos.logger.info("Create Topic #{name}.#{@options[:dry_run] ? ' [dry-run]' : ''}")
30
+ Simnos.logger.info("Create Topic #{name}.#{@options[:dry_run] ? ' [dry-run]' : ''}".colorize(:green))
30
31
  return { topic: Hashie::Mash.new(topic_arn: 'not yet created') } if @options[:dry_run]
31
32
 
32
33
  resp = client.create_topic(name: name)
@@ -72,7 +73,7 @@ module Simnos
72
73
  Simnos.logger.debug(@aws_topic[:attrs].attributes.pretty_inspect)
73
74
  Simnos.logger.debug('--- dsl ---')
74
75
  Simnos.logger.debug(dsl_val)
75
- Simnos.logger.info("Modify Topic `#{name}` #{attr_name} attributes.#{@options[:dry_run] ? ' [dry-run]' : ''}")
76
+ Simnos.logger.info("Modify Topic `#{name}` #{attr_name} attributes.#{@options[:dry_run] ? ' [dry-run]' : ''}".colorize(:blue))
76
77
  dsl_attrs = {
77
78
  attribute_name: attr_name,
78
79
  attribute_value: dsl_val,
@@ -92,7 +93,7 @@ module Simnos
92
93
  def modify_attr_hash(dsl_val, attr_name)
93
94
  aws_val = JSON.parse(@aws_topic[:attrs].attributes[attr_name])
94
95
  return if Simnos::Utils.normalize_hash(dsl_val) == Simnos::Utils.normalize_hash(aws_val)
95
- Simnos.logger.info("Modify Topic `#{name}` #{attr_name} attributes.#{@options[:dry_run] ? ' [dry-run]' : ''}")
96
+ Simnos.logger.info("Modify Topic `#{name}` #{attr_name} attributes.#{@options[:dry_run] ? ' [dry-run]' : ''}".colorize(:blue))
96
97
  dsl_attrs = {
97
98
  attribute_name: attr_name,
98
99
  attribute_value: dsl_val,
@@ -1,3 +1,3 @@
1
1
  module Simnos
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.add_dependency 'aws-sdk', '~> 2'
25
25
  spec.add_dependency 'hashie'
26
26
  spec.add_dependency 'diffy'
27
- spec.add_dependency 'term-ansicolor'
27
+ spec.add_dependency 'colorize'
28
28
 
29
29
  spec.add_development_dependency 'bundler', '~> 1.14'
30
30
  spec.add_development_dependency 'rake', '~> 10.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simnos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - wata
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-30 00:00:00.000000000 Z
11
+ date: 2018-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -53,7 +53,7 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: term-ansicolor
56
+ name: colorize
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
191
  version: '0'
192
192
  requirements: []
193
193
  rubyforge_project:
194
- rubygems_version: 2.6.13
194
+ rubygems_version: 2.5.1
195
195
  signing_key:
196
196
  specification_version: 4
197
197
  summary: Codenize AWS SNS