dependenci 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/dependenci +29 -8
- data/lib/dependenci/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: 1dd8b04c2537b17d558707a84cbd66a2ff162dd5
|
4
|
+
data.tar.gz: fa8b147a7062e001ece709f2372873681ec4ef0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb85b7b71ca859fd94d9b15c4f94eb86f90edf123a102a6e7d42c19fd232418b535575c81b103ce57a2960dec73219bd9f2a8c46950540050d7eff109849b017
|
7
|
+
data.tar.gz: f096e58860722c9432578cb2c3dcee5810b576aaf1eec452b00f2280d1039d87452a0655a7ff8ac497fd3512f807b27122bad510ab43ed66947f6ad365b8514b
|
data/bin/dependenci
CHANGED
@@ -9,6 +9,7 @@ $LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
|
|
9
9
|
require 'faraday'
|
10
10
|
require 'json'
|
11
11
|
require 'terminal_helpers'
|
12
|
+
require 'optparse'
|
12
13
|
require 'dependenci'
|
13
14
|
|
14
15
|
include TerminalHelpers
|
@@ -57,16 +58,36 @@ def run_rubygems(dir)
|
|
57
58
|
end
|
58
59
|
|
59
60
|
def run_npm(dir)
|
60
|
-
package_json = File.read(File.join(dir, 'package.json'))
|
61
|
-
data = Dependenci.npm(package_json)
|
61
|
+
package_json = File.read(File.join(dir, 'package.json')) rescue ''
|
62
62
|
|
63
|
-
|
63
|
+
if package_json.empty?
|
64
|
+
STDERR.puts "Nothing to check"
|
65
|
+
else
|
66
|
+
data = Dependenci.npm(package_json)
|
67
|
+
print_result(data)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
options = {}
|
72
|
+
optsparse = OptionParser.new do |o|
|
73
|
+
o.banner = 'Usage: dependenci PATH [options]'
|
74
|
+
o.on('--rubygems') { |b| options[:rubygems] = b }
|
75
|
+
o.on('--npm') { |b| options[:npm] = b }
|
76
|
+
o.on('-h', '--help') { puts o; exit }
|
77
|
+
o.parse!
|
78
|
+
end
|
79
|
+
|
80
|
+
unless path = ARGV.shift
|
81
|
+
puts optsparse
|
82
|
+
exit
|
64
83
|
end
|
65
84
|
|
66
|
-
dir = File.expand_path(
|
85
|
+
dir = File.expand_path(path)
|
67
86
|
|
68
|
-
|
69
|
-
run_npm(dir)
|
87
|
+
unless options[:rubygems] || options[:npm]
|
88
|
+
File.exists?("#{dir}/package.json") ? run_npm(dir) : run_rubygems(dir)
|
70
89
|
else
|
71
|
-
|
72
|
-
|
90
|
+
run_npm(dir) if options[:npm]
|
91
|
+
run_rubygems(dir) if options[:rubygems]
|
92
|
+
end
|
93
|
+
|
data/lib/dependenci/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dependenci
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Sosedoff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
119
|
version: '0'
|
120
120
|
requirements: []
|
121
121
|
rubyforge_project:
|
122
|
-
rubygems_version: 2.
|
122
|
+
rubygems_version: 2.1.11
|
123
123
|
signing_key:
|
124
124
|
specification_version: 4
|
125
125
|
summary: API wrapper for dependenci.com
|