papers 2.2.0 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +3 -0
- data/lib/papers/configuration.rb +6 -1
- data/lib/papers/dependency_specification/npm_package.rb +2 -1
- data/lib/papers/version.rb +1 -1
- data/spec/npm_package_spec.rb +12 -3
- 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: 04a56da48ddc413020f2fcd656e2db6e0e3b0ba8
|
4
|
+
data.tar.gz: 94f31684ae3f21f18b919cefbb167f024045f5ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e70b63d4c27b79bbc19a4144664738a933fbe31301d3a3c335bf5aae3e0bdae5ae6227034a41203b4cbb9772959b9977b66e3f31d71748966d15203c78520009
|
7
|
+
data.tar.gz: 5a3a99002c51bc3f0529d6593e5193dd005d495e6afa4cf1e5f99dc00eee7f569f70622bc52de5be032d087d08a2b90c01ff1d0086580fddbf5493bdfd20cc5a
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 2.3.0
|
4
|
+
* Add `config.ignore_npm_dev_dependencies` option to not apply validation to npm devDepdency modules. This is useful if you don't need to consider packages that aren't use in production.
|
5
|
+
|
3
6
|
## 2.2.0
|
4
7
|
|
5
8
|
* Fix empty npm package name bug. The name of an npm package would be blank when its version was,
|
data/README.md
CHANGED
@@ -102,6 +102,9 @@ Papers.configure do |config|
|
|
102
102
|
# Configures Papers to validate licenses for NPM dependencies. Defaults to false.
|
103
103
|
config.validate_npm_packages = false
|
104
104
|
|
105
|
+
# Configured Papers to ignore NPM dev dependencies. Defaults to false.
|
106
|
+
config.ignore_npm_dev_dependencies = false
|
107
|
+
|
105
108
|
# Configures where Papers should look for the package.json file. Defaults to:
|
106
109
|
# package.json in the root directory of the project
|
107
110
|
config.npm_package_json_path = File.join(Dir.pwd, 'package.json')
|
data/lib/papers/configuration.rb
CHANGED
@@ -9,6 +9,7 @@ module Papers
|
|
9
9
|
attr_accessor :validate_javascript
|
10
10
|
attr_accessor :validate_bower_components
|
11
11
|
attr_accessor :validate_npm_packages
|
12
|
+
attr_accessor :ignore_npm_dev_dependencies
|
12
13
|
|
13
14
|
attr_accessor :javascript_paths
|
14
15
|
attr_accessor :whitelist_javascript_paths
|
@@ -37,7 +38,7 @@ module Papers
|
|
37
38
|
@validate_javascript = true
|
38
39
|
@validate_bower_components = false
|
39
40
|
@validate_npm_packages = false
|
40
|
-
|
41
|
+
@ignore_npm_dev_dependencies = false
|
41
42
|
|
42
43
|
@javascript_paths = [
|
43
44
|
File.join(Dir.pwd, 'app', 'assets', 'javascripts'),
|
@@ -67,5 +68,9 @@ module Papers
|
|
67
68
|
!!@validate_npm_packages
|
68
69
|
end
|
69
70
|
|
71
|
+
def ignore_npm_dev_dependencies?
|
72
|
+
!!@ignore_npm_dev_dependencies
|
73
|
+
end
|
74
|
+
|
70
75
|
end
|
71
76
|
end
|
@@ -7,7 +7,8 @@ module Papers
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def self.full_introspected_entries
|
10
|
-
packages = (package['dependencies'] || {})
|
10
|
+
packages = (package['dependencies'] || {})
|
11
|
+
packages.merge!((package['devDependencies'] || {})) unless Papers.config.ignore_npm_dev_dependencies
|
11
12
|
packages.map do |name, version|
|
12
13
|
# FIXME: This version cleanup is inadequate for npm version specifiers, which may be git or
|
13
14
|
# tarball URLs.
|
data/lib/papers/version.rb
CHANGED
data/spec/npm_package_spec.rb
CHANGED
@@ -22,19 +22,28 @@ describe 'NpmPackageSpecification' do
|
|
22
22
|
expect { Papers::NpmPackage.full_introspected_entries }.to raise_error JSON::ParserError
|
23
23
|
end
|
24
24
|
|
25
|
-
it 'combines dependencies and devDependencies' do
|
25
|
+
it 'combines dependencies and devDependencies by default' do
|
26
26
|
allow(Papers::NpmPackage).to receive(:package).and_return({
|
27
27
|
'dependencies' => { 'prod_package' => '~> 1.2.3' },
|
28
28
|
'devDependencies' => {'dev_package' => '~> 1.2.0'}
|
29
29
|
})
|
30
|
-
|
31
|
-
|
32
30
|
expect(Papers::NpmPackage.full_introspected_entries).to eq([
|
33
31
|
{ 'name' => 'prod_package', 'version' => '1.2.3' },
|
34
32
|
{ 'name' => 'dev_package', 'version' => '1.2.0' }
|
35
33
|
])
|
36
34
|
end
|
37
35
|
|
36
|
+
it 'does not combine dependencies and devDependencies when ignore_npm_dev_dependencies is true' do
|
37
|
+
allow(Papers::NpmPackage).to receive(:package).and_return({
|
38
|
+
'dependencies' => { 'prod_package' => '~> 1.2.3' },
|
39
|
+
'devDependencies' => {'dev_package' => '~> 1.2.0'}
|
40
|
+
})
|
41
|
+
allow_any_instance_of(Papers::Configuration).to receive(:ignore_npm_dev_dependencies).and_return(true)
|
42
|
+
expect(Papers::NpmPackage.full_introspected_entries).to eq([
|
43
|
+
{ 'name' => 'prod_package', 'version' => '1.2.3' }
|
44
|
+
])
|
45
|
+
end
|
46
|
+
|
38
47
|
it 'returns dependencies when devDependencies is not defined' do
|
39
48
|
allow(Papers::NpmPackage).to receive(:package).and_return({
|
40
49
|
'dependencies' => { 'npm_package' => '1.2.3' }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: papers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ralph Bodenner
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2015-
|
15
|
+
date: 2015-10-12 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rake
|