derelict 0.6.2.travis.150 → 0.6.2.travis.152
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/derelict/parser/plugin_list.rb +9 -6
- data/spec/derelict/parser/plugin_list_spec.rb +45 -32
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NWE0ZDM5MDliYzY0Y2EzMDIxMGQzNzU5ZDBkZGExZTk4YzNjOGY3YQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTQzMDUzMTE4MmQzMzVjMmJlNWE1NTQ0NjUyNWJhMTA0MWUyOTNjZA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OTBkNDFkMzJmZWJhNTY4ZjZhMzQwMWEzMGZlMTllYTFkYzEyN2ZjZWMzOGI5
|
10
|
+
YTU3Zjc1MWM5M2I2MGFlNmFiZGFhOTVmNTRhYjQ5NjZlZDBlN2FiOTY1OGE4
|
11
|
+
M2U1OThhMmUyM2RhOWMxNWIzYjdiZGNjYjI5NmYwYzE2MjQ0NTA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODY3ZTRmMTQ5ZDQyOGJiYjlmZjljMjkzOGE0MTZiYzlkYjg0ZTJlZjIxOTRj
|
14
|
+
NzFmMDg4MDdmZjIyYjc1MGZmNjNjNjFhMTM1ZDRkMGZkZWUzNGE4ZGM5YjE4
|
15
|
+
ZWQ5YjNhMTY1YTc2MTM4OTZjNzUyMjc2ZjJiYmEwMGIwNjJjMmM=
|
@@ -14,11 +14,14 @@ module Derelict
|
|
14
14
|
# 1. Plugin name, as listed in the output
|
15
15
|
# 2. Currently installed version (without surrounding brackets)
|
16
16
|
PARSE_PLUGIN = %r[
|
17
|
-
^(
|
18
|
-
\
|
19
|
-
\(
|
20
|
-
|
21
|
-
|
17
|
+
^([A-Za-z0-9\-_.]+) # Plugin name starts at the start of the line.
|
18
|
+
\ # Version is separated by a space character,
|
19
|
+
\( # surrounded by brackets,
|
20
|
+
([0-9\-_.]+) # consists of numbers, hyphens, underscore, dot,
|
21
|
+
(, .*)? # optionally followed by a comma space and word
|
22
|
+
\)
|
23
|
+
$ # at the end of the line.
|
24
|
+
]x # Ignore whitespace to allow these comments.
|
22
25
|
|
23
26
|
# Regexp to determine whether plugins need to be reinstalled
|
24
27
|
NEEDS_REINSTALL = %r[
|
@@ -48,7 +51,7 @@ module Derelict
|
|
48
51
|
# Retrieves an array of the plugin lines in the output
|
49
52
|
def plugin_lines
|
50
53
|
return [] if output.match /no plugins installed/i
|
51
|
-
output.lines
|
54
|
+
output.lines.grep(/^\w/)
|
52
55
|
end
|
53
56
|
|
54
57
|
# Parses a single line of the output into a Plugin object
|
@@ -1,22 +1,25 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
describe Derelict::Parser::PluginList do
|
4
|
-
|
4
|
+
let(:parser) { Derelict::Parser::PluginList.new output }
|
5
5
|
let(:output) { nil }
|
6
|
+
subject { parser }
|
6
7
|
|
7
8
|
it "is autoloaded" do
|
8
9
|
should be_a Derelict::Parser::PluginList
|
9
10
|
end
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
12
|
+
describe "#plugins" do
|
13
|
+
subject { parser.plugins }
|
14
|
+
|
15
|
+
context "with valid output" do
|
16
|
+
let(:output) {
|
17
|
+
<<-END.gsub /^ +/, ""
|
18
|
+
foo (2.3.4)
|
19
|
+
bar (1.2.3, system)
|
20
|
+
END
|
21
|
+
}
|
18
22
|
|
19
|
-
describe "#plugins" do
|
20
23
|
subject { Derelict::Parser::PluginList.new(output).plugins }
|
21
24
|
let(:foo) { Derelict::Plugin.new "foo", "2.3.4" }
|
22
25
|
let(:bar) { Derelict::Plugin.new "bar", "1.2.3" }
|
@@ -26,35 +29,45 @@ describe Derelict::Parser::PluginList do
|
|
26
29
|
let(:expected_logs) {[
|
27
30
|
"DEBUG pluginlist: Successfully initialized Derelict::Parser::PluginList instance\n",
|
28
31
|
]}
|
29
|
-
end
|
30
|
-
end
|
31
32
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
33
|
+
context "with version constraints" do
|
34
|
+
let(:output) {
|
35
|
+
<<-END.gsub /^ {12}/, ""
|
36
|
+
foo (5.6.7)
|
37
|
+
- Version Constraint: 5.6.7
|
38
|
+
bar-baz (0.1.1, system)
|
39
|
+
END
|
40
|
+
}
|
39
41
|
|
40
|
-
|
41
|
-
|
42
|
-
|
42
|
+
let(:foo) { Derelict::Plugin.new "foo", "5.6.7" }
|
43
|
+
let(:bar) { Derelict::Plugin.new "bar-baz", "0.1.1" }
|
44
|
+
it { should eq Set[foo, bar] }
|
45
|
+
end
|
46
|
+
end
|
43
47
|
|
44
|
-
|
45
|
-
|
48
|
+
context "with plugins needing re-install" do
|
49
|
+
let(:output) {
|
50
|
+
<<-END.gsub /^ {10}/, ""
|
51
|
+
The following plugins were installed with a version of Vagrant
|
52
|
+
that had different versions of underlying components. Because
|
53
|
+
these component versions were changed (which rarely happens),
|
54
|
+
the plugins must be uninstalled and reinstalled.
|
46
55
|
|
47
|
-
|
48
|
-
|
56
|
+
To ensure that all the dependencies are properly updated as well
|
57
|
+
it is _highly recommended_ to do a `vagrant plugin uninstall`
|
58
|
+
prior to reinstalling.
|
49
59
|
|
50
|
-
|
51
|
-
|
52
|
-
bar (1.2.3)
|
53
|
-
END
|
54
|
-
}
|
60
|
+
This message will not go away until all the plugins below are
|
61
|
+
either uninstalled or uninstalled then reinstalled.
|
55
62
|
|
56
|
-
|
57
|
-
|
63
|
+
The plugins below will not be loaded until they're uninstalled
|
64
|
+
and reinstalled:
|
65
|
+
|
66
|
+
foo, bar
|
67
|
+
foo (2.3.4)
|
68
|
+
bar (1.2.3)
|
69
|
+
END
|
70
|
+
}
|
58
71
|
|
59
72
|
it "should raise NeedsReinstall" do
|
60
73
|
expect { subject }.to raise_error(Derelict::Parser::PluginList::NeedsReinstall)
|