nicht 0.1.4 → 0.1.6
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/.travis.yml +1 -1
- data/README.md +10 -2
- data/lib/nicht.rb +1 -1
- data/lib/nicht/settings.rb +1 -3
- data/lib/nicht/stats.rb +17 -9
- data/lib/nicht/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a39149cb5290867577863bf37c2ad54d1a5bdd7
|
4
|
+
data.tar.gz: f8971c4f29263f7507cb590dc3d949dcc03e518f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 949af638d8eb0e1dcc7cee994215785840ed6c38ab7ad606ce0d5ff416fa2229ce13770f71225336502de7fcffb003822d533da48c0cc1da0d5a279d9d4103c2
|
7
|
+
data.tar.gz: dad72faace350d80a0cde7de47e07493fea3c2f7a2f0a5512eea173f39ec2c052de1aece1d82f23aa2c03731a94a65a7720f57fce5717cd627919fd612c5774c
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# Nicht [](https://rubygems.org/gems/nicht) [](https://travis-ci.org/vavgustov/nicht) [](https://codeclimate.com/github/vavgustov/nicht)
|
2
2
|
|
3
|
-
|
3
|
+
This library allow you to see gems usage per your or 3rd-party projects.
|
4
|
+
|
5
|
+

|
4
6
|
|
5
7
|
## Installation
|
6
8
|
|
@@ -8,6 +10,12 @@ Summary coming soon...
|
|
8
10
|
gem install nicht
|
9
11
|
```
|
10
12
|
|
13
|
+
Then create `.nichtrc` file in your home directory with path to the projects.
|
14
|
+
|
11
15
|
## Usage
|
12
16
|
|
13
|
-
|
17
|
+
Pass gem name as argument to see the list of the projects which use this gem:
|
18
|
+
|
19
|
+
```bash
|
20
|
+
nicht webpacker
|
21
|
+
```
|
data/lib/nicht.rb
CHANGED
@@ -8,7 +8,7 @@ module Nicht
|
|
8
8
|
def run(path, search = nil)
|
9
9
|
settings = Nicht::Settings.new path
|
10
10
|
begin
|
11
|
-
projects_path = settings.
|
11
|
+
projects_path = settings.get_path
|
12
12
|
rescue Nicht::SettingsNotFound
|
13
13
|
puts 'Settings not found. You should create .nichtrc with settings in your home directory.'
|
14
14
|
rescue Nicht::SettingsNotValid
|
data/lib/nicht/settings.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# require 'nicht/exceptions'
|
2
|
-
|
3
1
|
module Nicht
|
4
2
|
class Settings
|
5
3
|
FILENAME = '~/.nichtrc'.freeze
|
@@ -8,7 +6,7 @@ module Nicht
|
|
8
6
|
@path = File.expand_path path
|
9
7
|
end
|
10
8
|
|
11
|
-
def
|
9
|
+
def get_path
|
12
10
|
raise Nicht::SettingsNotFound unless File.exist? @path
|
13
11
|
projects_path = File.expand_path(File.read(@path))
|
14
12
|
raise Nicht::SettingsNotValid unless File.exist? projects_path
|
data/lib/nicht/stats.rb
CHANGED
@@ -45,16 +45,24 @@ module Nicht
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def output
|
48
|
-
|
49
|
-
|
48
|
+
@search.nil? ? dump_per_project : dump_per_gem
|
49
|
+
end
|
50
|
+
|
51
|
+
def dump_per_project
|
52
|
+
@stats[:per_project].each_key do |key|
|
53
|
+
@stats[:per_project][key].sort!
|
54
|
+
end
|
55
|
+
ap @stats[:per_project]
|
56
|
+
end
|
57
|
+
|
58
|
+
def dump_per_gem
|
59
|
+
@stats[:per_gem] = @stats[:per_gem].sort.to_h
|
60
|
+
dump_gems = @stats[:per_gem][@search] ? @stats[:per_gem][@search] : @stats[:per_gem].select { |k, v| k.include? @search }
|
61
|
+
if dump_gems.empty?
|
62
|
+
puts "No matches found for '#{@search}'"
|
50
63
|
else
|
51
|
-
dump_gems
|
52
|
-
if dump_gems.empty?
|
53
|
-
puts "No matches found for '#{@search}'"
|
54
|
-
else
|
55
|
-
ap dump_gems
|
56
|
-
end
|
64
|
+
ap dump_gems
|
57
65
|
end
|
58
66
|
end
|
59
67
|
end
|
60
|
-
end
|
68
|
+
end
|
data/lib/nicht/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nicht
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Avgustov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
110
|
version: '0'
|
111
111
|
requirements: []
|
112
112
|
rubyforge_project:
|
113
|
-
rubygems_version: 2.6.
|
113
|
+
rubygems_version: 2.6.12
|
114
114
|
signing_key:
|
115
115
|
specification_version: 4
|
116
116
|
summary: This library allow you to see gems usage per your projects.
|