bundler-why-plugin 0.1.0 → 0.1.1
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 +4 -4
- data/lib/bundler/why/cli.rb +19 -0
- data/lib/bundler/why/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c92de18137a085d1c696e351c029f6b22ccc5a42949c65052082bb43aa2fc753
|
|
4
|
+
data.tar.gz: ae5ffde7a03f7282c007af427d9d08c64ea80243b17e7d1d53667e07b3347b64
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2287fb636728d1d51a50916c9d16e0756c88e88e0d422b8c9462d3f6c4266675c6fce29a231b9cbd8397f809724967a58657a598478a4a317af9e637713b3a8c
|
|
7
|
+
data.tar.gz: 1a011fce3cf92df2469c068c00fd125274dfd18326406b900e5206fbd6424d611921d707f70dc6a62119b9a702d95008ac9f2a05f8f62e16681ca09c601c173c
|
data/lib/bundler/why/cli.rb
CHANGED
|
@@ -6,6 +6,25 @@ require "bundler/why/dependency_resolver"
|
|
|
6
6
|
module Bundler
|
|
7
7
|
module Why
|
|
8
8
|
class CLI < Thor
|
|
9
|
+
# Allow running `bundle why <package>` without specifying the command name
|
|
10
|
+
default_task :why
|
|
11
|
+
|
|
12
|
+
# Thor expects the first arg to be a task name. Bundler passes only
|
|
13
|
+
# the gem name (e.g. `minitest`), so route unknown commands to `why`.
|
|
14
|
+
def self.start(given_args = ARGV, config = {})
|
|
15
|
+
if given_args.empty?
|
|
16
|
+
return super
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
first = given_args.first
|
|
20
|
+
known = tasks.keys + %w[help]
|
|
21
|
+
if known.include?(first)
|
|
22
|
+
super(given_args, config)
|
|
23
|
+
else
|
|
24
|
+
super(["why"] + given_args, config)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
9
28
|
desc "why PACKAGE", "Show why a specific package is installed"
|
|
10
29
|
def why(package_name = nil)
|
|
11
30
|
if package_name.nil?
|
data/lib/bundler/why/version.rb
CHANGED