papers 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/.gitignore +1 -0
- data/README.md +6 -5
- data/lib/papers/manifest_generator.rb +19 -2
- data/lib/papers/version.rb +1 -1
- data/papers.gemspec +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YTA2ODg0ZGI3YWQ1MmY3ZTM5ZmI3NGU5ZWYyNDI2MmU3MzRjNDQzNA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ODc3MzhmZmM0MjEwMjQxZmNkMDIwMGU3ZjNlYWQ2MDRiZGUxYTUwYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YTQ4ZTVjMGNiZmM2MjgzYjYyNTg3ZjE5OGUxYjg4MTE2NmNjMjQ4NmI0MDBl
|
10
|
+
MjE5YThjNWM3MjBjMGNjNjY4MTFjM2MyZWY4ZWE0OGY4NTk1YWNiMjA4NGYy
|
11
|
+
ZmZkZTRlZmE1MDM2ZWFlNTdjYmZjYTIyYzAyMTEzYzc2YzNlZmQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZTdjMGVhZTQyOWM5YzA4NTZjMDdjNDA5NmJjMzc1MDUyOGExYWVmNmU5MDQ3
|
14
|
+
N2UxMzM5OWQ1NmQyODZmY2RmNjU5Yzc1Mzc4MDRhM2E2MDM5ZDhiZGE5M2Qw
|
15
|
+
ZmU3ODdhZmRhNGMxMDk3ODBiMzc4ZjZmYzE0ZGE3NDFjMmI2MTg=
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -6,7 +6,7 @@ Check that your Ruby/Rails project's dependencies are licensed with only the lic
|
|
6
6
|
|
7
7
|
# Contents
|
8
8
|
* [Usage](#usage)
|
9
|
-
* [Validations](#validations)
|
9
|
+
* [Example Validations](#example-validations)
|
10
10
|
* [Configuration](#configuration)
|
11
11
|
* [Structure of Dependency Manifest](#dependency-manifest-structure)
|
12
12
|
* [License](#license)
|
@@ -25,9 +25,10 @@ gem 'papers'
|
|
25
25
|
### 1. Generate Dependency Manifest from your bundled gems and JS
|
26
26
|
|
27
27
|
```
|
28
|
-
$ papers
|
28
|
+
$ papers --generate
|
29
|
+
Created config/papers_manifest.yml!
|
29
30
|
```
|
30
|
-
### 2. Create
|
31
|
+
### 2. Create a Validation Spec (or [use ours](#testing-with-rspec))
|
31
32
|
|
32
33
|
### 3. Run the specs
|
33
34
|
|
@@ -56,7 +57,7 @@ Finished in 0.01043 seconds
|
|
56
57
|
...
|
57
58
|
```
|
58
59
|
|
59
|
-
# Validations
|
60
|
+
# Example Validations
|
60
61
|
|
61
62
|
## testing with RSpec
|
62
63
|
|
@@ -120,7 +121,7 @@ The default whitelist allows for permissive licensing for proprietary or commerc
|
|
120
121
|
|
121
122
|
## Available configuration options
|
122
123
|
|
123
|
-
To configure the Papers gem, pass options to ```Papers.configure``` before initialization of LicenseValidator:
|
124
|
+
To configure the Papers gem, pass options to ```Papers.configure``` before initialization of LicenseValidator. Currently supported config options:
|
124
125
|
|
125
126
|
```
|
126
127
|
Papers.configure do |c|
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'bundler'
|
2
2
|
require 'yaml'
|
3
3
|
require 'fileutils'
|
4
|
+
require 'uri'
|
4
5
|
|
5
6
|
module Papers
|
6
7
|
|
@@ -52,10 +53,13 @@ module Papers
|
|
52
53
|
name_and_version = "#{spec.name}-#{spec.version}"
|
53
54
|
end
|
54
55
|
|
56
|
+
gem_license = blank?(spec.license) ? 'Unknown' : spec.license
|
57
|
+
gem_project_url = blank?(spec.homepage) ? nil : spec.homepage
|
58
|
+
|
55
59
|
gems[name_and_version] = {
|
56
|
-
'license' =>
|
60
|
+
'license' => gem_license,
|
57
61
|
'license_url' => nil,
|
58
|
-
'project_url' =>
|
62
|
+
'project_url' => ensure_valid_url(gem_project_url)
|
59
63
|
# TODO: add support for multiple licenses? some gemspecs have dual licensing
|
60
64
|
}
|
61
65
|
end
|
@@ -87,6 +91,19 @@ module Papers
|
|
87
91
|
].join("\n")
|
88
92
|
end
|
89
93
|
|
94
|
+
def ensure_valid_url url_string
|
95
|
+
match_url = URI::regexp.match(url_string)
|
96
|
+
if match_url.nil?
|
97
|
+
nil
|
98
|
+
else
|
99
|
+
match_url[0]
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
def blank? str
|
104
|
+
str.respond_to?(:empty?) ? str.empty? : !str
|
105
|
+
end
|
106
|
+
|
90
107
|
end
|
91
108
|
|
92
109
|
end
|
data/lib/papers/version.rb
CHANGED
data/papers.gemspec
CHANGED
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: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ralph Bodenner
|
@@ -11,22 +11,22 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-12-
|
14
|
+
date: 2013-12-14 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rake
|
18
18
|
requirement: !ruby/object:Gem::Requirement
|
19
19
|
requirements:
|
20
|
-
- -
|
20
|
+
- - ! '>='
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
23
|
-
type: :
|
22
|
+
version: '0'
|
23
|
+
type: :development
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
29
|
+
version: '0'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: rspec
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|