bibliothecary 5.5.5 → 5.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 513780ca1e71d5e1cfe5bc29b910ece2964a7223
4
- data.tar.gz: 5a712ec306c12b76d4691b171501b533be5378f4
2
+ SHA256:
3
+ metadata.gz: 1132887757d12b74eac14368bab1568ea1a736fa59f384aa6a8a3b09b5f295a7
4
+ data.tar.gz: 4e5d2a6450479303b8eadc7a2dd99d924239e9142f317aac0aceb0e43e6c4543
5
5
  SHA512:
6
- metadata.gz: 753e13089404681e84374c513dc92800a4249b2db9f7c4bbf4254f20692dcf9fd979ecb6fca47bb74fc4b54da0e497bb771760c6e5ea430795ac6518c63e2758
7
- data.tar.gz: 7387f77de2409aa88bae35ff4d31071ba3e82746cde391bd505e2079d8096569692d5829ed11279cfe1ba538f4d3b92728ec1be30f09a6580b872b84aed581f7
6
+ metadata.gz: 22d0e75ed77493f0ec5fc7521077706a1131f6ac837f8d321fa012116aae7c949e6ea1de163d96a6f7c9decbf2dd0e84bcc4fd78584754091129d33a44373669
7
+ data.tar.gz: 72dfb01b6c44c159616f06d9d3021fcc77085bb15ebbc393a9403283e4389995e3ff3fd7c47e439ec32f53eeab2bbb2a7d2f9c82059f7299629bc8ae7420d865
@@ -14,8 +14,8 @@ Gem::Specification.new do |spec|
14
14
  spec.license = "AGPL-3.0"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
- spec.bindir = "exe"
18
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
17
+ spec.bindir = "bin"
18
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_dependency "toml-rb", "~> 1.0"
@@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.add_dependency "typhoeus"
25
25
  spec.add_dependency "deb_control"
26
26
  spec.add_dependency "sdl4r"
27
+ spec.add_dependency "commander"
27
28
 
28
29
  spec.add_development_dependency "bundler", "~> 1.11"
29
30
  spec.add_development_dependency "rake", "~> 12.0"
data/bin/bibliothecary ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ lib = File.expand_path("../../lib", __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+
6
+ require "bibliothecary/cli"
7
+
8
+ Bibliothecary::CLI.new.run
@@ -0,0 +1,37 @@
1
+ require 'bibliothecary/version'
2
+ require 'bibliothecary'
3
+ require 'commander'
4
+
5
+ module Bibliothecary
6
+ class CLI
7
+ include Commander::Methods
8
+
9
+ def run
10
+ program :name, 'Bibliothecary'
11
+ program :version, Bibliothecary::VERSION
12
+ program :description, 'Parse dependency information from a file or folder of code'
13
+
14
+ command(:list) do |c|
15
+ c.syntax = 'bibliothecary list'
16
+ c.description = 'List dependencies'
17
+ c.option("--path FILENAME", String, "Path to file/folder to analyse")
18
+ c.action do |_args, options|
19
+ output = Bibliothecary.analyse(options.path)
20
+ output.each do |manifest|
21
+ puts "#{manifest[:path]} (#{manifest[:platform]})"
22
+ manifest[:dependencies].group_by{|d| d[:type] }.each do |type, deps|
23
+ puts " #{type}"
24
+ deps.each do |dep|
25
+ puts " #{dep[:name]} #{dep[:requirement]}"
26
+ end
27
+ puts
28
+ end
29
+ puts
30
+ end
31
+ end
32
+ end
33
+
34
+ run!
35
+ end
36
+ end
37
+ end
@@ -57,7 +57,7 @@ module Bibliothecary
57
57
  def self.parse_yarn_lock(file_contents)
58
58
  response = Typhoeus.post("https://yarn-parser.libraries.io/parse", body: file_contents)
59
59
  return [] unless response.response_code == 200
60
- JSON.parse(response.body)
60
+ JSON.parse(response.body, symbolize_names: true)
61
61
  end
62
62
  end
63
63
  end
@@ -1,3 +1,3 @@
1
1
  module Bibliothecary
2
- VERSION = "5.5.5"
2
+ VERSION = "5.6.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bibliothecary
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.5.5
4
+ version: 5.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Nesbitt
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-05 00:00:00.000000000 Z
11
+ date: 2017-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: toml-rb
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: commander
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: bundler
99
113
  requirement: !ruby/object:Gem::Requirement
@@ -139,7 +153,10 @@ dependencies:
139
153
  description:
140
154
  email:
141
155
  - andrewnez@gmail.com
142
- executables: []
156
+ executables:
157
+ - bibliothecary
158
+ - console
159
+ - setup
143
160
  extensions: []
144
161
  extra_rdoc_files: []
145
162
  files:
@@ -157,11 +174,13 @@ files:
157
174
  - README.md
158
175
  - Rakefile
159
176
  - bibliothecary.gemspec
177
+ - bin/bibliothecary
160
178
  - bin/console
161
179
  - bin/setup
162
180
  - dependencyci.yml
163
181
  - lib/bibliothecary.rb
164
182
  - lib/bibliothecary/analyser.rb
183
+ - lib/bibliothecary/cli.rb
165
184
  - lib/bibliothecary/parsers/bower.rb
166
185
  - lib/bibliothecary/parsers/cargo.rb
167
186
  - lib/bibliothecary/parsers/carthage.rb
@@ -207,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
207
226
  version: '0'
208
227
  requirements: []
209
228
  rubyforge_project:
210
- rubygems_version: 2.6.4
229
+ rubygems_version: 2.7.3
211
230
  signing_key:
212
231
  specification_version: 4
213
232
  summary: Find and parse manifests