derelict 0.4.6.travis.138 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/lib/derelict/parser/plugin_list.rb +13 -0
- data/lib/derelict/parser/plugin_list/needs_reinstall.rb +22 -0
- data/lib/derelict/version.rb +1 -1
- data/spec/derelict/parser/plugin_list/needs_reinstall_spec.rb +13 -0
- data/spec/derelict/parser/plugin_list_spec.rb +38 -0
- metadata +29 -32
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
ZTJlMGEyM2VmNWI3MGJmOGY5Y2FmZTljZjExYmNlZjUwZDAxMjE1Nw==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1c0ffe1f2cd0279558ae6d336d1abc9426f1cb99
|
4
|
+
data.tar.gz: f9a0e27672e4afdd4e956f980d31e96345670401
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
ZTg4MGYzNDYyZGFkYjMwNmI5NTc0NTYzZTlkYzM1ZjQ3ZDdhNTMyNjBkZTQ1
|
11
|
-
Y2Y3MmUxOWU5NjhmYzZlZTY4MzA2MmNlODE0NDVjMDAzNDU3MmI=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
OTE5YTJiODkwMGY5NWUzM2RkNTQ3MzY5MzlmZTUyMmYxNWQ2ODgzYjQ1ODli
|
14
|
-
ZGQ4MmJkYzczYmE0NzkxMDE2ZmE3YzFlNDYxNjY3YzdhMjBlNjRlZDQ4NzYy
|
15
|
-
ZmE4YzNjNTkwN2VhZGYzOWNhZjAzNjUxOGQ4N2RjNzk3ZjMxZjg=
|
6
|
+
metadata.gz: 4da8abea8b7af3f379a5fce2bd6bb6dd2db6da87e1bef5e3fb532faaefb1b9d06743ef9cf4a39f9f72345c80b76c03182178f96a7542dc08d6b9d4d8ecbbcccc
|
7
|
+
data.tar.gz: 6599b1378608388aee7965c6b8066faa94cdbf70054ee5e96d766b63502a7f857c955735e2d4eca86052b7b1f97747d649802e13915db120dce92bd647f04dfb
|
@@ -2,6 +2,7 @@ module Derelict
|
|
2
2
|
# Parses the output of "vagrant plugin list"
|
3
3
|
class Parser::PluginList < Parser
|
4
4
|
autoload :InvalidFormat, "derelict/parser/plugin_list/invalid_format"
|
5
|
+
autoload :NeedsReinstall, "derelict/parser/plugin_list/needs_reinstall"
|
5
6
|
|
6
7
|
# Include "memoize" class method to memoize methods
|
7
8
|
extend Memoist
|
@@ -19,11 +20,23 @@ module Derelict
|
|
19
20
|
$ # at the end of the line.
|
20
21
|
]x # Ignore whitespace to allow these comments.
|
21
22
|
|
23
|
+
# Regexp to determine whether plugins need to be reinstalled
|
24
|
+
NEEDS_REINSTALL = %r[
|
25
|
+
^The\splugins\sbelow\swill\snot\sbe\sloaded\suntil\sthey're\s
|
26
|
+
uninstalled\sand\sreinstalled:$
|
27
|
+
]x
|
28
|
+
|
22
29
|
# Retrieves a Set containing all the plugins from the output
|
23
30
|
def plugins
|
31
|
+
raise NeedsReinstall, output if needs_reinstall?
|
24
32
|
plugin_lines.map {|l| parse_line l.match(PARSE_PLUGIN) }.to_set
|
25
33
|
end
|
26
34
|
|
35
|
+
# Determines if old plugins need to be reinstalled
|
36
|
+
def needs_reinstall?
|
37
|
+
output =~ NEEDS_REINSTALL
|
38
|
+
end
|
39
|
+
|
27
40
|
# Provides a description of this Parser
|
28
41
|
#
|
29
42
|
# Mainly used for log messages.
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Derelict
|
2
|
+
class Parser
|
3
|
+
class PluginList
|
4
|
+
# Vagrant plugins need to be uninstalled and re-installed
|
5
|
+
class NeedsReinstall < Derelict::Exception
|
6
|
+
# Retrieves the output from Vagrant
|
7
|
+
attr_reader :output
|
8
|
+
|
9
|
+
# Initializes a new instance, for a particular box name/provider
|
10
|
+
#
|
11
|
+
# * output: The output from Vagrant
|
12
|
+
def initialize(output)
|
13
|
+
@output = output
|
14
|
+
super <<-END.gsub(/\s+/, ' ').strip
|
15
|
+
Vagrant plugins installed before upgrading to version 1.4.x
|
16
|
+
need to be uninstalled and re-installed.
|
17
|
+
END
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/derelict/version.rb
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Derelict::Parser::PluginList::NeedsReinstall do
|
4
|
+
let(:output) { double("output") }
|
5
|
+
subject { Derelict::Parser::PluginList::NeedsReinstall.new output }
|
6
|
+
|
7
|
+
it "is autoloaded" do
|
8
|
+
should be_a Derelict::Parser::PluginList::NeedsReinstall
|
9
|
+
end
|
10
|
+
|
11
|
+
its(:message) { should eq "Vagrant plugins installed before upgrading to version 1.4.x need to be uninstalled and re-installed." }
|
12
|
+
its(:output) { should be output }
|
13
|
+
end
|
@@ -28,4 +28,42 @@ describe Derelict::Parser::PluginList do
|
|
28
28
|
]}
|
29
29
|
end
|
30
30
|
end
|
31
|
+
|
32
|
+
context "with plugins needing re-install" do
|
33
|
+
let(:output) {
|
34
|
+
<<-END.gsub /^ {8}/, ""
|
35
|
+
The following plugins were installed with a version of Vagrant
|
36
|
+
that had different versions of underlying components. Because
|
37
|
+
these component versions were changed (which rarely happens),
|
38
|
+
the plugins must be uninstalled and reinstalled.
|
39
|
+
|
40
|
+
To ensure that all the dependencies are properly updated as well
|
41
|
+
it is _highly recommended_ to do a `vagrant plugin uninstall`
|
42
|
+
prior to reinstalling.
|
43
|
+
|
44
|
+
This message will not go away until all the plugins below are
|
45
|
+
either uninstalled or uninstalled then reinstalled.
|
46
|
+
|
47
|
+
The plugins below will not be loaded until they're uninstalled
|
48
|
+
and reinstalled:
|
49
|
+
|
50
|
+
foo, bar
|
51
|
+
foo (2.3.4)
|
52
|
+
bar (1.2.3)
|
53
|
+
END
|
54
|
+
}
|
55
|
+
|
56
|
+
describe "#plugins" do
|
57
|
+
subject { Derelict::Parser::PluginList.new(output).plugins }
|
58
|
+
|
59
|
+
it "should raise NeedsReinstall" do
|
60
|
+
expect { subject }.to raise_error(Derelict::Parser::PluginList::NeedsReinstall)
|
61
|
+
end
|
62
|
+
|
63
|
+
include_context "logged messages"
|
64
|
+
let(:expected_logs) {[
|
65
|
+
"DEBUG pluginlist: Successfully initialized Derelict::Parser::PluginList instance\n",
|
66
|
+
]}
|
67
|
+
end
|
68
|
+
end
|
31
69
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: derelict
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brad Feehan
|
@@ -17,7 +17,7 @@ dependencies:
|
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 1.1.0
|
20
|
-
- -
|
20
|
+
- - '!='
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 1.1.11
|
23
23
|
type: :runtime
|
@@ -27,35 +27,35 @@ dependencies:
|
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: 1.1.0
|
30
|
-
- -
|
30
|
+
- - '!='
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 1.1.11
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: memoist
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- -
|
37
|
+
- - '>='
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
version: '0'
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
|
-
- -
|
44
|
+
- - '>='
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '0'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: open4
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- -
|
51
|
+
- - '>='
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '0'
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
|
-
- -
|
58
|
+
- - '>='
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '0'
|
61
61
|
- !ruby/object:Gem::Dependency
|
@@ -76,84 +76,84 @@ dependencies:
|
|
76
76
|
name: cane
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
|
-
- -
|
79
|
+
- - '>='
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
version: '0'
|
82
82
|
type: :development
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
|
-
- -
|
86
|
+
- - '>='
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '0'
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: coveralls
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
|
-
- -
|
93
|
+
- - '>='
|
94
94
|
- !ruby/object:Gem::Version
|
95
95
|
version: '0'
|
96
96
|
type: :development
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
|
-
- -
|
100
|
+
- - '>='
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: '0'
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: rake
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
|
-
- -
|
107
|
+
- - '>='
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: '0'
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
|
-
- -
|
114
|
+
- - '>='
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: '0'
|
117
117
|
- !ruby/object:Gem::Dependency
|
118
118
|
name: rspec
|
119
119
|
requirement: !ruby/object:Gem::Requirement
|
120
120
|
requirements:
|
121
|
-
- -
|
121
|
+
- - '>='
|
122
122
|
- !ruby/object:Gem::Version
|
123
123
|
version: '0'
|
124
124
|
type: :development
|
125
125
|
prerelease: false
|
126
126
|
version_requirements: !ruby/object:Gem::Requirement
|
127
127
|
requirements:
|
128
|
-
- -
|
128
|
+
- - '>='
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '0'
|
131
131
|
- !ruby/object:Gem::Dependency
|
132
132
|
name: simplecov
|
133
133
|
requirement: !ruby/object:Gem::Requirement
|
134
134
|
requirements:
|
135
|
-
- -
|
135
|
+
- - '>='
|
136
136
|
- !ruby/object:Gem::Version
|
137
137
|
version: '0'
|
138
138
|
type: :development
|
139
139
|
prerelease: false
|
140
140
|
version_requirements: !ruby/object:Gem::Requirement
|
141
141
|
requirements:
|
142
|
-
- -
|
142
|
+
- - '>='
|
143
143
|
- !ruby/object:Gem::Version
|
144
144
|
version: '0'
|
145
145
|
- !ruby/object:Gem::Dependency
|
146
146
|
name: its
|
147
147
|
requirement: !ruby/object:Gem::Requirement
|
148
148
|
requirements:
|
149
|
-
- -
|
149
|
+
- - '>='
|
150
150
|
- !ruby/object:Gem::Version
|
151
151
|
version: '0'
|
152
152
|
type: :development
|
153
153
|
prerelease: false
|
154
154
|
version_requirements: !ruby/object:Gem::Requirement
|
155
155
|
requirements:
|
156
|
-
- -
|
156
|
+
- - '>='
|
157
157
|
- !ruby/object:Gem::Version
|
158
158
|
version: '0'
|
159
159
|
- !ruby/object:Gem::Dependency
|
@@ -170,16 +170,10 @@ dependencies:
|
|
170
170
|
- - <
|
171
171
|
- !ruby/object:Gem::Version
|
172
172
|
version: '2.0'
|
173
|
-
description:
|
174
|
-
via the Installer package on Mac OS X.
|
173
|
+
description: |-
|
174
|
+
Provides a Ruby API to control Vagrant where Vagrant is installed via the Installer package on Mac OS X.
|
175
175
|
|
176
|
-
|
177
|
-
Vagrant was historically available as a gem, naturally providing a Ruby API to control
|
178
|
-
Vagrant in other Ruby libraries and applications. However, since version 1.1.0,
|
179
|
-
Vagrant is distributed exclusively using an Installer package. To control Vagrant
|
180
|
-
when it''s installed this way, other Ruby libraries and applications typically need
|
181
|
-
to invoke the Vagrant binary, which requires forking a new process and parsing its
|
182
|
-
output using string manipulation.'
|
176
|
+
Vagrant was historically available as a gem, naturally providing a Ruby API to control Vagrant in other Ruby libraries and applications. However, since version 1.1.0, Vagrant is distributed exclusively using an Installer package. To control Vagrant when it's installed this way, other Ruby libraries and applications typically need to invoke the Vagrant binary, which requires forking a new process and parsing its output using string manipulation.
|
183
177
|
email:
|
184
178
|
- git@bradfeehan.com
|
185
179
|
executables: []
|
@@ -216,6 +210,7 @@ files:
|
|
216
210
|
- lib/derelict/parser/box_list/invalid_format.rb
|
217
211
|
- lib/derelict/parser/plugin_list.rb
|
218
212
|
- lib/derelict/parser/plugin_list/invalid_format.rb
|
213
|
+
- lib/derelict/parser/plugin_list/needs_reinstall.rb
|
219
214
|
- lib/derelict/parser/status.rb
|
220
215
|
- lib/derelict/parser/status/invalid_format.rb
|
221
216
|
- lib/derelict/parser/version.rb
|
@@ -251,6 +246,7 @@ files:
|
|
251
246
|
- spec/derelict/parser/box_list/invalid_format_spec.rb
|
252
247
|
- spec/derelict/parser/box_list_spec.rb
|
253
248
|
- spec/derelict/parser/plugin_list/invalid_format_spec.rb
|
249
|
+
- spec/derelict/parser/plugin_list/needs_reinstall_spec.rb
|
254
250
|
- spec/derelict/parser/plugin_list_spec.rb
|
255
251
|
- spec/derelict/parser/status/invalid_format_spec.rb
|
256
252
|
- spec/derelict/parser/status_spec.rb
|
@@ -280,17 +276,17 @@ require_paths:
|
|
280
276
|
- lib
|
281
277
|
required_ruby_version: !ruby/object:Gem::Requirement
|
282
278
|
requirements:
|
283
|
-
- -
|
279
|
+
- - '>='
|
284
280
|
- !ruby/object:Gem::Version
|
285
281
|
version: '0'
|
286
282
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
287
283
|
requirements:
|
288
|
-
- -
|
284
|
+
- - '>='
|
289
285
|
- !ruby/object:Gem::Version
|
290
|
-
version:
|
286
|
+
version: '0'
|
291
287
|
requirements: []
|
292
288
|
rubyforge_project:
|
293
|
-
rubygems_version: 2.
|
289
|
+
rubygems_version: 2.0.3
|
294
290
|
signing_key:
|
295
291
|
specification_version: 4
|
296
292
|
summary: Ruby API for Vagrant installed via Installer package on Mac OS X.
|
@@ -314,6 +310,7 @@ test_files:
|
|
314
310
|
- spec/derelict/parser/box_list/invalid_format_spec.rb
|
315
311
|
- spec/derelict/parser/box_list_spec.rb
|
316
312
|
- spec/derelict/parser/plugin_list/invalid_format_spec.rb
|
313
|
+
- spec/derelict/parser/plugin_list/needs_reinstall_spec.rb
|
317
314
|
- spec/derelict/parser/plugin_list_spec.rb
|
318
315
|
- spec/derelict/parser/status/invalid_format_spec.rb
|
319
316
|
- spec/derelict/parser/status_spec.rb
|