derelict 0.6.2.travis.150 → 0.6.2.travis.152

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NzExZDdjOWFlYzExYjk1OTkzMTllYmVkYzgzODc3YTBlYzI5MGIxMg==
4
+ NWE0ZDM5MDliYzY0Y2EzMDIxMGQzNzU5ZDBkZGExZTk4YzNjOGY3YQ==
5
5
  data.tar.gz: !binary |-
6
- YTY1M2U2YmE5MWY0NWRmMTIxM2JmYjg0N2I2ZDNjNWYzY2MzYTNkMw==
6
+ MTQzMDUzMTE4MmQzMzVjMmJlNWE1NTQ0NjUyNWJhMTA0MWUyOTNjZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZGI4M2MyYTNiYzBjMzE5NDA0ZmI4NDhkNjA3YWQ5YTJjOWZkMDNiYzcxYTZl
10
- NDYxMzUyMDllZWIxYmExM2M4NzBlOWQxN2E5ZTg2YmFlYzIwOGQzMzllZjRh
11
- M2EyZjMxZDhjODE1ZTc5OTA2ZjVhODNkMTMzNmNiMjllM2MxMGU=
9
+ OTBkNDFkMzJmZWJhNTY4ZjZhMzQwMWEzMGZlMTllYTFkYzEyN2ZjZWMzOGI5
10
+ YTU3Zjc1MWM5M2I2MGFlNmFiZGFhOTVmNTRhYjQ5NjZlZDBlN2FiOTY1OGE4
11
+ M2U1OThhMmUyM2RhOWMxNWIzYjdiZGNjYjI5NmYwYzE2MjQ0NTA=
12
12
  data.tar.gz: !binary |-
13
- MjIyMjYyNjA0ZmRmOTAyMzgxZjA0ODg0YmRhYWNmYjAzMzQyNjJhZGI5Yzdj
14
- YjEyNTI5NTQzYzZlYzYzODlhMmVmYTFmZTllOGM3MWJlYWZmMWFkZDZkN2U0
15
- N2UzOGM0YmMyYWVlOTdhZjk5NzQ1NmQ0ODRmMjZhZDYzZTQ0MDQ=
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
- ^(.*) # Plugin name starts at the start of the line.
18
- \ # Version is separated by a space character,
19
- \(([0-9\-_.]+)(, .*)?\) # contains version string surrounded by brackets
20
- $ # at the end of the line.
21
- ]x # Ignore whitespace to allow these comments.
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
- subject { Derelict::Parser::PluginList.new output }
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
- context "with valid output" do
12
- let(:output) {
13
- <<-END.gsub /^ +/, ""
14
- foo (2.3.4)
15
- bar (1.2.3, system)
16
- END
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
- 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.
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
- 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.
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
- This message will not go away until all the plugins below are
45
- either uninstalled or uninstalled then reinstalled.
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
- The plugins below will not be loaded until they're uninstalled
48
- and reinstalled:
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
- foo, bar
51
- foo (2.3.4)
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
- describe "#plugins" do
57
- subject { Derelict::Parser::PluginList.new(output).plugins }
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)
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.6.2.travis.150
4
+ version: 0.6.2.travis.152
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brad Feehan