rubygems-path 0.1.0

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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/rubygems_plugin.rb +26 -0
  3. metadata +44 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: bcb5dd7d55e602f4e8496539aa6cbe16dace1ad3e6955d9c660f5833b0c082f5
4
+ data.tar.gz: e35b5ef705896edf51778b0f2d4f86929d7fc2988e16ffc211b2f7acb8701f16
5
+ SHA512:
6
+ metadata.gz: 6212a0b3072b5d704b75df903dbd80d77af2797921d7731f17e5bce9ac59644bc68ad393556a3c9051fa18e3848f26fc5055aa24a8010465d78e24df865d2668
7
+ data.tar.gz: 71b3e871e92755490496bdae66bc0b507d622346d4425575930ad43c6bb41b841ae5c7879f21c275fe7920c42bec7fbe1c16e225e79e888cee77a064ec78fbbc
@@ -0,0 +1,26 @@
1
+ Gem::CommandManager.instance.register_command :path
2
+
3
+
4
+ class Gem::Commands::PathCommand < Gem::Command
5
+
6
+ def initialize
7
+ super "path", "Display gem install path"
8
+ end
9
+
10
+ def execute
11
+ name = get_one_gem_name
12
+ gemspec = find_by_name(name)
13
+ puts gemspec.full_gem_path
14
+ rescue Gem::LoadError
15
+ alert_error "gem '#{name}' not found"
16
+ terminate_interaction 1
17
+ end
18
+
19
+ def find_by_name(*args)
20
+ if Gem::Specification.respond_to?(:find_by_name)
21
+ Gem::Specification.find_by_name(*args)
22
+ else
23
+ Gem.source_index.find_name(*args).last or raise Gem::LoadError
24
+ end
25
+ end
26
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rubygems-path
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Grigory Petrov
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-06-11 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email:
15
+ - grigoryvp@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/rubygems_plugin.rb
21
+ homepage: https://github.com/grigoryvp/rubygems-path
22
+ licenses:
23
+ - MIT
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubygems_version: 3.3.7
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: Adds the "gem path" command to rubygems that displays a gem install path.
44
+ test_files: []