simplygenius-atmos 0.11.10 → 0.11.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 53769d0519aa4f45feb52891aff6696ea1be0b054b0baf8d444799c1e93273de
4
- data.tar.gz: a0a4726cf39261d4abc7d3880e06cc4b43d46dc6eeb0cedf53690d6aafb66f62
3
+ metadata.gz: 72a21c734727cfb54965b10fd0f7dac8e4edc3a85c461877e53e43be0da20668
4
+ data.tar.gz: 7deb82dabe355ae7bfaab079e7bf06607677e1759254dc98bc38ee369b925f92
5
5
  SHA512:
6
- metadata.gz: 7fe49d0c4b8366d46f4ddd08fa3406759d43bfceed609ebe8f874e376d767e6bcb1855a97ea00dd99ca5ee082dc80edf38cd14fa87269de2814534677ec1644e
7
- data.tar.gz: 3f5e5f627bb4f4f3ef5ed934bc3d0cb4675b189df6a060dbe43bb98d64c83d7987c278537d88f17a146ad61e94d18a0f9883957cd6ce4ba7faf6945c00860e33
6
+ metadata.gz: 4539ef0beadd221b8e3bd114040ef29aaf310c9b12b065fd779d0da3832d955f8672097ba7a3fc5408a476501a95fdb90b531a9de811dcee3f20b1af799f9caa
7
+ data.tar.gz: ea937bd0db5c0072e5b2170702168830229bf4fa2dd99e67acd04cff7f71d080099a1bc05c6a4b93946186d1481985b91b5652c5e8c6816fc7b7bf77910d3714
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ 0.11.11 (02/20/2020)
2
+ --------------------
3
+
4
+ * Add the ability to setup a version requirement for forcing teams to use a consistent version of atmos [5c44ef3](https://github.com/simplygenius/atmos/commit/5c44ef3)
5
+
1
6
  0.11.10 (02/19/2020)
2
7
  --------------------
3
8
 
@@ -2,6 +2,7 @@ require_relative '../atmos'
2
2
  require_relative '../atmos/ui'
3
3
  require 'clamp'
4
4
  require 'sigdump/setup'
5
+ require 'open-uri'
5
6
 
6
7
  Dir.glob(File.join(File.join(__dir__, 'commands'), '*.rb')) do |f|
7
8
  require_relative "commands/#{File.basename(f).sub(/\.rb$/, "")}"
@@ -119,6 +120,41 @@ module SimplyGenius
119
120
  end
120
121
  end
121
122
 
123
+ def fetch_latest_version
124
+ begin
125
+ latest_ver = JSON.parse(open("https://rubygems.org/api/v1/versions/simplygenius-atmos/latest.json").read)['version']
126
+ rescue => e
127
+ latest_ver = "[Version Fetch Failed]"
128
+ logger.log_exception(e, "Couldn't check latest atmos gem version", level: :debug)
129
+ end
130
+ latest_ver
131
+ end
132
+
133
+ def version_check(atmos_version)
134
+
135
+ required_ver = Atmos.config["atmos.version_requirement"]
136
+ if required_ver.present?
137
+ case required_ver
138
+
139
+ when "latest"
140
+ latest_ver = fetch_latest_version
141
+
142
+ if latest_ver != atmos_version
143
+ raise "The atmos version (#{atmos_version}) does not match the given requirement (latest: #{latest_ver})"
144
+ end
145
+
146
+ when /[~<>=]*\s*[\d\.]*/
147
+ if ! Gem::Dependency.new('', required_ver).match?('', atmos_version)
148
+ raise "The atmos version (#{atmos_version}) does not match the given requirement (#{required_ver})"
149
+ end
150
+
151
+ else
152
+ raise "Invalid atmos.version_requirement, should be 'latest' or in a gem dependency form"
153
+ end
154
+ end
155
+
156
+ end
157
+
122
158
  # hook into clamp lifecycle to force logging setup even when we are calling
123
159
  # a subcommand
124
160
  def parse(arguments)
@@ -149,6 +185,8 @@ module SimplyGenius
149
185
  logger.info "Atmos Version #{VERSION}"
150
186
  exit(0)
151
187
  end
188
+
189
+ version_check(VERSION)
152
190
  end
153
191
  end
154
192
 
@@ -1,5 +1,5 @@
1
1
  module SimplyGenius
2
2
  module Atmos
3
- VERSION = "0.11.10"
3
+ VERSION = "0.11.11"
4
4
  end
5
5
  end
@@ -35,6 +35,12 @@ atmos:
35
35
  # gets expanded at runtime
36
36
  load_path:
37
37
 
38
+ # Forces one to use the version of atmos that is given. This version
39
+ # specifier can be 'latest' or in the form of a gem version dependency
40
+ # specifier, e.g. '~> 0.11.10'. If unset, then no version check will be
41
+ # performed
42
+ version_requirement:
43
+
38
44
  # Configure the mechanism that allows terraform to callback into atmos
39
45
  ipc:
40
46
  # Disables all IPC callbacks into atmos from terraform
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplygenius-atmos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.10
4
+ version: 0.11.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Conway
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-19 00:00:00.000000000 Z
11
+ date: 2020-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -28,128 +28,128 @@ dependencies:
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '3.7'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '3.7'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: simplecov
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '0.10'
61
+ version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '0.10'
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: coveralls
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '0.8'
75
+ version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '0.8'
82
+ version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: test_construct
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: 2.0.1
89
+ version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: 2.0.1
96
+ version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: vcr
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: 4.0.0
103
+ version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: 4.0.0
110
+ version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: webmock
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "~>"
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: 3.3.0
117
+ version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - "~>"
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: 3.3.0
124
+ version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: pry
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - "~>"
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
- version: 0.11.3
131
+ version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - "~>"
136
+ - - ">="
137
137
  - !ruby/object:Gem::Version
138
- version: 0.11.3
138
+ version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: pry-byebug
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - "~>"
143
+ - - ">="
144
144
  - !ruby/object:Gem::Version
145
- version: 3.6.0
145
+ version: '0'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - "~>"
150
+ - - ">="
151
151
  - !ruby/object:Gem::Version
152
- version: 3.6.0
152
+ version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: activesupport
155
155
  requirement: !ruby/object:Gem::Requirement