landrush 0.19.0 → 1.0.0

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.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/.config/cucumber.yml +7 -0
  3. data/.gitignore +6 -4
  4. data/.rubocop.yml +5 -0
  5. data/.rubocop_todo.yml +32 -259
  6. data/CHANGELOG.md +8 -1
  7. data/CONTRIBUTING.md +11 -10
  8. data/Gemfile +7 -4
  9. data/Gemfile.lock +178 -0
  10. data/README.md +148 -35
  11. data/Rakefile +18 -0
  12. data/doc/img/advanced-tcp-properties.png +0 -0
  13. data/doc/img/network-connections.png +0 -0
  14. data/features/dns_resolution.feature +26 -0
  15. data/features/step_definitions/dns.rb +19 -0
  16. data/features/support/env.rb +16 -0
  17. data/landrush.gemspec +1 -2
  18. data/lib/landrush.rb +0 -12
  19. data/lib/landrush/action/common.rb +5 -5
  20. data/lib/landrush/action/redirect_dns.rb +1 -1
  21. data/lib/landrush/action/setup.rb +9 -14
  22. data/lib/landrush/action/teardown.rb +5 -1
  23. data/lib/landrush/cap/debian/install_iptables.rb +2 -2
  24. data/lib/landrush/cap/linux/add_iptables_rule.rb +0 -1
  25. data/lib/landrush/cap/linux/redirect_dns.rb +0 -1
  26. data/lib/landrush/cap/redhat/install_iptables.rb +2 -2
  27. data/lib/landrush/command.rb +8 -10
  28. data/lib/landrush/config.rb +1 -1
  29. data/lib/landrush/dependent_vms.rb +2 -2
  30. data/lib/landrush/os.rb +19 -0
  31. data/lib/landrush/plugin.rb +4 -4
  32. data/lib/landrush/resolver_config.rb +1 -5
  33. data/lib/landrush/server.rb +187 -25
  34. data/lib/landrush/store.rb +12 -4
  35. data/lib/landrush/version.rb +1 -1
  36. data/test/landrush/action/setup_test.rb +14 -9
  37. data/test/landrush/action/teardown_test.rb +8 -9
  38. data/test/landrush/cap/linux/configured_dns_servers_test.rb +2 -2
  39. data/test/landrush/cap/linux/read_host_visible_ip_address_test.rb +5 -7
  40. data/test/landrush/cap/linux/redirect_dns_test.rb +1 -1
  41. data/test/landrush/resolver_config_test.rb +0 -2
  42. data/test/landrush/server_test.rb +18 -12
  43. data/test/landrush/store_test.rb +7 -6
  44. data/test/support/clear_dependent_vms.rb +4 -2
  45. data/test/support/create_fake_working_dir.rb +19 -0
  46. data/test/support/delete_fake_working_dir.rb +12 -0
  47. data/test/support/fake_resolver_config.rb +8 -3
  48. data/test/support/test_server_daemon.rb +20 -15
  49. data/test/test_helper.rb +31 -22
  50. metadata +26 -28
  51. data/lib/ext/rexec.rb +0 -10
  52. data/test/support/fake_working_dir.rb +0 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3a510542af9198a77fc55d8804dd5052bbfd5bf1
4
- data.tar.gz: ba9c3d6edaf8103e25fd20e116c6e7c920370380
3
+ metadata.gz: dca00c2118b83c6948f4fa0dc6ed8622578a2034
4
+ data.tar.gz: a7f236f3c4f9faa00693066a7abe68cb8a444909
5
5
  SHA512:
6
- metadata.gz: 40f40b883ba0075d027eaff996fc0be8618ec746af2f36fe43c921e43dad247e8837351aec4c8b5e60aad3eb45d3eec085f645b63cb35a36eb5c3039964816db
7
- data.tar.gz: a3e93086f9dc6f6df8e312f13b9de35a7deee40fa201308c9124cc923b1ab13b56db770a3260949fd6f7ea8edfd2a9ba39670642ff5593e5eb421c2c1abf59aa
6
+ metadata.gz: ad79c5ea216a2e430693f94a903a6b2b72811d66737032c0ca29817447aa3fa7ccec9f819f2b370f9da93185abb6c20acaa04f143396297eb87985c89f334ddf
7
+ data.tar.gz: d2f6bd9ab02449069f340633d8c9fdee567922c9b75a38447e82719c125fb4c7393962bb80d857a384bfcea74b9925816fff30fb89216622689db6eb1e594bd8
@@ -0,0 +1,7 @@
1
+ # config/cucumber.yml
2
+ ##YAML Template
3
+ ---
4
+ default: --profile html
5
+
6
+ pretty: --format pretty -b
7
+ html: --format progress --format html --out=build/features_report.html -b
data/.gitignore CHANGED
@@ -1,9 +1,8 @@
1
- *.gem
1
+ .ruby-gemset
2
+ .ruby-version
2
3
  *.rbc
3
4
  .bundle
4
- .config
5
5
  .yardoc
6
- Gemfile.lock
7
6
  InstalledFiles
8
7
  _yardoc
9
8
  coverage
@@ -13,8 +12,11 @@ rdoc
13
12
  spec/reports
14
13
  test/tmp
15
14
  test/version_tmp
15
+ build
16
16
  tmp
17
17
  tags
18
18
 
19
19
  .vagrant
20
- .vagrant_dns.json
20
+
21
+ *.iml
22
+ .idea
data/.rubocop.yml CHANGED
@@ -1 +1,6 @@
1
1
  inherit_from: .rubocop_todo.yml
2
+
3
+ AllCops:
4
+ Exclude:
5
+ - 'build/**/*'
6
+ - 'vendor/**/*'
data/.rubocop_todo.yml CHANGED
@@ -1,27 +1,11 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2016-01-23 20:53:15 +0100 using RuboCop version 0.36.0.
3
+ # on 2016-01-18 12:44:48 +0100 using RuboCop version 0.36.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 1
10
- Lint/DuplicateMethods:
11
- Exclude:
12
- - 'lib/landrush/resolver_config.rb'
13
-
14
- # Offense count: 1
15
- Lint/ParenthesesAsGroupedExpression:
16
- Exclude:
17
- - 'test/landrush/cap/linux/read_host_visible_ip_address_test.rb'
18
-
19
- # Offense count: 1
20
- # Cop supports --auto-correct.
21
- # Configuration parameters: IgnoreEmptyBlocks.
22
- Lint/UnusedBlockArgument:
23
- Exclude:
24
- - 'lib/landrush/action/teardown.rb'
25
9
 
26
10
  # Offense count: 3
27
11
  # Cop supports --auto-correct.
@@ -32,59 +16,42 @@ Lint/UnusedMethodArgument:
32
16
  - 'lib/landrush/config.rb'
33
17
  - 'test/support/fake_ui.rb'
34
18
 
35
- # Offense count: 7
19
+ # Offense count: 8
36
20
  Metrics/AbcSize:
37
- Max: 38
21
+ Max: 36
22
+ Exclude:
23
+ - 'lib/landrush/command.rb'
38
24
 
39
25
  # Offense count: 1
26
+ # Configuration parameters: CountComments.
27
+ Metrics/ClassLength:
28
+ Max: 250
29
+
30
+ # Offense count: 2
40
31
  Metrics/CyclomaticComplexity:
41
32
  Max: 12
42
33
 
43
- # Offense count: 52
34
+ # Offense count: 57
44
35
  # Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
45
36
  # URISchemes: http, https
46
37
  Metrics/LineLength:
47
38
  Max: 157
48
39
 
49
- # Offense count: 6
40
+ # Offense count: 9
50
41
  # Configuration parameters: CountComments.
51
42
  Metrics/MethodLength:
52
- Max: 29
43
+ Max: 30
53
44
 
54
45
  # Offense count: 1
55
46
  Metrics/PerceivedComplexity:
56
47
  Max: 14
57
48
 
58
- # Offense count: 1
59
- # Cop supports --auto-correct.
60
- Performance/RedundantBlockCall:
61
- Exclude:
62
- - 'test/test_helper.rb'
63
-
64
49
  # Offense count: 1
65
50
  # Cop supports --auto-correct.
66
51
  # Configuration parameters: EnforcedStyle, SupportedStyles.
67
52
  # SupportedStyles: prefer_alias, prefer_alias_method
68
53
  Style/Alias:
69
- Exclude:
70
- - 'test/test_helper.rb'
71
-
72
- # Offense count: 1
73
- # Cop supports --auto-correct.
74
- # Configuration parameters: EnforcedStyle, SupportedStyles.
75
- # SupportedStyles: with_first_parameter, with_fixed_indentation
76
- Style/AlignParameters:
77
- Exclude:
78
- - 'Gemfile'
79
-
80
- # Offense count: 2
81
- # Cop supports --auto-correct.
82
- # Configuration parameters: EnforcedStyle, SupportedStyles.
83
- # SupportedStyles: always, conditionals
84
- Style/AndOr:
85
- Exclude:
86
- - 'lib/landrush/action/common.rb'
87
- - 'lib/landrush/action/redirect_dns.rb'
54
+ EnforcedStyle: prefer_alias_method
88
55
 
89
56
  # Offense count: 2
90
57
  # Cop supports --auto-correct.
@@ -95,98 +62,33 @@ Style/BarePercentLiterals:
95
62
  - 'lib/landrush/cap/linux/add_iptables_rule.rb'
96
63
  - 'lib/landrush/cap/linux/read_host_visible_ip_address.rb'
97
64
 
98
- # Offense count: 9
99
- # Cop supports --auto-correct.
100
- # Configuration parameters: EnforcedStyle, SupportedStyles, ProceduralMethods, FunctionalMethods, IgnoredMethods.
101
- # SupportedStyles: line_count_based, semantic, braces_for_chaining
102
- # ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
103
- # FunctionalMethods: let, let!, subject, watch
104
- # IgnoredMethods: lambda, proc, it
105
- Style/BlockDelimiters:
106
- Exclude:
107
- - 'lib/landrush/action/common.rb'
108
- - 'lib/landrush/cap/debian/install_iptables.rb'
109
- - 'lib/landrush/cap/redhat/install_iptables.rb'
110
- - 'lib/landrush/plugin.rb'
111
- - 'test/landrush/cap/linux/read_host_visible_ip_address_test.rb'
112
- - 'test/landrush/store_test.rb'
113
-
114
- # Offense count: 1
65
+ # Offense count: 2
115
66
  # Cop supports --auto-correct.
116
- # Configuration parameters: EnforcedStyle, SupportedStyles.
117
- # SupportedStyles: braces, no_braces, context_dependent
118
- Style/BracesAroundHashParameters:
119
- Exclude:
120
- - 'lib/landrush/server.rb'
121
-
122
- # Offense count: 8
123
- # Configuration parameters: EnforcedStyle, SupportedStyles.
124
- # SupportedStyles: nested, compact
125
- Style/ClassAndModuleChildren:
126
- Exclude:
127
- - 'test/support/clear_dependent_vms.rb'
128
- - 'test/support/fake_resolver_config.rb'
129
- - 'test/support/fake_working_dir.rb'
130
- - 'test/support/test_server_daemon.rb'
131
- - 'test/test_helper.rb'
67
+ # Configuration parameters: IndentWhenRelativeTo, SupportedStyles, IndentOneStep, IndentationWidth.
68
+ # SupportedStyles: case, end
69
+ Style/CaseIndentation:
70
+ Enabled: false
132
71
 
133
- # Offense count: 1
134
- # Cop supports --auto-correct.
135
- Style/ColonMethodCall:
72
+ Style/ConditionalAssignment:
136
73
  Exclude:
137
74
  - 'lib/landrush/server.rb'
138
75
 
139
- # Offense count: 1
140
- # Cop supports --auto-correct.
141
- Style/DeprecatedHashMethods:
142
- Exclude:
143
- - 'lib/landrush/store.rb'
144
-
145
- # Offense count: 22
76
+ # Offense count: 21
146
77
  Style/Documentation:
147
78
  Enabled: false
148
79
 
149
- # Offense count: 1
80
+ # Offense count: 2
150
81
  Style/DoubleNegation:
151
82
  Exclude:
152
83
  - 'lib/landrush/config.rb'
84
+ - 'lib/landrush/server.rb'
153
85
 
154
- # Offense count: 1
155
- # Cop supports --auto-correct.
156
- Style/EmptyLines:
157
- Exclude:
158
- - 'test/landrush/resolver_config_test.rb'
159
-
160
- # Offense count: 3
161
- # Cop supports --auto-correct.
162
- # Configuration parameters: EnforcedStyle, SupportedStyles.
163
- # SupportedStyles: empty_lines, no_empty_lines
164
- Style/EmptyLinesAroundBlockBody:
165
- Exclude:
166
- - 'test/landrush/resolver_config_test.rb'
167
- - 'test/landrush/server_test.rb'
168
-
169
- # Offense count: 1
170
- # Cop supports --auto-correct.
171
- # Configuration parameters: EnforcedStyle, SupportedStyles.
172
- # SupportedStyles: empty_lines, no_empty_lines
173
- Style/EmptyLinesAroundClassBody:
174
- Exclude:
175
- - 'lib/landrush/command.rb'
176
-
177
- # Offense count: 2
178
- # Cop supports --auto-correct.
179
- # Configuration parameters: EnforcedStyle, SupportedStyles.
180
- # SupportedStyles: empty_lines, no_empty_lines
181
- Style/EmptyLinesAroundModuleBody:
182
- Exclude:
183
- - 'test/landrush/cap/linux/read_host_visible_ip_address_test.rb'
184
-
185
- # Offense count: 3
86
+ # Offense count: 4
186
87
  # Configuration parameters: MinBodyLength.
187
88
  Style/GuardClause:
188
89
  Exclude:
189
90
  - 'lib/landrush/action/teardown.rb'
91
+ - 'lib/landrush/server.rb'
190
92
  - 'test/support/fake_resolver_config.rb'
191
93
  - 'test/support/test_server_daemon.rb'
192
94
 
@@ -197,13 +99,14 @@ Style/GuardClause:
197
99
  Style/HashSyntax:
198
100
  Enabled: false
199
101
 
200
- # Offense count: 4
102
+ # Offense count: 9
201
103
  # Cop supports --auto-correct.
202
104
  # Configuration parameters: MaxLineLength.
203
105
  Style/IfUnlessModifier:
204
106
  Exclude:
205
107
  - 'lib/landrush/action/common.rb'
206
108
  - 'lib/landrush/config.rb'
109
+ - 'lib/landrush/server.rb'
207
110
  - 'test/support/fake_resolver_config.rb'
208
111
  - 'test/support/test_server_daemon.rb'
209
112
 
@@ -214,29 +117,12 @@ Style/IfUnlessModifier:
214
117
  Style/IndentArray:
215
118
  EnforcedStyle: consistent
216
119
 
217
- # Offense count: 4
218
- # Cop supports --auto-correct.
219
- Style/Lambda:
220
- Exclude:
221
- - 'lib/landrush/plugin.rb'
222
- - 'test/landrush/action/setup_test.rb'
223
- - 'test/landrush/action/teardown_test.rb'
224
120
 
225
121
  # Offense count: 5
226
122
  # Cop supports --auto-correct.
227
123
  Style/MutableConstant:
228
124
  Exclude:
229
125
  - 'issues/vbox/Vagrantfile'
230
- - 'lib/landrush/action/common.rb'
231
- - 'lib/landrush/command.rb'
232
- - 'lib/landrush/config.rb'
233
- - 'lib/landrush/version.rb'
234
-
235
- # Offense count: 3
236
- # Cop supports --auto-correct.
237
- Style/NegatedIf:
238
- Exclude:
239
- - 'lib/landrush/action/setup.rb'
240
126
 
241
127
  # Offense count: 1
242
128
  # Cop supports --auto-correct.
@@ -246,23 +132,6 @@ Style/Next:
246
132
  Exclude:
247
133
  - 'lib/landrush/action/setup.rb'
248
134
 
249
- # Offense count: 1
250
- # Cop supports --auto-correct.
251
- Style/Not:
252
- Exclude:
253
- - 'lib/landrush/action/setup.rb'
254
-
255
- # Offense count: 2
256
- # Cop supports --auto-correct.
257
- Style/NumericLiterals:
258
- MinDigits: 6
259
-
260
- # Offense count: 2
261
- # Cop supports --auto-correct.
262
- Style/ParallelAssignment:
263
- Exclude:
264
- - 'test/support/test_server_daemon.rb'
265
-
266
135
  # Offense count: 4
267
136
  # Cop supports --auto-correct.
268
137
  # Configuration parameters: PreferredDelimiters.
@@ -281,63 +150,14 @@ Style/PercentQLiterals:
281
150
  Exclude:
282
151
  - 'lib/landrush/cap/linux/read_host_visible_ip_address.rb'
283
152
 
284
- # Offense count: 13
285
- # Cop supports --auto-correct.
286
- Style/Proc:
287
- Exclude:
288
- - 'test/landrush/action/setup_test.rb'
289
- - 'test/landrush/action/teardown_test.rb'
290
-
291
- # Offense count: 2
292
- # Cop supports --auto-correct.
293
- Style/RedundantParentheses:
294
- Exclude:
295
- - 'lib/landrush/store.rb'
296
- - 'test/landrush/cap/linux/read_host_visible_ip_address_test.rb'
297
153
 
298
- # Offense count: 2
299
- # Cop supports --auto-correct.
300
- Style/RedundantSelf:
301
- Exclude:
302
- - 'lib/landrush/dependent_vms.rb'
303
- - 'lib/landrush/server.rb'
304
-
305
- # Offense count: 2
154
+ # Offense count: 7
306
155
  # Cop supports --auto-correct.
307
156
  Style/RescueModifier:
308
157
  Exclude:
309
158
  - 'lib/landrush/server.rb'
310
159
  - 'lib/landrush/store.rb'
311
-
312
- # Offense count: 1
313
- # Cop supports --auto-correct.
314
- # Configuration parameters: AllowAsExpressionSeparator.
315
- Style/Semicolon:
316
- Exclude:
317
- - 'lib/landrush/resolver_config.rb'
318
-
319
- # Offense count: 4
320
- # Cop supports --auto-correct.
321
- # Configuration parameters: EnforcedStyle, SupportedStyles.
322
- # SupportedStyles: only_raise, only_fail, semantic
323
- Style/SignalException:
324
- Exclude:
325
- - 'lib/landrush/action/common.rb'
326
- - 'lib/landrush/cap/linux/read_host_visible_ip_address.rb'
327
- - 'lib/landrush/command.rb'
328
-
329
- # Offense count: 2
330
- # Cop supports --auto-correct.
331
- Style/SpaceAfterComma:
332
- Exclude:
333
- - 'lib/landrush/command.rb'
334
- - 'test/test_helper.rb'
335
-
336
- # Offense count: 1
337
- # Cop supports --auto-correct.
338
- Style/SpaceAfterMethodName:
339
- Exclude:
340
- - 'lib/landrush/server.rb'
160
+ - 'test/landrush/server_test.rb'
341
161
 
342
162
  # Offense count: 6
343
163
  # Cop supports --auto-correct.
@@ -346,14 +166,7 @@ Style/SpaceAfterMethodName:
346
166
  Style/SpaceAroundEqualsInParameterDefault:
347
167
  Enabled: false
348
168
 
349
- # Offense count: 2
350
- # Cop supports --auto-correct.
351
- # Configuration parameters: AllowForAlignment.
352
- Style/SpaceAroundOperators:
353
- Exclude:
354
- - 'test/landrush/server_test.rb'
355
-
356
- # Offense count: 2
169
+ # Offense count: 4
357
170
  # Cop supports --auto-correct.
358
171
  # Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
359
172
  # SupportedStyles: space, no_space
@@ -367,14 +180,14 @@ Style/SpaceInsideBlockBraces:
367
180
  Style/SpaceInsideHashLiteralBraces:
368
181
  Enabled: false
369
182
 
370
- # Offense count: 2
183
+ # Offense count: 3
371
184
  # Cop supports --auto-correct.
372
185
  # Configuration parameters: EnforcedStyle, SupportedStyles.
373
186
  # SupportedStyles: use_perl_names, use_english_names
374
187
  Style/SpecialGlobalVars:
375
188
  Enabled: false
376
189
 
377
- # Offense count: 61
190
+ # Offense count: 62
378
191
  # Cop supports --auto-correct.
379
192
  # Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
380
193
  # SupportedStyles: single_quotes, double_quotes
@@ -389,40 +202,6 @@ Style/SymbolProc:
389
202
  Exclude:
390
203
  - 'lib/landrush/cap/linux/read_host_visible_ip_address.rb'
391
204
 
392
- # Offense count: 4
393
- # Cop supports --auto-correct.
394
- # Configuration parameters: EnforcedStyle, SupportedStyles.
395
- # SupportedStyles: final_newline, final_blank_line
396
- Style/TrailingBlankLines:
397
- Exclude:
398
- - 'lib/landrush/cap/linux/add_iptables_rule.rb'
399
- - 'lib/landrush/cap/linux/redirect_dns.rb'
400
- - 'test/landrush/action/teardown_test.rb'
401
- - 'test/support/fake_working_dir.rb'
402
-
403
- # Offense count: 1
404
- # Cop supports --auto-correct.
405
- # Configuration parameters: EnforcedStyleForMultiline, SupportedStyles.
406
- # SupportedStyles: comma, consistent_comma, no_comma
407
- Style/TrailingCommaInArguments:
408
- Exclude:
409
- - 'test/landrush/cap/linux/redirect_dns_test.rb'
410
-
411
- # Offense count: 3
412
- # Cop supports --auto-correct.
413
- # Configuration parameters: EnforcedStyleForMultiline, SupportedStyles.
414
- # SupportedStyles: comma, consistent_comma, no_comma
415
- Style/TrailingCommaInLiteral:
416
- Exclude:
417
- - 'lib/landrush/action/common.rb'
418
- - 'test/landrush/cap/linux/configured_dns_servers_test.rb'
419
-
420
- # Offense count: 1
421
- # Cop supports --auto-correct.
422
- Style/TrailingWhitespace:
423
- Exclude:
424
- - 'examples/Vagrantfile'
425
-
426
205
  # Offense count: 2
427
206
  # Cop supports --auto-correct.
428
207
  # Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, IgnoreClassMethods, Whitelist.
@@ -432,12 +211,6 @@ Style/TrivialAccessors:
432
211
  - 'lib/landrush/config.rb'
433
212
  - 'lib/landrush/server.rb'
434
213
 
435
- # Offense count: 2
436
- # Cop supports --auto-correct.
437
- Style/UnneededInterpolation:
438
- Exclude:
439
- - 'lib/landrush/command.rb'
440
-
441
214
  # Offense count: 3
442
215
  # Cop supports --auto-correct.
443
216
  Style/UnneededPercentQ: