npmdc 0.4.1 → 0.5.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
2
  SHA1:
3
- metadata.gz: 77d9f1a016e1db4c3e32b51a6a39c9c8fc76f16b
4
- data.tar.gz: f09c864650c8f42150be718f89fd967c7d42ad33
3
+ metadata.gz: 4e9d19fd41d787782cfdeb7a9ab691399d4265e5
4
+ data.tar.gz: bad1fcb22136fab919949fe4b5f3ff9212f8b4b0
5
5
  SHA512:
6
- metadata.gz: 00b1d2cea9ba5ea498ef782887de6ccba335ee46151bb484c66a3a8da733f37eea9307f96b90564cac1b7d6cc43cdaf52bbc562c373f81f661fff98b5fee106a
7
- data.tar.gz: e44318ae3e8519dad4d864788ad3a1353505feb649b7c9aa3e716ea8886296bbf47e42a4a4957137185b8ce5ac880c1dbc7bf0ee993078a657cf087d5af1cae0
6
+ metadata.gz: 3661cce322d33a26d7749b5e3eff7bfd7ee99699817763b240e01a9049820e8f9f25b3fa5157f83ff59d981f94ffb10d79593352c8dc0adbf5e82ae02d7283d7
7
+ data.tar.gz: 7f854a8d13c59707d3450b6bc3efe562632164de24054e1ba8fe49187925fc8b9c28abfac85a57a28ea8c74af7069313352332fb7305db69b9dc6d707998c19a
data/CHANGELOG.md CHANGED
@@ -108,3 +108,10 @@ Thanks to @sponomarev !
108
108
  ### 0.4.1
109
109
 
110
110
  * Fixed unexpected behavior when `node_modules` contains extra folders w/o `package.json` file inside.
111
+
112
+
113
+ ### 0.5.0
114
+
115
+ * Added support for checking [scoped](https://docs.npmjs.com/misc/scope) npm modules (Thanks to @psdcoder !)
116
+
117
+ * npmdc now starts only with `rails server` when using Rails (Thanks to @iskvmk !)
data/lib/npmdc/checker.rb CHANGED
@@ -60,12 +60,26 @@ module Npmdc
60
60
  modules_directory = File.join(path, 'node_modules')
61
61
  raise(NoNodeModulesError, path: path) unless Dir.exist?(modules_directory)
62
62
 
63
- Dir.glob("#{modules_directory}/*").each_with_object({}) do |file_path, modules|
64
- module_package_json_file = File.join(file_path, 'package.json')
63
+ Dir.glob("#{modules_directory}/*").each_with_object({}) do |module_file_path, modules|
64
+ next unless File.directory?(module_file_path)
65
65
 
66
- next if !File.directory?(file_path) || !File.file?(module_package_json_file)
66
+ module_folder = File.basename(module_file_path)
67
67
 
68
- modules[File.basename(file_path)] = package_json(file_path)
68
+ if module_folder.start_with?('@')
69
+ Dir.glob("#{module_file_path}/*") do |file_path|
70
+ module_package_json_file = File.join(file_path, 'package.json')
71
+
72
+ next if !File.directory?(file_path) || !File.file?(module_package_json_file)
73
+
74
+ modules["#{module_folder}/#{File.basename(file_path)}"] = package_json(file_path)
75
+ end
76
+ else
77
+ module_package_json_file = File.join(module_file_path, 'package.json')
78
+
79
+ next unless File.file?(module_package_json_file)
80
+
81
+ modules[module_folder] = package_json(module_file_path)
82
+ end
69
83
  end
70
84
  end
71
85
  end
data/lib/npmdc/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Npmdc
2
- VERSION = '0.4.1'
2
+ VERSION = '0.5.0'
3
3
  end
data/lib/npmdc.rb CHANGED
@@ -20,5 +20,5 @@ module Npmdc
20
20
  end
21
21
  end
22
22
 
23
- require "npmdc/railtie" if defined?(Rails)
23
+ require "npmdc/railtie" if defined?(Rails::Server)
24
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: npmdc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emil Kashkevich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-17 00:00:00.000000000 Z
11
+ date: 2017-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor