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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e6e84117a1e8c9c8e87564646be2035584aee1d907a283fa353f56079e7fa81a
4
- data.tar.gz: 8491724b3eea6c326131ec854063daee113b032a5a62b81201e35e8ad5520e9f
3
+ metadata.gz: c92de18137a085d1c696e351c029f6b22ccc5a42949c65052082bb43aa2fc753
4
+ data.tar.gz: ae5ffde7a03f7282c007af427d9d08c64ea80243b17e7d1d53667e07b3347b64
5
5
  SHA512:
6
- metadata.gz: 5d7f2c7e89d464d29f8bb7d471d63debd45137c71fc26d4f9f8b5dfca2366053c9b540e498a4df7393c393f4a2499cdd2e868f6e1d5a29802067684994c7ea20
7
- data.tar.gz: 140c8a23e42241cb808fa8056c52cecfb59853f31cf5765b2e1db0a5d2bad2736491fa494324a194bcae490c7d49e8069893fbe51cf0320282c0091e2f677651
6
+ metadata.gz: 2287fb636728d1d51a50916c9d16e0756c88e88e0d422b8c9462d3f6c4266675c6fce29a231b9cbd8397f809724967a58657a598478a4a317af9e637713b3a8c
7
+ data.tar.gz: 1a011fce3cf92df2469c068c00fd125274dfd18326406b900e5206fbd6424d611921d707f70dc6a62119b9a702d95008ac9f2a05f8f62e16681ca09c601c173c
@@ -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?
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Bundler
4
4
  module Why
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundler-why-plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroshi SHIBATA