lapidarius 3.2.1 → 3.3.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.
- checksums.yaml +4 -4
- data/README.md +8 -1
- data/bin/lapidarius +2 -1
- data/lib/lapidarius/cli.rb +30 -23
- data/lib/lapidarius/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 268fbbb37aad0f18ae71017ff634a75f3d8a4bf4
|
4
|
+
data.tar.gz: bcd7b8100f25e2bd669a89a181d19a613da03a18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca1312eb554fa5a9678e5cd73f4a5c955740ee787e243d427940f72f1da05303625165a65d8f4229c9f6af499c3d75946aef8cc05064acdaecbed07153290d35
|
7
|
+
data.tar.gz: edc16c5b9cea8e4aff955c76ca4e76823108df62bbbbdc6330cf3bdad87df85e6a11a2d5adc96df5001537828f9d6a70ebfd99e3b5261eb31d9c8c86a5ee11d2
|
data/README.md
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
* [gem dep](#gem-dep)
|
6
6
|
* [bundle viz](#bundle-viz)
|
7
7
|
* [Warning](#warning)
|
8
|
+
* [Installation](#installation)
|
8
9
|
* [Usage](#usage)
|
9
10
|
|
10
11
|
## Scope
|
@@ -25,13 +26,19 @@ While it is great to visualize inter-dependencies, i have hard times figuring ou
|
|
25
26
|
Consider only the gems installed on your system are scanned by the library.
|
26
27
|
No remote fetching is performed.
|
27
28
|
|
29
|
+
## Installation
|
30
|
+
Install the gem from your shell:
|
31
|
+
```shell
|
32
|
+
gem install lapidarius
|
33
|
+
```
|
34
|
+
|
28
35
|
## Usage
|
29
36
|
This library invokes the `Gem::Commands::DependencyCommand` class recursively to collect all the levels of dependency.
|
30
37
|
Both runtime and development dependencies are counted (identical dependencies are counted once).
|
31
38
|
Just the runtime dependencies tree is printed to screen:
|
32
39
|
|
33
40
|
```shell
|
34
|
-
$ lapidarius
|
41
|
+
$ lapidarius sinatra
|
35
42
|
sinatra (2.0.0)
|
36
43
|
├── mustermann (~> 1.0)
|
37
44
|
├── rack (~> 2.0)
|
data/bin/lapidarius
CHANGED
data/lib/lapidarius/cli.rb
CHANGED
@@ -1,37 +1,44 @@
|
|
1
|
-
require "optparse"
|
2
1
|
require "lapidarius/cutter"
|
3
2
|
|
4
3
|
module Lapidarius
|
5
4
|
class CLI
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
HELP_FLAGS = %w[-h --help]
|
6
|
+
COL_WIDTH = 23
|
7
|
+
|
8
|
+
def initialize(input,
|
9
|
+
pipe = STDOUT,
|
10
|
+
command = Command,
|
11
|
+
cutter = Cutter,
|
12
|
+
tree = Tree)
|
13
|
+
@input = input.to_s.strip
|
14
|
+
@pipe = pipe
|
15
|
+
@cutter = cutter.new(@input, command)
|
16
|
+
@tree = tree
|
10
17
|
end
|
11
18
|
|
12
|
-
def call
|
13
|
-
|
14
|
-
return @io.puts("specify gem name as: '-g gem_name'") unless @gem
|
15
|
-
obj = Lapidarius::Cutter.new(@gem, cmd_klass).call
|
16
|
-
@io.puts Lapidarius::Tree::new(obj).out
|
17
|
-
rescue Gem::NotInstalledError => e
|
18
|
-
@io.puts e.message.sub("specified", "\e[1m#{@gem}\e[0m")
|
19
|
+
def call
|
20
|
+
@pipe.puts output
|
19
21
|
end
|
20
22
|
|
21
|
-
private def
|
22
|
-
|
23
|
-
|
23
|
+
private def output
|
24
|
+
return help if help?
|
25
|
+
return if @input.empty?
|
26
|
+
gem = @cutter.call
|
27
|
+
@tree::new(gem).out
|
28
|
+
rescue Gem::NotInstalledError => e
|
29
|
+
e.message.sub("specified", %Q{"#{@input}"})
|
30
|
+
end
|
24
31
|
|
25
|
-
|
26
|
-
|
27
|
-
|
32
|
+
private def help?
|
33
|
+
HELP_FLAGS.include?(@input)
|
34
|
+
end
|
28
35
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
36
|
+
private def help
|
37
|
+
[].tap do |h|
|
38
|
+
h << %q{Usage: lapidarius sinatra}
|
39
|
+
h << " %-#{COL_WIDTH}s Print this help" % "-h --help"
|
40
|
+
h << " %-#{COL_WIDTH}s Gem's name to cut" % "<gem-name>"
|
33
41
|
end
|
34
42
|
end
|
35
43
|
end
|
36
44
|
end
|
37
|
-
|
data/lib/lapidarius/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lapidarius
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- costajob
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|