MovableInkAWS 1.0.12 → 1.0.13

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
  SHA256:
3
- metadata.gz: '092c81ea23dd01ec27099a68d8ee17510239f9d18b75992c13e7c17600fa3c13'
4
- data.tar.gz: 9c1696ebf069bb8db288509014599a62dc4d4c23b9c569e88dae3a858addf054
3
+ metadata.gz: 4b350dcc6432c0f218c528e9779bde52cfc535e605529a0513c05b02e605e396
4
+ data.tar.gz: 7197977f915549ff7c19623a446fd05c24768bf2773a72851e8cd98bcc619ec8
5
5
  SHA512:
6
- metadata.gz: e42ac78ca0f620398222aa285f1792e257229327c7d8595ac3a4d1548b335c97dec2a3682d5d828aecae956ede68ed5336f790d91beda46a85d29b90b4d97138
7
- data.tar.gz: 4f25f6de7c875a960ae306c8c337f8f9b943d132ede56b5135761449228b745c15a8a06415c48061d64197e98d8a272627b3fe775ff179897ce6f5f46e5f31a8
6
+ metadata.gz: 9f6130a4a62193455450492c46fa1efde90b8b96c912637550bbc6797ed5fc45b28517295ed624f5668d3ea9efd19a3bc7e90c4afea8a6ab7699507ce38961c1
7
+ data.tar.gz: 363122ff9d3f11c9d04def581a25251139efdf7b2cb3d1c29ca2cc22d43622b2fda5731ff235016e5f0855ffb78becfb41294bd57f424982f349d051a8ae868e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- MovableInkAWS (1.0.12)
4
+ MovableInkAWS (1.0.13)
5
5
  aws-sdk-athena (~> 1)
6
6
  aws-sdk-autoscaling (~> 1)
7
7
  aws-sdk-cloudwatch (~> 1)
@@ -14,7 +14,8 @@ module MovableInk
14
14
 
15
15
  def mi_env
16
16
  @mi_env ||= if File.exist?(mi_env_cache_file_path)
17
- File.read(mi_env_cache_file_path)
17
+ value = File.read(mi_env_cache_file_path)
18
+ value.empty? ? load_mi_env : value
18
19
  else
19
20
  load_mi_env
20
21
  end
@@ -1,5 +1,5 @@
1
1
  module MovableInk
2
2
  class AWS
3
- VERSION = '1.0.12'
3
+ VERSION = '1.0.13'
4
4
  end
5
5
  end
data/spec/ec2_spec.rb CHANGED
@@ -45,6 +45,19 @@ describe MovableInk::AWS::EC2 do
45
45
  expect(aws.mi_env).to eq('staging')
46
46
  end
47
47
 
48
+ it 'will read tag data if the cache file is empty' do
49
+ ec2.stub_responses(:describe_tags, tag_data)
50
+ allow(aws).to receive(:my_region).and_return('us-east-1')
51
+ allow(aws).to receive(:instance_id).and_return('i-12345')
52
+ allow(aws).to receive(:ec2).and_return(ec2)
53
+
54
+ f = Tempfile.new('cache')
55
+ f.write('')
56
+ f.close
57
+ allow(aws).to receive(:mi_env_cache_file_path).and_return(f.path)
58
+ expect(aws.mi_env).to eq('test')
59
+ end
60
+
48
61
  it "should find the environment from the current instance's tags" do
49
62
  ec2.stub_responses(:describe_tags, tag_data)
50
63
  allow(aws).to receive(:my_region).and_return('us-east-1')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: MovableInkAWS
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.12
4
+ version: 1.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Chesler