aws_ec2_environment 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 3775e63eb372f1dccbf0ca69fb1df16f02e4fd9bfc092944d7880f73ef668988
4
+ data.tar.gz: 1a37c44fcb4c6258165c3890cc12f4b3de3b16142ddb80c3071baa4d9de78cfd
5
+ SHA512:
6
+ metadata.gz: 055a9fa886280c9e088f2dac3c66ebee130c62db48300d7d7f8d47714fe2c30192c1482711cadf55422381d55d284a9e7e5df49dfb2c994606de8d9bac3b4ef1
7
+ data.tar.gz: e60c5ee60a9fb247d2e101c75f36bca67866874ba64ee80fe6530ad236c690394073e686a6665dc9e43ca7c409de22431abdfbe7ecee3772285d9e8c47c528da
data/.editorconfig ADDED
@@ -0,0 +1,11 @@
1
+ # https://editorconfig.org
2
+
3
+ root = true
4
+
5
+ [*]
6
+ charset = utf-8
7
+ indent_style = space
8
+ indent_size = 2
9
+ end_of_line = lf
10
+ insert_final_newline = true
11
+ trim_trailing_whitespace = true
data/.prettierignore ADDED
@@ -0,0 +1,6 @@
1
+ /.bundle/
2
+ /coverage/
3
+
4
+ .idea/
5
+ .vscode/
6
+ /vendor/
data/.prettierrc.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/prettierrc",
3
+ "semi": true,
4
+ "useTabs": false,
5
+ "singleQuote": true,
6
+ "bracketSpacing": true,
7
+ "bracketSameLine": false,
8
+ "jsxSingleQuote": false,
9
+ "quoteProps": "consistent",
10
+ "proseWrap": "always",
11
+ "endOfLine": "lf",
12
+ "arrowParens": "avoid",
13
+ "trailingComma": "none",
14
+ "htmlWhitespaceSensitivity": "ignore"
15
+ }
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,242 @@
1
+ ---
2
+ require:
3
+ - rubocop-performance
4
+ - rubocop-rspec
5
+
6
+ # Built-in config:
7
+ # https://github.com/bbatsov/rubocop/blob/master/config/default.yml
8
+
9
+ # We do not typically use/need class documentation
10
+ Style/Documentation:
11
+ Enabled: false
12
+
13
+ AllCops:
14
+ NewCops: enable
15
+ DisplayCopNames: true
16
+ DisplayStyleGuide: true
17
+ TargetRubyVersion: 3.0
18
+ Exclude:
19
+ - 'bin/*'
20
+ - 'node_modules/**/*'
21
+ - 'bower_components/**/*'
22
+ - 'tmp/**/*'
23
+ - 'vendor/**/*'
24
+ - 'bin/**/*'
25
+ - 'doc/**/*'
26
+
27
+ Layout/LineLength:
28
+ Max: 120
29
+
30
+ Metrics/ModuleLength:
31
+ Exclude:
32
+ - 'spec/**/*_spec.rb'
33
+
34
+ Metrics/BlockLength:
35
+ Exclude:
36
+ - 'spec/**/*.rb'
37
+
38
+ # We generally don't want methods longer than 20 lines, except in migrations where it's probably okay.
39
+ Metrics/MethodLength:
40
+ Max: 20
41
+ Exclude:
42
+ - 'db/migrate/**/*.rb'
43
+ - 'spec/**/*'
44
+
45
+ # This cop complains when you have variables named things like:
46
+ # address_line_1
47
+ # address_line_2
48
+ # etc.
49
+ Naming/VariableNumber:
50
+ Enabled: false
51
+
52
+ # Just always use `raise` and stop thinking about it.
53
+ Style/SignalException:
54
+ EnforcedStyle: only_raise
55
+
56
+ # We think that:
57
+ # array = [
58
+ # :value
59
+ # ]
60
+ # and_in_a_method_call([
61
+ # :value
62
+ # ])
63
+ # Looks better than:
64
+ # value = [
65
+ # :value
66
+ # ]
67
+ # but_in_a_method_call([
68
+ # :its_like_this
69
+ # ])
70
+ Layout/FirstArrayElementIndentation:
71
+ EnforcedStyle: consistent
72
+
73
+ # We think that:
74
+ # hash = {
75
+ # key: :value
76
+ # }
77
+ # and_in_a_method_call({
78
+ # no: :difference
79
+ # })
80
+ # Looks better than:
81
+ # hash = {
82
+ # key: :value
83
+ # }
84
+ # but_in_a_method_call({
85
+ # its_like: :this
86
+ # })
87
+ Layout/FirstHashElementIndentation:
88
+ EnforcedStyle: consistent
89
+
90
+ # We think that:
91
+ # {
92
+ # foo: :bar
93
+ # baz: :bip
94
+ # }
95
+ # Looks better than:
96
+ # { foo: :bar
97
+ # baz: :bip }
98
+ Layout/MultilineHashBraceLayout:
99
+ Enabled: false
100
+
101
+ # We think that:
102
+ # foo(
103
+ # bar: :baz,
104
+ # bip: :whizz
105
+ # )
106
+ # Looks better than:
107
+ # foo(bar: baz,
108
+ # bip: :whizz)
109
+ Layout/MultilineMethodCallBraceLayout:
110
+ Enabled: false
111
+
112
+ # Just always use double quotes and stop thinking about it.
113
+ Style/StringLiterals:
114
+ EnforcedStyle: double_quotes
115
+
116
+ Style/StringLiteralsInInterpolation:
117
+ EnforcedStyle: double_quotes
118
+
119
+ # Ruby 2.4+ has a magic comment that makes all strings frozen and Rubocop wants to put it
120
+ # at the top of every. single. file. We decided we didn't want that - for now.
121
+ Style/FrozenStringLiteralComment:
122
+ Enabled: false
123
+
124
+ # We usually don't want you to use semicolons in Ruby, except in specs where brevity is
125
+ # often more valued than readability.
126
+ Style/Semicolon:
127
+ AllowAsExpressionSeparator: true
128
+ Exclude:
129
+ - 'spec/**/*.rb'
130
+
131
+ # Single line method definitions are totally fine, and often more readable, consider:
132
+ # class WidgetsPolicy
133
+ # def create?; false; end
134
+ # def index?; true; end
135
+ # def show?; true; end
136
+ # def update?; false; end
137
+ # def delete?; false; end
138
+ # end
139
+ Style/SingleLineMethods:
140
+ Enabled: false
141
+
142
+ # We want you to put a blank line between method definitions, the only exception being
143
+ # if you're defining a bunch of single-line methods as above.
144
+ Layout/EmptyLineBetweenDefs:
145
+ AllowAdjacentOneLineDefs: true
146
+
147
+ Naming/FileName:
148
+ Exclude:
149
+ - '**/Gemfile'
150
+ - '**/Rakefile'
151
+ - '**/Berksfile'
152
+
153
+ # Disable preference for Ruby's new safe navigation operator `&.` because it
154
+ # usually comes at the cost of expressiveness in the simple case:
155
+ #
156
+ # - coupon_usage.destroy if coupon_usage
157
+ # + coupon_usage&.destroy
158
+ #
159
+ # And guides you towards Law of Demeter violations in the extreme case:
160
+ #
161
+ # result&.data&.attributes&.payments&.first&.payment_token
162
+ #
163
+ # Disabling this cop doesn't stop you from using it, but be prepared to defend
164
+ # it in code review if you do.
165
+ Style/SafeNavigation:
166
+ Enabled: false
167
+
168
+ # Ruby supports two styles of string template formatting.
169
+ # "annotated" - format("%<greeting>s", greeting: "Hello")
170
+ # "template" - format("%{greeting}", greeting: "Hello")
171
+ #
172
+ # While the annotated format is more descriptive, it also comes in a style that is
173
+ # significantly harder for a developer to parse. The template style is easy to read, understand,
174
+ # and is consistent with formatting with (for example), interpolation (#{}).
175
+ Style/FormatStringToken:
176
+ EnforcedStyle: template
177
+
178
+ # This syntax is a deliberate idiom in rspec
179
+ # bbatsov endorses disabling it for rspec
180
+ # https://github.com/bbatsov/rubocop/issues/4222#issuecomment-290722962
181
+ Lint/AmbiguousBlockAssociation:
182
+ Exclude:
183
+ - 'spec/**/*'
184
+
185
+ # https://rubocop.readthedocs.io/en/latest/cops_style/
186
+ Style/HashTransformKeys:
187
+ Enabled: false
188
+
189
+ # https://rubocop.readthedocs.io/en/latest/cops_style/
190
+ Style/HashTransformValues:
191
+ Enabled: false
192
+
193
+ Metrics/AbcSize:
194
+ Max: 18
195
+ Exclude:
196
+ - 'spec/**/*'
197
+
198
+ Metrics/ClassLength:
199
+ Exclude:
200
+ - 'spec/**/*'
201
+
202
+ Naming/MemoizedInstanceVariableName:
203
+ EnforcedStyleForLeadingUnderscores: optional
204
+
205
+ Performance/Casecmp:
206
+ Enabled: false
207
+
208
+ Style/BarePercentLiterals:
209
+ EnforcedStyle: percent_q
210
+
211
+ Style/ClassAndModuleChildren:
212
+ Enabled: false
213
+
214
+ Style/DoubleNegation:
215
+ Enabled: false
216
+
217
+ Style/EmptyMethod:
218
+ Enabled: false
219
+
220
+ Style/NumericPredicate:
221
+ Enabled: false
222
+
223
+ Style/TrivialAccessors:
224
+ AllowPredicates: true
225
+
226
+ RSpec:
227
+ Language:
228
+ Expectations:
229
+ - assert_match
230
+
231
+ RSpec/MultipleExpectations:
232
+ Max: 10
233
+
234
+ RSpec/ExampleLength:
235
+ Max: 30
236
+
237
+ RSpec/RepeatedExample:
238
+ Exclude:
239
+ - 'spec/policies/**'
240
+
241
+ RSpec/MultipleMemoizedHelpers:
242
+ Max: 10
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2022-08-17
4
+
5
+ - Initial release
@@ -0,0 +1,78 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, sex characteristics, gender identity and
9
+ expression, level of experience, education, socio-economic status, nationality,
10
+ personal appearance, race, religion, or sexual identity and orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ - Using welcoming and inclusive language
18
+ - Being respectful of differing viewpoints and experiences
19
+ - Gracefully accepting constructive criticism
20
+ - Focusing on what is best for the community
21
+ - Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ - The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ - Trolling, insulting/derogatory comments, and personal or political attacks
28
+ - Public or private harassment
29
+ - Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ - Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or reject
41
+ comments, commits, code, wiki edits, issues, and other contributions that are
42
+ not aligned to this Code of Conduct, or to ban temporarily or permanently any
43
+ contributor for other behaviors that they deem inappropriate, threatening,
44
+ offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at open-source@ackama.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an
62
+ incident. Further details of specific enforcement policies may be posted
63
+ separately.
64
+
65
+ Project maintainers who do not follow or enforce the Code of Conduct in good
66
+ faith may face temporary or permanent repercussions as determined by other
67
+ members of the project's leadership.
68
+
69
+ ## Attribution
70
+
71
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
72
+ version 1.4, available at
73
+ https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
74
+
75
+ [homepage]: https://www.contributor-covenant.org
76
+
77
+ For answers to common questions about this code of conduct, see
78
+ https://www.contributor-covenant.org/faq
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,78 @@
1
+ # How to contribute
2
+
3
+ Thank you for deciding to contribute to this project! We're open to most changes
4
+ so long as they're maintainable and within the scope and spirit of this project.
5
+
6
+ ## Reporting bugs, suggesting features, and asking questions
7
+
8
+ The best place to start is with creating an issue on the GitHub repository - try
9
+ to include as much detail as possible.
10
+
11
+ If you're reporting a bug, make sure to include as much relevant information as
12
+ possible to help us reproduce the bug; we know sometimes this can be hard, so
13
+ we'll do our best to work with you to build out a reproduction, but remember we
14
+ have limited time.
15
+
16
+ If you're suggesting a feature, make sure to include as much information on your
17
+ use-case and why you think the feature belongs in this library. Also remember
18
+ that while we'd love to empower everyone by providing useful features, we do
19
+ have to maintain everything in the library, so if your feature is very specific
20
+ for your use-case and complex we might have to say no (but please don't let that
21
+ stop you from opening an issue - we want to work _with_ you, which includes
22
+ trying to find middle grounds and alternatives if we think something doesn't
23
+ belong in the library itself for some reason).
24
+
25
+ If you're asking a question, make sure to be as concise as possible, and
26
+ remember that we only have limited time so might not always be able to answer
27
+ every question.
28
+
29
+ Always make sure your issue is well formatted - use codeblocks to wrap terminal
30
+ output and code, and wrap large content dumps in `<details>`. We know no one's
31
+ perfect (including ourselves!), but be aware we will edit issues descriptions if
32
+ we think they need a touch up.
33
+
34
+ ## Testing
35
+
36
+ We try and include tests for as much of the codebase as possible, though some of
37
+ the
38
+
39
+ We try and include tests for as much of the codebase as possible, though some of
40
+ the more complicated parts (such as the CLI flags) currently don't have tests.
41
+
42
+ Tests are run as part of CI and are required to pass before a change can be
43
+ landed. You can run tests locally with:
44
+
45
+ ```shell
46
+ bundle exec rspec
47
+ ```
48
+
49
+ ## Linting & formatting
50
+
51
+ We use [`rubocop`](https://docs.rubocop.org/rubocop/index.html) to keep the
52
+ codebase healthy and consistent.
53
+
54
+ This is run as part of CI and is required to pass before a change can be landed.
55
+ You can run `rubocop` locally with:
56
+
57
+ ```shell
58
+ bundle exec rubocop
59
+ ```
60
+
61
+ Markdown documents, json, and yaml files should be formatted with
62
+ [`prettier`](https://prettier.io/). You can run this with:
63
+
64
+ ```shell
65
+ npx prettier --write .
66
+ ```
67
+
68
+ This is also run as part of CI.
69
+
70
+ ## Submitting changes
71
+
72
+ Make a pull request on this repository with a clear description of the change
73
+ you're made and why. Ideally include a test or two if possible, and keep changes
74
+ atomic (one feature per PR, since we squash when merging).
75
+
76
+ Commit messages should be
77
+ [conventional](https://www.conventionalcommits.org/en/v1.0.0/), to make it
78
+ easier to write changelogs and determine version numbers when releasing.
data/Gemfile ADDED
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in aws_ec2_environment.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
11
+
12
+ gem "rubocop", "~> 1.21"
13
+ gem "rubocop-performance"
14
+ gem "rubocop-rspec"
15
+ gem "simplecov", require: false
data/Gemfile.lock ADDED
@@ -0,0 +1,105 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ aws_ec2_environment (0.1.0)
5
+ aws-sdk-ec2 (~> 1.0)
6
+ aws-sdk-ssm (~> 1.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ ast (2.4.2)
12
+ aws-eventstream (1.2.0)
13
+ aws-partitions (1.619.0)
14
+ aws-sdk-core (3.132.0)
15
+ aws-eventstream (~> 1, >= 1.0.2)
16
+ aws-partitions (~> 1, >= 1.525.0)
17
+ aws-sigv4 (~> 1.1)
18
+ jmespath (~> 1, >= 1.6.1)
19
+ aws-sdk-ec2 (1.327.0)
20
+ aws-sdk-core (~> 3, >= 3.127.0)
21
+ aws-sigv4 (~> 1.1)
22
+ aws-sdk-ssm (1.138.0)
23
+ aws-sdk-core (~> 3, >= 3.127.0)
24
+ aws-sigv4 (~> 1.1)
25
+ aws-sigv4 (1.5.1)
26
+ aws-eventstream (~> 1, >= 1.0.2)
27
+ base64 (0.1.1)
28
+ diff-lcs (1.5.0)
29
+ docile (1.4.0)
30
+ jmespath (1.6.1)
31
+ json (2.6.3)
32
+ language_server-protocol (3.17.0.3)
33
+ parallel (1.23.0)
34
+ parser (3.2.2.3)
35
+ ast (~> 2.4.1)
36
+ racc
37
+ racc (1.7.1)
38
+ rainbow (3.1.1)
39
+ rake (13.0.6)
40
+ regexp_parser (2.8.1)
41
+ rexml (3.2.6)
42
+ rspec (3.11.0)
43
+ rspec-core (~> 3.11.0)
44
+ rspec-expectations (~> 3.11.0)
45
+ rspec-mocks (~> 3.11.0)
46
+ rspec-core (3.11.0)
47
+ rspec-support (~> 3.11.0)
48
+ rspec-expectations (3.11.0)
49
+ diff-lcs (>= 1.2.0, < 2.0)
50
+ rspec-support (~> 3.11.0)
51
+ rspec-mocks (3.11.1)
52
+ diff-lcs (>= 1.2.0, < 2.0)
53
+ rspec-support (~> 3.11.0)
54
+ rspec-support (3.11.0)
55
+ rubocop (1.56.0)
56
+ base64 (~> 0.1.1)
57
+ json (~> 2.3)
58
+ language_server-protocol (>= 3.17.0)
59
+ parallel (~> 1.10)
60
+ parser (>= 3.2.2.3)
61
+ rainbow (>= 2.2.2, < 4.0)
62
+ regexp_parser (>= 1.8, < 3.0)
63
+ rexml (>= 3.2.5, < 4.0)
64
+ rubocop-ast (>= 1.28.1, < 2.0)
65
+ ruby-progressbar (~> 1.7)
66
+ unicode-display_width (>= 2.4.0, < 3.0)
67
+ rubocop-ast (1.29.0)
68
+ parser (>= 3.2.1.0)
69
+ rubocop-capybara (2.18.0)
70
+ rubocop (~> 1.41)
71
+ rubocop-factory_bot (2.23.1)
72
+ rubocop (~> 1.33)
73
+ rubocop-performance (1.18.0)
74
+ rubocop (>= 1.7.0, < 2.0)
75
+ rubocop-ast (>= 0.4.0)
76
+ rubocop-rspec (2.23.2)
77
+ rubocop (~> 1.33)
78
+ rubocop-capybara (~> 2.17)
79
+ rubocop-factory_bot (~> 2.22)
80
+ ruby-progressbar (1.13.0)
81
+ simplecov (0.21.2)
82
+ docile (~> 1.1)
83
+ simplecov-html (~> 0.11)
84
+ simplecov_json_formatter (~> 0.1)
85
+ simplecov-html (0.12.3)
86
+ simplecov_json_formatter (0.1.4)
87
+ unicode-display_width (2.4.2)
88
+
89
+ PLATFORMS
90
+ arm64-darwin-21
91
+ x86_64-darwin-19
92
+ x86_64-darwin-20
93
+ x86_64-linux
94
+
95
+ DEPENDENCIES
96
+ aws_ec2_environment!
97
+ rake (~> 13.0)
98
+ rspec (~> 3.0)
99
+ rubocop (~> 1.21)
100
+ rubocop-performance
101
+ rubocop-rspec
102
+ simplecov
103
+
104
+ BUNDLED WITH
105
+ 2.3.17
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 Gareth Jones
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.