aws-ec2-instance_types 0.2.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/.ruby-version +1 -1
- data/Gemfile +16 -4
- data/Gemfile.lock +108 -0
- data/LICENSE +24 -201
- data/LICENSE.txt +20 -203
- data/Rakefile +43 -17
- data/VERSION +1 -1
- data/aws-ec2-instance_types.gemspec +78 -23
- data/bin/aws-ec2-instance_types +2 -13
- data/lib/dldinternet/aws/ec2/instance_types.rb +44 -104
- data/lib/dldinternet/aws/ec2.rb +1 -1
- metadata +75 -68
- data/.gitignore +0 -35
- data/ChangeLog.md +0 -4
- data/features/.gitkeep +0 -0
- data/features/step_definitions/.gitkeep +0 -0
- data/lib/aws/ec2/instance_types/version.rb +0 -8
- data/lib/aws/ec2/instance_types.rb +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZWRiNDVhZGQyZDhiZjY1NGZlYzdjOTE2NzQwYzQyNWNiYTkyOTExYw==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NzA4N2Q2MzNmODVhNGFjYTY1N2Q4MjNhYTJmMGJjMWFmYjQzMzhhNw==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
YmFmY2VhMjE4MjcwMmFmMDUyYTgwY2QzNzliNzBjZTAxNGMxNDc1MDdjNjMw
|
10
|
+
NGJkMmRmODY1NzBjMTFjY2QxNjFkZTZmZWVmY2YwM2ViYTdjNzYwMzEyYTVk
|
11
|
+
OTVmNjE2ZGVmZmU3ZTc3ODkxYzRkMWMxMjc0ZjExY2MzYjU0ZGY=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MDI1ZTExZmU2NzEwNDVlZTBhODViMGQ0YzU5YTQ2OWE1OWMyNDljMTRiNjBj
|
14
|
+
ZTRjZTUwMDdmOTA5OTMxZTM4NmE0NDBiNWM5ODAwMzg1ZTJkYWU4MWJkZTgw
|
15
|
+
ZjVkOWI3NTZiNzU2YWZkMGQ0NWIwZGE2ZmNiNmM0YWIyOWM0Mjc=
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
ruby-1.9.3-p448
|
data/Gemfile
CHANGED
@@ -1,7 +1,19 @@
|
|
1
|
-
source
|
2
|
-
|
3
|
-
|
1
|
+
source "http://rubygems.org"
|
2
|
+
# Add dependencies required to use your gem here.
|
3
|
+
# Example:
|
4
|
+
# gem "activesupport", ">= 2.3.5"
|
4
5
|
|
6
|
+
# Add dependencies to develop your gem here.
|
7
|
+
# Include everything needed to run rake, tests, features, etc.
|
5
8
|
group :development do
|
6
|
-
gem
|
9
|
+
gem "shoulda", ">= 0"
|
10
|
+
gem "rdoc", "~> 3.12"
|
11
|
+
gem "cucumber", ">= 0"
|
12
|
+
gem "bundler", "~> 1.0"
|
13
|
+
gem "jeweler", "~> 1.8.7"
|
14
|
+
#gem "rcov", ">= 0"
|
7
15
|
end
|
16
|
+
|
17
|
+
gem "mechanize"
|
18
|
+
gem "nokogiri"
|
19
|
+
gem "awesome_print"
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,108 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
activesupport (4.0.0)
|
5
|
+
i18n (~> 0.6, >= 0.6.4)
|
6
|
+
minitest (~> 4.2)
|
7
|
+
multi_json (~> 1.3)
|
8
|
+
thread_safe (~> 0.1)
|
9
|
+
tzinfo (~> 0.3.37)
|
10
|
+
addressable (2.3.5)
|
11
|
+
atomic (1.1.14)
|
12
|
+
awesome_print (1.2.0)
|
13
|
+
builder (3.2.2)
|
14
|
+
cucumber (1.3.8)
|
15
|
+
builder (>= 2.1.2)
|
16
|
+
diff-lcs (>= 1.1.3)
|
17
|
+
gherkin (~> 2.12.1)
|
18
|
+
multi_json (>= 1.7.5, < 2.0)
|
19
|
+
multi_test (>= 0.0.2)
|
20
|
+
diff-lcs (1.2.4)
|
21
|
+
domain_name (0.5.13)
|
22
|
+
unf (>= 0.0.5, < 1.0.0)
|
23
|
+
faraday (0.8.8)
|
24
|
+
multipart-post (~> 1.2.0)
|
25
|
+
gherkin (2.12.2)
|
26
|
+
multi_json (~> 1.3)
|
27
|
+
git (1.2.6)
|
28
|
+
github_api (0.10.1)
|
29
|
+
addressable
|
30
|
+
faraday (~> 0.8.1)
|
31
|
+
hashie (>= 1.2)
|
32
|
+
multi_json (~> 1.4)
|
33
|
+
nokogiri (~> 1.5.2)
|
34
|
+
oauth2
|
35
|
+
hashie (2.0.5)
|
36
|
+
highline (1.6.19)
|
37
|
+
http-cookie (1.0.2)
|
38
|
+
domain_name (~> 0.5)
|
39
|
+
httpauth (0.2.0)
|
40
|
+
i18n (0.6.5)
|
41
|
+
jeweler (1.8.8)
|
42
|
+
builder
|
43
|
+
bundler (~> 1.0)
|
44
|
+
git (>= 1.2.5)
|
45
|
+
github_api (= 0.10.1)
|
46
|
+
highline (>= 1.6.15)
|
47
|
+
nokogiri (= 1.5.10)
|
48
|
+
rake
|
49
|
+
rdoc
|
50
|
+
json (1.8.0)
|
51
|
+
jwt (0.1.8)
|
52
|
+
multi_json (>= 1.5)
|
53
|
+
mechanize (2.7.2)
|
54
|
+
domain_name (~> 0.5, >= 0.5.1)
|
55
|
+
http-cookie (~> 1.0.0)
|
56
|
+
mime-types (~> 1.17, >= 1.17.2)
|
57
|
+
net-http-digest_auth (~> 1.1, >= 1.1.1)
|
58
|
+
net-http-persistent (~> 2.5, >= 2.5.2)
|
59
|
+
nokogiri (~> 1.4)
|
60
|
+
ntlm-http (~> 0.1, >= 0.1.1)
|
61
|
+
webrobots (>= 0.0.9, < 0.2)
|
62
|
+
mime-types (1.25)
|
63
|
+
minitest (4.7.5)
|
64
|
+
multi_json (1.8.1)
|
65
|
+
multi_test (0.0.2)
|
66
|
+
multi_xml (0.5.5)
|
67
|
+
multipart-post (1.2.0)
|
68
|
+
net-http-digest_auth (1.4)
|
69
|
+
net-http-persistent (2.9)
|
70
|
+
nokogiri (1.5.10)
|
71
|
+
ntlm-http (0.1.1)
|
72
|
+
oauth2 (0.9.2)
|
73
|
+
faraday (~> 0.8)
|
74
|
+
httpauth (~> 0.2)
|
75
|
+
jwt (~> 0.1.4)
|
76
|
+
multi_json (~> 1.0)
|
77
|
+
multi_xml (~> 0.5)
|
78
|
+
rack (~> 1.2)
|
79
|
+
rack (1.5.2)
|
80
|
+
rake (10.1.0)
|
81
|
+
rdoc (3.12.2)
|
82
|
+
json (~> 1.4)
|
83
|
+
shoulda (3.5.0)
|
84
|
+
shoulda-context (~> 1.0, >= 1.0.1)
|
85
|
+
shoulda-matchers (>= 1.4.1, < 3.0)
|
86
|
+
shoulda-context (1.1.5)
|
87
|
+
shoulda-matchers (2.4.0)
|
88
|
+
activesupport (>= 3.0.0)
|
89
|
+
thread_safe (0.1.3)
|
90
|
+
atomic
|
91
|
+
tzinfo (0.3.38)
|
92
|
+
unf (0.1.2)
|
93
|
+
unf_ext
|
94
|
+
unf_ext (0.0.6)
|
95
|
+
webrobots (0.1.1)
|
96
|
+
|
97
|
+
PLATFORMS
|
98
|
+
ruby
|
99
|
+
|
100
|
+
DEPENDENCIES
|
101
|
+
awesome_print
|
102
|
+
bundler (~> 1.0)
|
103
|
+
cucumber
|
104
|
+
jeweler (~> 1.8.7)
|
105
|
+
mechanize
|
106
|
+
nokogiri
|
107
|
+
rdoc (~> 3.12)
|
108
|
+
shoulda
|
data/LICENSE
CHANGED
@@ -1,201 +1,24 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
27
|
-
including but not limited to software source code, documentation
|
28
|
-
source, and configuration files.
|
29
|
-
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
31
|
-
transformation or translation of a Source form, including but
|
32
|
-
not limited to compiled object code, generated documentation,
|
33
|
-
and conversions to other media types.
|
34
|
-
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
36
|
-
Object form, made available under the License, as indicated by a
|
37
|
-
copyright notice that is included in or attached to the work
|
38
|
-
(an example is provided in the Appendix below).
|
39
|
-
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
-
the Work and Derivative Works thereof.
|
47
|
-
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
49
|
-
the original version of the Work and any modifications or additions
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
-
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
64
|
-
subsequently incorporated within the Work.
|
65
|
-
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
72
|
-
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
-
where such license applies only to those patent claims licensable
|
79
|
-
by such Contributor that are necessarily infringed by their
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
82
|
-
institute patent litigation against any entity (including a
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
85
|
-
or contributory patent infringement, then any patent licenses
|
86
|
-
granted to You under this License for that Work shall terminate
|
87
|
-
as of the date such litigation is filed.
|
88
|
-
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
91
|
-
modifications, and in Source or Object form, provided that You
|
92
|
-
meet the following conditions:
|
93
|
-
|
94
|
-
(a) You must give any other recipients of the Work or
|
95
|
-
Derivative Works a copy of this License; and
|
96
|
-
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
98
|
-
stating that You changed the files; and
|
99
|
-
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
102
|
-
attribution notices from the Source form of the Work,
|
103
|
-
excluding those notices that do not pertain to any part of
|
104
|
-
the Derivative Works; and
|
105
|
-
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
108
|
-
include a readable copy of the attribution notices contained
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
111
|
-
of the following places: within a NOTICE text file distributed
|
112
|
-
as part of the Derivative Works; within the Source form or
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
114
|
-
within a display generated by the Derivative Works, if and
|
115
|
-
wherever such third-party notices normally appear. The contents
|
116
|
-
of the NOTICE file are for informational purposes only and
|
117
|
-
do not modify the License. You may add Your own attribution
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
120
|
-
that such additional attribution notices cannot be construed
|
121
|
-
as modifying the License.
|
122
|
-
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
124
|
-
may provide additional or different license terms and conditions
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
128
|
-
the conditions stated in this License.
|
129
|
-
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
133
|
-
this License, without any additional terms or conditions.
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
-
the terms of any separate license agreement you may have executed
|
136
|
-
with Licensor regarding such Contributions.
|
137
|
-
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
140
|
-
except as required for reasonable and customary use in describing the
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
-
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
152
|
-
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
158
|
-
incidental, or consequential damages of any character arising as a
|
159
|
-
result of this License or out of the use or inability to use the
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
162
|
-
other commercial damages or losses), even if such Contributor
|
163
|
-
has been advised of the possibility of such damages.
|
164
|
-
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
-
or other liability obligations and/or rights consistent with this
|
169
|
-
License. However, in accepting such obligations, You may act only
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
174
|
-
of your accepting any such warranty or additional liability.
|
175
|
-
|
176
|
-
END OF TERMS AND CONDITIONS
|
177
|
-
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
179
|
-
|
180
|
-
To apply the Apache License to your work, attach the following
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "{}"
|
182
|
-
replaced with your own identifying information. (Don't include
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
184
|
-
comment syntax for the file format. We also recommend that a
|
185
|
-
file or class name and description of purpose be included on the
|
186
|
-
same "printed page" as the copyright notice for easier
|
187
|
-
identification within third-party archives.
|
188
|
-
|
189
|
-
Copyright {yyyy} {name of copyright owner}
|
190
|
-
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
192
|
-
you may not use this file except in compliance with the License.
|
193
|
-
You may obtain a copy of the License at
|
194
|
-
|
195
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
196
|
-
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200
|
-
See the License for the specific language governing permissions and
|
201
|
-
limitations under the License.
|
1
|
+
This is free and unencumbered software released into the public domain.
|
2
|
+
|
3
|
+
Anyone is free to copy, modify, publish, use, compile, sell, or
|
4
|
+
distribute this software, either in source code form or as a compiled
|
5
|
+
binary, for any purpose, commercial or non-commercial, and by any
|
6
|
+
means.
|
7
|
+
|
8
|
+
In jurisdictions that recognize copyright laws, the author or authors
|
9
|
+
of this software dedicate any and all copyright interest in the
|
10
|
+
software to the public domain. We make this dedication for the benefit
|
11
|
+
of the public at large and to the detriment of our heirs and
|
12
|
+
successors. We intend this dedication to be an overt act of
|
13
|
+
relinquishment in perpetuity of all present and future rights to this
|
14
|
+
software under copyright law.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
19
|
+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
20
|
+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
21
|
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
23
|
+
|
24
|
+
For more information, please refer to <http://unlicense.org/>
|
data/LICENSE.txt
CHANGED
@@ -1,203 +1,20 @@
|
|
1
|
-
Copyright (c)
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
direction or management of such entity, whether by contract or
|
22
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
23
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
24
|
-
|
25
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
26
|
-
exercising permissions granted by this License.
|
27
|
-
|
28
|
-
"Source" form shall mean the preferred form for making modifications,
|
29
|
-
including but not limited to software source code, documentation
|
30
|
-
source, and configuration files.
|
31
|
-
|
32
|
-
"Object" form shall mean any form resulting from mechanical
|
33
|
-
transformation or translation of a Source form, including but
|
34
|
-
not limited to compiled object code, generated documentation,
|
35
|
-
and conversions to other media types.
|
36
|
-
|
37
|
-
"Work" shall mean the work of authorship, whether in Source or
|
38
|
-
Object form, made available under the License, as indicated by a
|
39
|
-
copyright notice that is included in or attached to the work
|
40
|
-
(an example is provided in the Appendix below).
|
41
|
-
|
42
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
43
|
-
form, that is based on (or derived from) the Work and for which the
|
44
|
-
editorial revisions, annotations, elaborations, or other modifications
|
45
|
-
represent, as a whole, an original work of authorship. For the purposes
|
46
|
-
of this License, Derivative Works shall not include works that remain
|
47
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
48
|
-
the Work and Derivative Works thereof.
|
49
|
-
|
50
|
-
"Contribution" shall mean any work of authorship, including
|
51
|
-
the original version of the Work and any modifications or additions
|
52
|
-
to that Work or Derivative Works thereof, that is intentionally
|
53
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
54
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
55
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
56
|
-
means any form of electronic, verbal, or written communication sent
|
57
|
-
to the Licensor or its representatives, including but not limited to
|
58
|
-
communication on electronic mailing lists, source code control systems,
|
59
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
60
|
-
Licensor for the purpose of discussing and improving the Work, but
|
61
|
-
excluding communication that is conspicuously marked or otherwise
|
62
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
63
|
-
|
64
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
65
|
-
on behalf of whom a Contribution has been received by Licensor and
|
66
|
-
subsequently incorporated within the Work.
|
67
|
-
|
68
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
69
|
-
this License, each Contributor hereby grants to You a perpetual,
|
70
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
71
|
-
copyright license to reproduce, prepare Derivative Works of,
|
72
|
-
publicly display, publicly perform, sublicense, and distribute the
|
73
|
-
Work and such Derivative Works in Source or Object form.
|
74
|
-
|
75
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
76
|
-
this License, each Contributor hereby grants to You a perpetual,
|
77
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
78
|
-
(except as stated in this section) patent license to make, have made,
|
79
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
80
|
-
where such license applies only to those patent claims licensable
|
81
|
-
by such Contributor that are necessarily infringed by their
|
82
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
83
|
-
with the Work to which such Contribution(s) was submitted. If You
|
84
|
-
institute patent litigation against any entity (including a
|
85
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
86
|
-
or a Contribution incorporated within the Work constitutes direct
|
87
|
-
or contributory patent infringement, then any patent licenses
|
88
|
-
granted to You under this License for that Work shall terminate
|
89
|
-
as of the date such litigation is filed.
|
90
|
-
|
91
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
92
|
-
Work or Derivative Works thereof in any medium, with or without
|
93
|
-
modifications, and in Source or Object form, provided that You
|
94
|
-
meet the following conditions:
|
95
|
-
|
96
|
-
(a) You must give any other recipients of the Work or
|
97
|
-
Derivative Works a copy of this License; and
|
98
|
-
|
99
|
-
(b) You must cause any modified files to carry prominent notices
|
100
|
-
stating that You changed the files; and
|
101
|
-
|
102
|
-
(c) You must retain, in the Source form of any Derivative Works
|
103
|
-
that You distribute, all copyright, patent, trademark, and
|
104
|
-
attribution notices from the Source form of the Work,
|
105
|
-
excluding those notices that do not pertain to any part of
|
106
|
-
the Derivative Works; and
|
107
|
-
|
108
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
109
|
-
distribution, then any Derivative Works that You distribute must
|
110
|
-
include a readable copy of the attribution notices contained
|
111
|
-
within such NOTICE file, excluding those notices that do not
|
112
|
-
pertain to any part of the Derivative Works, in at least one
|
113
|
-
of the following places: within a NOTICE text file distributed
|
114
|
-
as part of the Derivative Works; within the Source form or
|
115
|
-
documentation, if provided along with the Derivative Works; or,
|
116
|
-
within a display generated by the Derivative Works, if and
|
117
|
-
wherever such third-party notices normally appear. The contents
|
118
|
-
of the NOTICE file are for informational purposes only and
|
119
|
-
do not modify the License. You may add Your own attribution
|
120
|
-
notices within Derivative Works that You distribute, alongside
|
121
|
-
or as an addendum to the NOTICE text from the Work, provided
|
122
|
-
that such additional attribution notices cannot be construed
|
123
|
-
as modifying the License.
|
124
|
-
|
125
|
-
You may add Your own copyright statement to Your modifications and
|
126
|
-
may provide additional or different license terms and conditions
|
127
|
-
for use, reproduction, or distribution of Your modifications, or
|
128
|
-
for any such Derivative Works as a whole, provided Your use,
|
129
|
-
reproduction, and distribution of the Work otherwise complies with
|
130
|
-
the conditions stated in this License.
|
131
|
-
|
132
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
133
|
-
any Contribution intentionally submitted for inclusion in the Work
|
134
|
-
by You to the Licensor shall be under the terms and conditions of
|
135
|
-
this License, without any additional terms or conditions.
|
136
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
137
|
-
the terms of any separate license agreement you may have executed
|
138
|
-
with Licensor regarding such Contributions.
|
139
|
-
|
140
|
-
6. Trademarks. This License does not grant permission to use the trade
|
141
|
-
names, trademarks, service marks, or product names of the Licensor,
|
142
|
-
except as required for reasonable and customary use in describing the
|
143
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
144
|
-
|
145
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
146
|
-
agreed to in writing, Licensor provides the Work (and each
|
147
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
148
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
149
|
-
implied, including, without limitation, any warranties or conditions
|
150
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
151
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
152
|
-
appropriateness of using or redistributing the Work and assume any
|
153
|
-
risks associated with Your exercise of permissions under this License.
|
154
|
-
|
155
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
156
|
-
whether in tort (including negligence), contract, or otherwise,
|
157
|
-
unless required by applicable law (such as deliberate and grossly
|
158
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
159
|
-
liable to You for damages, including any direct, indirect, special,
|
160
|
-
incidental, or consequential damages of any character arising as a
|
161
|
-
result of this License or out of the use or inability to use the
|
162
|
-
Work (including but not limited to damages for loss of goodwill,
|
163
|
-
work stoppage, computer failure or malfunction, or any and all
|
164
|
-
other commercial damages or losses), even if such Contributor
|
165
|
-
has been advised of the possibility of such damages.
|
166
|
-
|
167
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
168
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
169
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
170
|
-
or other liability obligations and/or rights consistent with this
|
171
|
-
License. However, in accepting such obligations, You may act only
|
172
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
173
|
-
of any other Contributor, and only if You agree to indemnify,
|
174
|
-
defend, and hold each Contributor harmless for any liability
|
175
|
-
incurred by, or claims asserted against, such Contributor by reason
|
176
|
-
of your accepting any such warranty or additional liability.
|
177
|
-
|
178
|
-
END OF TERMS AND CONDITIONS
|
179
|
-
|
180
|
-
APPENDIX: How to apply the Apache License to your work.
|
181
|
-
|
182
|
-
To apply the Apache License to your work, attach the following
|
183
|
-
boilerplate notice, with the fields enclosed by brackets "{}"
|
184
|
-
replaced with your own identifying information. (Don't include
|
185
|
-
the brackets!) The text should be enclosed in the appropriate
|
186
|
-
comment syntax for the file format. We also recommend that a
|
187
|
-
file or class name and description of purpose be included on the
|
188
|
-
same "printed page" as the copyright notice for easier
|
189
|
-
identification within third-party archives.
|
190
|
-
|
191
|
-
Copyright {yyyy} {name of copyright owner}
|
192
|
-
|
193
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
194
|
-
you may not use this file except in compliance with the License.
|
195
|
-
You may obtain a copy of the License at
|
196
|
-
|
197
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
198
|
-
|
199
|
-
Unless required by applicable law or agreed to in writing, software
|
200
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
201
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
202
|
-
See the License for the specific language governing permissions and
|
203
|
-
limitations under the License.
|
1
|
+
Copyright (c) 2013 Christo De Lange
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
CHANGED
@@ -1,30 +1,56 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
|
-
|
5
|
-
begin
|
6
|
-
require 'bundler'
|
7
|
-
rescue LoadError => e
|
8
|
-
warn e.message
|
9
|
-
warn "Run `gem install bundler` to install Bundler."
|
10
|
-
exit -1
|
11
|
-
end
|
12
|
-
|
4
|
+
require 'bundler'
|
13
5
|
begin
|
14
|
-
Bundler.setup(:development)
|
6
|
+
Bundler.setup(:default, :development)
|
15
7
|
rescue Bundler::BundlerError => e
|
16
|
-
|
17
|
-
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
18
10
|
exit e.status_code
|
19
11
|
end
|
20
|
-
|
21
12
|
require 'rake'
|
22
13
|
|
23
|
-
require '
|
24
|
-
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
+
gem.name = "aws-ec2-instance_types"
|
18
|
+
gem.homepage = "http://github.com/dldinternet/aws-ec2-instance_types"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = %Q{Retrieve an up to date list of valid AWS EC2 Instance Types}
|
21
|
+
gem.description = %Q{Retrieve an up to date list of valid AWS EC2 Instance Types directly from Amazon Web Services official site.}
|
22
|
+
gem.email = "rubygems@dldinternet.com"
|
23
|
+
gem.authors = ["Christo De Lange"]
|
24
|
+
# dependencies defined in Gemfile
|
25
|
+
end
|
26
|
+
Jeweler::RubygemsDotOrgTasks.new
|
27
|
+
|
28
|
+
require 'rake/testtask'
|
29
|
+
Rake::TestTask.new(:test) do |test|
|
30
|
+
test.libs << 'lib' << 'test'
|
31
|
+
test.pattern = 'test/**/test_*.rb'
|
32
|
+
test.verbose = true
|
33
|
+
end
|
34
|
+
|
35
|
+
#require 'rcov/rcovtask'
|
36
|
+
#Rcov::RcovTask.new do |test|
|
37
|
+
# test.libs << 'test'
|
38
|
+
# test.pattern = 'test/**/test_*.rb'
|
39
|
+
# test.verbose = true
|
40
|
+
# test.rcov_opts << '--exclude "gems/*"'
|
41
|
+
#end
|
25
42
|
|
26
43
|
require 'cucumber/rake/task'
|
44
|
+
Cucumber::Rake::Task.new(:features)
|
45
|
+
|
46
|
+
task :default => :test
|
47
|
+
|
48
|
+
require 'rdoc/task'
|
49
|
+
Rake::RDocTask.new do |rdoc|
|
50
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
27
51
|
|
28
|
-
|
29
|
-
|
52
|
+
rdoc.rdoc_dir = 'rdoc'
|
53
|
+
rdoc.title = "aws-ec2-instance_types #{version}"
|
54
|
+
rdoc.rdoc_files.include('README*')
|
55
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
30
56
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.0
|
@@ -1,29 +1,84 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
1
4
|
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: aws-ec2-instance_types 1.0.0 ruby lib
|
2
6
|
|
3
|
-
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = "aws-ec2-instance_types"
|
9
|
+
s.version = "1.0.0"
|
4
10
|
|
5
|
-
Gem::
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
+
s.authors = ["Christo De Lange"]
|
13
|
+
s.date = "2013-10-14"
|
14
|
+
s.description = "Retrieve an up to date list of valid AWS EC2 Instance Types directly from Amazon Web Services official site."
|
15
|
+
s.email = "rubygems@dldinternet.com"
|
16
|
+
s.executables = ["aws-ec2-instance_types"]
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"LICENSE",
|
19
|
+
"LICENSE.txt",
|
20
|
+
"README.md",
|
21
|
+
"README.rdoc"
|
22
|
+
]
|
23
|
+
s.files = [
|
24
|
+
".document",
|
25
|
+
".ruby-gemset",
|
26
|
+
".ruby-version",
|
27
|
+
"Gemfile",
|
28
|
+
"Gemfile.lock",
|
29
|
+
"LICENSE",
|
30
|
+
"LICENSE.txt",
|
31
|
+
"README.md",
|
32
|
+
"README.rdoc",
|
33
|
+
"Rakefile",
|
34
|
+
"VERSION",
|
35
|
+
"aws-ec2-instance_types.gemspec",
|
36
|
+
"bin/aws-ec2-instance_types",
|
37
|
+
"features/aws-ec2-instance_types.feature",
|
38
|
+
"features/step_definitions/aws-ec2-instance_types_steps.rb",
|
39
|
+
"features/support/env.rb",
|
40
|
+
"lib/dldinternet/aws/ec2.rb",
|
41
|
+
"lib/dldinternet/aws/ec2/instance_types.rb",
|
42
|
+
"test/helper.rb",
|
43
|
+
"test/test_aws-ec2-instance_types.rb"
|
44
|
+
]
|
45
|
+
s.homepage = "http://github.com/dldinternet/aws-ec2-instance_types"
|
46
|
+
s.licenses = ["MIT"]
|
47
|
+
s.require_paths = ["lib"]
|
48
|
+
s.rubygems_version = "2.1.5"
|
49
|
+
s.summary = "Retrieve an up to date list of valid AWS EC2 Instance Types"
|
14
50
|
|
15
|
-
|
16
|
-
|
17
|
-
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
-
gem.require_paths = ['lib']
|
19
|
-
|
20
|
-
gem.add_development_dependency 'bundler', '~> 1.0'
|
21
|
-
gem.add_development_dependency 'rake', '~> 0.8'
|
22
|
-
gem.add_development_dependency 'rubygems-tasks', '~> 0.2'
|
23
|
-
|
24
|
-
gem.add_runtime_dependency(%q<mechanize>, ['>= 2.7.2'])
|
25
|
-
gem.add_runtime_dependency(%q<nokogiri>, ['>= 1.5.0'])
|
26
|
-
gem.add_runtime_dependency(%q<awesome_print>, ['>= 1.2.0'])
|
27
|
-
gem.add_runtime_dependency(%q<colorize>, ['>= 0.7.2'])
|
51
|
+
if s.respond_to? :specification_version then
|
52
|
+
s.specification_version = 4
|
28
53
|
|
54
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
55
|
+
s.add_runtime_dependency(%q<mechanize>, [">= 0"])
|
56
|
+
s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
|
57
|
+
s.add_runtime_dependency(%q<awesome_print>, [">= 0"])
|
58
|
+
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
59
|
+
s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
|
60
|
+
s.add_development_dependency(%q<cucumber>, [">= 0"])
|
61
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0"])
|
62
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.8.7"])
|
63
|
+
else
|
64
|
+
s.add_dependency(%q<mechanize>, [">= 0"])
|
65
|
+
s.add_dependency(%q<nokogiri>, [">= 0"])
|
66
|
+
s.add_dependency(%q<awesome_print>, [">= 0"])
|
67
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
68
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
69
|
+
s.add_dependency(%q<cucumber>, [">= 0"])
|
70
|
+
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
71
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.7"])
|
72
|
+
end
|
73
|
+
else
|
74
|
+
s.add_dependency(%q<mechanize>, [">= 0"])
|
75
|
+
s.add_dependency(%q<nokogiri>, [">= 0"])
|
76
|
+
s.add_dependency(%q<awesome_print>, [">= 0"])
|
77
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
78
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
79
|
+
s.add_dependency(%q<cucumber>, [">= 0"])
|
80
|
+
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
81
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.7"])
|
82
|
+
end
|
29
83
|
end
|
84
|
+
|
data/bin/aws-ec2-instance_types
CHANGED
@@ -7,16 +7,5 @@ $:.unshift(_lib) unless $:.include?(_lib)
|
|
7
7
|
require "dldinternet/aws/ec2"
|
8
8
|
include DLDInternet::AWS::EC2
|
9
9
|
|
10
|
-
require
|
11
|
-
|
12
|
-
mechanize.open_timeout = 5
|
13
|
-
mechanize.read_timeout = 10
|
14
|
-
|
15
|
-
require 'awesome_print'
|
16
|
-
require 'colorize'
|
17
|
-
|
18
|
-
begin
|
19
|
-
puts getInstanceTypes(:mechanize => mechanize).ai
|
20
|
-
rescue Timeout::Error => e
|
21
|
-
puts "Unable to retrieve instance type details in a reasonable time (#{mechanize.open_timeout}s). Giving up ...".light_red
|
22
|
-
end
|
10
|
+
require "awesome_print"
|
11
|
+
puts getInstanceTypes.ai
|
@@ -1,124 +1,64 @@
|
|
1
1
|
module DLDInternet
|
2
2
|
module AWS
|
3
3
|
module EC2
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
#
|
14
|
-
# :network_performance # [8]
|
15
|
-
# ]
|
16
|
-
#'Instance Type','vCPU','Memory (GiB)',' Storage (GB)','Networking Performance','Physical Processor','Clock Speed (GHz)','Intel® AES-NI','Intel® AVX†','Intel® Turbo','EBS OPT','Enhanced Networking'
|
17
|
-
HEADINGS_CPU = [
|
18
|
-
:instance_type, # [0]
|
19
|
-
:vCPU, # [1]
|
20
|
-
:memory, # [2]
|
21
|
-
:instance_storage, # [3]
|
22
|
-
:networking_performance, # [4]
|
23
|
-
:physical_processor, # [5]
|
24
|
-
:clock_speed, # [6]
|
25
|
-
:Intel_AES_NI, # [7]
|
26
|
-
:Intel_AVX, # [8]
|
27
|
-
:Intel_Turbo, # [9]
|
28
|
-
:EBS_OPT, # [10]
|
29
|
-
:enhanced_networking # [11]
|
4
|
+
HEADINGS = [
|
5
|
+
:instance_family, # [0]
|
6
|
+
:instance_type, # [1]
|
7
|
+
:processor_arch, # [2]
|
8
|
+
:vCPU, # [3]
|
9
|
+
:ECU, # [4]
|
10
|
+
:memory, # [5]
|
11
|
+
:instance_storage, # [6]
|
12
|
+
:EBS_optimized_available, # [7]
|
13
|
+
:network_performance # [8]
|
30
14
|
]
|
31
|
-
|
15
|
+
|
32
16
|
attr_reader :instance_types
|
33
17
|
|
34
|
-
|
35
|
-
def getInstanceTypes(options={})
|
18
|
+
def getInstanceTypes()
|
36
19
|
unless @instance_types
|
37
20
|
@instance_types = {}
|
38
21
|
require "mechanize"
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
22
|
+
agent = Mechanize.new
|
23
|
+
agent.user_agent_alias = 'Mac Safari' # Pretend to use a Mac
|
24
|
+
begin
|
25
|
+
page = agent.get('http://aws.amazon.com/ec2/instance-types/instance-details/')
|
26
|
+
#body = page.body.gsub('<br>', " \n")
|
27
|
+
require "nokogiri"
|
28
|
+
nk = Nokogiri::HTML(page.body)
|
29
|
+
table = nk.css("div#yui-main div.yui-b table")
|
30
|
+
raise AWSEC2Error.new "Cannot find instance type table" unless table.is_a?(Nokogiri::XML::NodeSet)
|
31
|
+
rows = table.search('tr')[0..-1]
|
32
|
+
head = rows.shift
|
33
|
+
#br = nbsp = Nokogiri::HTML("<br>").text
|
34
|
+
cols = head.search('td').collect { |td|
|
35
|
+
text = td.text.to_s
|
36
|
+
text = text.gsub(%r/(\r?\n)+/, ' ').strip
|
37
|
+
CGI.unescapeHTML(text)
|
38
|
+
} #.select{ |col| col unless col == '' }
|
45
39
|
|
46
|
-
|
40
|
+
@instance_types[:headings] = {}
|
41
|
+
(0..cols.size-1).map{|i| @instance_types[:headings][HEADINGS[i]] = cols[i] }
|
47
42
|
|
48
|
-
|
43
|
+
@instance_types[:details] = []
|
44
|
+
rows.each do |row|
|
45
|
+
|
46
|
+
cells = row.search('td').collect { |td|
|
47
|
+
CGI.unescapeHTML(td.text.to_s.gsub(%r/(\r?\n)+/, ' ').strip.gsub('32-bit or64-bit', '32-bit or 64-bit'))
|
48
|
+
}
|
49
|
+
raise StandardError.new "This row does not have the same number of cells as the table header: #{row.text.to_s.strip}" unless cells.size == cols.size
|
50
|
+
instance = {}
|
51
|
+
(0..cells.size-1).map{|i| instance[HEADINGS[i]] = cells[i] }
|
52
|
+
@instance_types[:details] << instance
|
49
53
|
|
50
|
-
nk = Nokogiri::HTML(page.body)
|
51
|
-
# noinspection RubyAssignmentExpressionInConditionalInspection
|
52
|
-
if div = find_div(nk, %r'^<div\s+class="nine columns content-with-nav')
|
53
|
-
# noinspection RubyAssignmentExpressionInConditionalInspection
|
54
|
-
if div = find_div(div, %r'^<div\s+class="content parsys')
|
55
|
-
divs = div.css('div').to_a
|
56
|
-
itm = nil
|
57
|
-
idx = 0
|
58
|
-
divs.each do |d|
|
59
|
-
as = d.css('div div h2 a')
|
60
|
-
as.each do |a|
|
61
|
-
# puts "'#{a.text}'"
|
62
|
-
if a.text == ' Instance Types Matrix '
|
63
|
-
itm = d
|
64
|
-
break
|
65
|
-
end
|
66
|
-
end
|
67
|
-
break if itm
|
68
|
-
idx += 1
|
69
|
-
end
|
70
|
-
itm = divs[idx+1+2]
|
71
|
-
table = itm.css('div table').first
|
72
|
-
# puts "#{idx}: #{table.to_s}"
|
73
|
-
@instance_types = scrapeTable(HEADINGS_CPU, table)
|
74
54
|
end
|
55
|
+
rescue Net::HTTPNotFound => e
|
56
|
+
@logger.error "Unable to retrieve list of flavors! #{FLAVORS_URL} was not found! (#{e.message})"
|
57
|
+
raise e
|
75
58
|
end
|
76
59
|
end
|
77
60
|
@instance_types
|
78
61
|
end
|
79
|
-
|
80
|
-
def find_div(nk,regex)
|
81
|
-
ret = nil
|
82
|
-
divs = nk.search('div')
|
83
|
-
if divs.count > 0
|
84
|
-
nine = divs.select { |div| div.to_s.match regex }
|
85
|
-
if nine.count == 1
|
86
|
-
nine = nine.shift
|
87
|
-
ret = nine
|
88
|
-
end
|
89
|
-
end
|
90
|
-
ret
|
91
|
-
end
|
92
|
-
|
93
|
-
# ---------------------------------------------------------------------------------------------------------------
|
94
|
-
def scrapeTable(cHeadings,table)
|
95
|
-
raise Error.new 'Cannot find instance type table' unless table.is_a?(Nokogiri::XML::Element)
|
96
|
-
rows = table.search('tr')[0..-1]
|
97
|
-
head = rows.shift
|
98
|
-
|
99
|
-
cols = head.search('td').collect { |td|
|
100
|
-
text = td.text.to_s
|
101
|
-
text = text.gsub(%r/(\r?\n)+/, ' ').strip
|
102
|
-
CGI.unescapeHTML(text)
|
103
|
-
}
|
104
|
-
instance_types = {
|
105
|
-
:headings => {},
|
106
|
-
:details => []
|
107
|
-
}
|
108
|
-
(0..cols.size-1).map { |i| instance_types[:headings][cHeadings[i]] = cols[i] }
|
109
|
-
|
110
|
-
rows.each do |row|
|
111
|
-
|
112
|
-
cells = row.search('td').collect { |td|
|
113
|
-
CGI.unescapeHTML(td.text.to_s.gsub(%r/(\r?\n)+/, ' ').strip.gsub('32-bit or64-bit', '32-bit or 64-bit'))
|
114
|
-
}
|
115
|
-
raise StandardError.new "This row does not have the same number of cells as the table header: #{row.text.to_s.strip}" unless cells.size == cols.size
|
116
|
-
instance = {}
|
117
|
-
(0..cells.size-1).map { |i| instance[cHeadings[i]] = cells[i] }
|
118
|
-
instance_types[:details] << instance
|
119
|
-
end
|
120
|
-
instance_types
|
121
|
-
end
|
122
62
|
end
|
123
63
|
end
|
124
64
|
end
|
data/lib/dldinternet/aws/ec2.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
|
2
|
-
require
|
2
|
+
require "dldinternet/aws/ec2/instance_types"
|
metadata
CHANGED
@@ -1,127 +1,146 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-ec2-instance_types
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christo De Lange
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2013-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: mechanize
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ! '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
20
|
-
type: :
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ! '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: nokogiri
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ! '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0
|
34
|
-
type: :
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
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: '0
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: awesome_print
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ! '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: shoulda
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
|
-
- -
|
66
|
+
- - ! '>='
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
70
|
+
name: rdoc
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
|
-
- -
|
73
|
+
- - ~>
|
60
74
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
62
|
-
|
75
|
+
version: !binary |-
|
76
|
+
My4xMg==
|
77
|
+
type: :development
|
63
78
|
prerelease: false
|
64
79
|
version_requirements: !ruby/object:Gem::Requirement
|
65
80
|
requirements:
|
66
|
-
- -
|
81
|
+
- - ~>
|
67
82
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
83
|
+
version: !binary |-
|
84
|
+
My4xMg==
|
69
85
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
86
|
+
name: cucumber
|
71
87
|
requirement: !ruby/object:Gem::Requirement
|
72
88
|
requirements:
|
73
|
-
- -
|
89
|
+
- - ! '>='
|
74
90
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
76
|
-
type: :
|
91
|
+
version: '0'
|
92
|
+
type: :development
|
77
93
|
prerelease: false
|
78
94
|
version_requirements: !ruby/object:Gem::Requirement
|
79
95
|
requirements:
|
80
|
-
- -
|
96
|
+
- - ! '>='
|
81
97
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
98
|
+
version: '0'
|
83
99
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
100
|
+
name: bundler
|
85
101
|
requirement: !ruby/object:Gem::Requirement
|
86
102
|
requirements:
|
87
|
-
- -
|
103
|
+
- - ~>
|
88
104
|
- !ruby/object:Gem::Version
|
89
|
-
version: 1.
|
90
|
-
type: :
|
105
|
+
version: '1.0'
|
106
|
+
type: :development
|
91
107
|
prerelease: false
|
92
108
|
version_requirements: !ruby/object:Gem::Requirement
|
93
109
|
requirements:
|
94
|
-
- -
|
110
|
+
- - ~>
|
95
111
|
- !ruby/object:Gem::Version
|
96
|
-
version: 1.
|
112
|
+
version: '1.0'
|
97
113
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
114
|
+
name: jeweler
|
99
115
|
requirement: !ruby/object:Gem::Requirement
|
100
116
|
requirements:
|
101
|
-
- -
|
117
|
+
- - ~>
|
102
118
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
104
|
-
type: :
|
119
|
+
version: 1.8.7
|
120
|
+
type: :development
|
105
121
|
prerelease: false
|
106
122
|
version_requirements: !ruby/object:Gem::Requirement
|
107
123
|
requirements:
|
108
|
-
- -
|
124
|
+
- - ~>
|
109
125
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
126
|
+
version: 1.8.7
|
111
127
|
description: Retrieve an up to date list of valid AWS EC2 Instance Types directly
|
112
128
|
from Amazon Web Services official site.
|
113
129
|
email: rubygems@dldinternet.com
|
114
130
|
executables:
|
115
131
|
- aws-ec2-instance_types
|
116
132
|
extensions: []
|
117
|
-
extra_rdoc_files:
|
133
|
+
extra_rdoc_files:
|
134
|
+
- LICENSE
|
135
|
+
- LICENSE.txt
|
136
|
+
- README.md
|
137
|
+
- README.rdoc
|
118
138
|
files:
|
119
|
-
-
|
120
|
-
-
|
121
|
-
-
|
122
|
-
- ".ruby-version"
|
123
|
-
- ChangeLog.md
|
139
|
+
- .document
|
140
|
+
- .ruby-gemset
|
141
|
+
- .ruby-version
|
124
142
|
- Gemfile
|
143
|
+
- Gemfile.lock
|
125
144
|
- LICENSE
|
126
145
|
- LICENSE.txt
|
127
146
|
- README.md
|
@@ -130,20 +149,16 @@ files:
|
|
130
149
|
- VERSION
|
131
150
|
- aws-ec2-instance_types.gemspec
|
132
151
|
- bin/aws-ec2-instance_types
|
133
|
-
- features/.gitkeep
|
134
152
|
- features/aws-ec2-instance_types.feature
|
135
|
-
- features/step_definitions/.gitkeep
|
136
153
|
- features/step_definitions/aws-ec2-instance_types_steps.rb
|
137
154
|
- features/support/env.rb
|
138
|
-
- lib/aws/ec2/instance_types.rb
|
139
|
-
- lib/aws/ec2/instance_types/version.rb
|
140
155
|
- lib/dldinternet/aws/ec2.rb
|
141
156
|
- lib/dldinternet/aws/ec2/instance_types.rb
|
142
157
|
- test/helper.rb
|
143
158
|
- test/test_aws-ec2-instance_types.rb
|
144
|
-
homepage:
|
159
|
+
homepage: http://github.com/dldinternet/aws-ec2-instance_types
|
145
160
|
licenses:
|
146
|
-
-
|
161
|
+
- MIT
|
147
162
|
metadata: {}
|
148
163
|
post_install_message:
|
149
164
|
rdoc_options: []
|
@@ -151,26 +166,18 @@ require_paths:
|
|
151
166
|
- lib
|
152
167
|
required_ruby_version: !ruby/object:Gem::Requirement
|
153
168
|
requirements:
|
154
|
-
- -
|
169
|
+
- - ! '>='
|
155
170
|
- !ruby/object:Gem::Version
|
156
171
|
version: '0'
|
157
172
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
158
173
|
requirements:
|
159
|
-
- -
|
174
|
+
- - ! '>='
|
160
175
|
- !ruby/object:Gem::Version
|
161
176
|
version: '0'
|
162
177
|
requirements: []
|
163
178
|
rubyforge_project:
|
164
|
-
rubygems_version: 2.
|
179
|
+
rubygems_version: 2.1.5
|
165
180
|
signing_key:
|
166
181
|
specification_version: 4
|
167
|
-
summary: Retrieve an up to date list of valid AWS EC2 Instance Types
|
168
|
-
|
169
|
-
test_files:
|
170
|
-
- features/.gitkeep
|
171
|
-
- features/aws-ec2-instance_types.feature
|
172
|
-
- features/step_definitions/.gitkeep
|
173
|
-
- features/step_definitions/aws-ec2-instance_types_steps.rb
|
174
|
-
- features/support/env.rb
|
175
|
-
- test/helper.rb
|
176
|
-
- test/test_aws-ec2-instance_types.rb
|
182
|
+
summary: Retrieve an up to date list of valid AWS EC2 Instance Types
|
183
|
+
test_files: []
|
data/.gitignore
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
*.gem
|
2
|
-
*.rbc
|
3
|
-
/.config
|
4
|
-
/coverage/
|
5
|
-
/InstalledFiles
|
6
|
-
/pkg/
|
7
|
-
/spec/reports/
|
8
|
-
/test/tmp/
|
9
|
-
/test/version_tmp/
|
10
|
-
/tmp/
|
11
|
-
|
12
|
-
## Specific to RubyMotion:
|
13
|
-
.dat*
|
14
|
-
.repl_history
|
15
|
-
build/
|
16
|
-
|
17
|
-
## Documentation cache and generated files:
|
18
|
-
/.yardoc/
|
19
|
-
/_yardoc/
|
20
|
-
/doc/
|
21
|
-
/rdoc/
|
22
|
-
|
23
|
-
## Environment normalisation:
|
24
|
-
/.bundle/
|
25
|
-
/lib/bundler/man/
|
26
|
-
|
27
|
-
# for a library or gem, you might want to ignore these files since the code is
|
28
|
-
# intended to run in multiple environments; otherwise, check them in:
|
29
|
-
# Gemfile.lock
|
30
|
-
.ruby-version
|
31
|
-
.ruby-gemset
|
32
|
-
|
33
|
-
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
34
|
-
.rvmrc
|
35
|
-
*.iml
|
data/ChangeLog.md
DELETED
data/features/.gitkeep
DELETED
File without changes
|
File without changes
|
@@ -1 +0,0 @@
|
|
1
|
-
require 'aws/ec2/instance_types/version'
|