gem-licenses 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.github/workflows/lint.yml +31 -0
- data/.github/workflows/release.yml +27 -0
- data/.github/workflows/test.yml +39 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +95 -2
- data/.rubocop_todo.yml +92 -27
- data/.spellcheck.txt +44 -0
- data/CHANGELOG.md +16 -4
- data/CONTRIBUTING.md +18 -19
- data/Gemfile +11 -2
- data/README.md +39 -25
- data/RELEASING.md +20 -48
- data/Rakefile +22 -3
- data/exe/gem-licenses +8 -0
- data/gem-licenses.gemspec +4 -2
- data/lib/gem/licenses.rb +3 -3
- data/lib/gem/specification.rb +25 -22
- data/lib/gem-licenses/cli.rb +97 -0
- data/lib/gem-licenses/copyrights.rb +48 -0
- data/lib/gem-licenses/install_tasks.rb +2 -0
- data/lib/gem-licenses/railtie.rb +12 -0
- data/lib/gem-licenses/report.rb +46 -0
- data/lib/gem-licenses/version.rb +1 -1
- data/lib/gem-licenses.rb +1 -0
- data/lib/gem_licenses.rb +2 -0
- data/lib/licenses/config.yml +2 -1
- data/script/release.rb +18 -0
- data/spec/fixtures/gems/copyrights/LICENSE +7 -0
- data/spec/fixtures/gems/copyrights/README.md +17 -0
- data/spec/fixtures/gems/empty_reference_before_license/README +6 -0
- data/spec/fixtures/gems/licensed_under_the_apache_license/README.md +4 -0
- data/spec/fixtures/gems/mit_license_in_license_md/LICENSE.md +3 -0
- data/spec/fixtures/gems/same_terms_of_ruby/README +4 -0
- data/spec/gem/licenses_spec.rb +8 -1
- data/spec/gem/specification_spec.rb +49 -1
- data/spec/gem_licenses/cli_spec.rb +120 -0
- data/spec/gem_licenses/install_tasks_spec.rb +55 -0
- data/spec/release/release_spec.rb +74 -0
- data/spec/tasks/licenses_rake_spec.rb +101 -0
- data/tasks/licenses.rake +23 -27
- metadata +55 -13
- data/.travis.yml +0 -9
- data/VERSION +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: a3d2d438cff8d4703d16dd7f171118ff15df0cb2bf70adb439ab26b3fe932a04
|
|
4
|
+
data.tar.gz: 863d5331d55f2df94e708be3ec533720f33ed0a112986a8ac16509679117e860
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ed33eb6b4472590ef69bbbc050eb17aac5eeaa89ed6387805d9c4eabf4e4ed4443a21cb5bedbd500328639f1193e4ce09356e1b269fdc480f85b4cbdf3057ced
|
|
7
|
+
data.tar.gz: 00400f3a327899dc646830083c14b1898db44fe2bd6b4dbde6c1241e535e19717c35730a2a35ef93faf50e486e45071950b8ba0b8174fdfce01934876a3eb053
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: Lint
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
concurrency:
|
|
9
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
10
|
+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
lint:
|
|
17
|
+
name: Lint Code and Documentation
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
timeout-minutes: 10
|
|
20
|
+
steps:
|
|
21
|
+
- name: Check Out Code
|
|
22
|
+
uses: actions/checkout@v7
|
|
23
|
+
with:
|
|
24
|
+
persist-credentials: false
|
|
25
|
+
- name: Set Up Ruby
|
|
26
|
+
uses: ruby/setup-ruby@v1
|
|
27
|
+
with:
|
|
28
|
+
ruby-version: '4.0'
|
|
29
|
+
bundler-cache: true
|
|
30
|
+
- name: Run Lint
|
|
31
|
+
run: bundle exec rake lint
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
version:
|
|
7
|
+
description: Optional release version overriding the checked-in version.
|
|
8
|
+
type: string
|
|
9
|
+
required: false
|
|
10
|
+
dry-run:
|
|
11
|
+
description: Check release prerequisites, such as RubyGems Trusted Publishing, without releasing.
|
|
12
|
+
type: boolean
|
|
13
|
+
default: false
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: write
|
|
17
|
+
id-token: write
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
release:
|
|
21
|
+
if: github.repository == 'dblock/gem-licenses' && github.ref == 'refs/heads/master'
|
|
22
|
+
uses: dblock/ruby-gem-release/.github/workflows/release.yml@v0.9.0
|
|
23
|
+
with:
|
|
24
|
+
ruby-version: '3.3'
|
|
25
|
+
version: ${{ inputs.version }}
|
|
26
|
+
dry-run: ${{ inputs.dry-run }}
|
|
27
|
+
test: bundle exec rake lint spec
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
concurrency:
|
|
9
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
10
|
+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
test:
|
|
17
|
+
name: Ruby ${{ matrix.entry.ruby }}
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
timeout-minutes: 10
|
|
20
|
+
strategy:
|
|
21
|
+
fail-fast: false
|
|
22
|
+
matrix:
|
|
23
|
+
entry:
|
|
24
|
+
- { ruby: '2.7' }
|
|
25
|
+
- { ruby: '3.3' }
|
|
26
|
+
- { ruby: '3.4' }
|
|
27
|
+
- { ruby: '4.0' }
|
|
28
|
+
steps:
|
|
29
|
+
- name: Check Out Code
|
|
30
|
+
uses: actions/checkout@v7
|
|
31
|
+
with:
|
|
32
|
+
persist-credentials: false
|
|
33
|
+
- name: Set Up Ruby
|
|
34
|
+
uses: ruby/setup-ruby@v1
|
|
35
|
+
with:
|
|
36
|
+
ruby-version: ${{ matrix.entry.ruby }}
|
|
37
|
+
bundler-cache: true
|
|
38
|
+
- name: Run Tests
|
|
39
|
+
run: bundle exec rake spec
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
|
@@ -1,5 +1,98 @@
|
|
|
1
|
+
plugins:
|
|
2
|
+
- rubocop-md
|
|
3
|
+
- rubocop-prose
|
|
4
|
+
- rubocop-rake
|
|
5
|
+
- rubocop-spellcheck
|
|
6
|
+
- rubocop-yaml
|
|
7
|
+
|
|
8
|
+
inherit_from: ".rubocop_todo.yml"
|
|
9
|
+
|
|
1
10
|
AllCops:
|
|
11
|
+
NewCops: enable
|
|
12
|
+
TargetRubyVersion: 2.7
|
|
13
|
+
DisplayCopNames: true
|
|
14
|
+
DisplayStyleGuide: true
|
|
15
|
+
SuggestExtensions: false
|
|
16
|
+
inherit_mode:
|
|
17
|
+
merge:
|
|
18
|
+
- Include
|
|
19
|
+
Include:
|
|
20
|
+
- ".github/**/*.yml"
|
|
21
|
+
- ".rubocop.yml"
|
|
22
|
+
Exclude:
|
|
23
|
+
- coverage/**/*
|
|
24
|
+
- pkg/**/*
|
|
25
|
+
- spec/fixtures/**/*
|
|
26
|
+
- vendor/**/*
|
|
27
|
+
|
|
28
|
+
YAML/Lint/InvalidSyntax:
|
|
29
|
+
Include:
|
|
30
|
+
- "**/*.yml"
|
|
31
|
+
- "**/*.yaml"
|
|
32
|
+
|
|
33
|
+
YAML/Lint/DuplicateKey:
|
|
34
|
+
Include:
|
|
35
|
+
- "**/*.yml"
|
|
36
|
+
- "**/*.yaml"
|
|
37
|
+
|
|
38
|
+
Naming/FileName:
|
|
39
|
+
inherit_mode:
|
|
40
|
+
merge:
|
|
41
|
+
- Exclude
|
|
42
|
+
Exclude:
|
|
43
|
+
- "**/*.md"
|
|
44
|
+
|
|
45
|
+
Metrics/BlockLength:
|
|
46
|
+
inherit_mode:
|
|
47
|
+
merge:
|
|
48
|
+
- Exclude
|
|
49
|
+
Exclude:
|
|
50
|
+
- Gemfile
|
|
51
|
+
- spec/**/*_spec.rb
|
|
52
|
+
- tasks/*.rake
|
|
53
|
+
|
|
54
|
+
Layout/LineLength:
|
|
55
|
+
inherit_mode:
|
|
56
|
+
merge:
|
|
57
|
+
- Exclude
|
|
58
|
+
Exclude:
|
|
59
|
+
- ".github/workflows/*.yml"
|
|
60
|
+
|
|
61
|
+
Markdown/HeadingCapitalization:
|
|
62
|
+
inherit_mode:
|
|
63
|
+
merge:
|
|
64
|
+
- Exclude
|
|
65
|
+
Enabled: true
|
|
66
|
+
Style: title_case
|
|
67
|
+
Exclude:
|
|
68
|
+
- CHANGELOG.md
|
|
69
|
+
|
|
70
|
+
Prose/MaxLength:
|
|
71
|
+
inherit_mode:
|
|
72
|
+
merge:
|
|
73
|
+
- Exclude
|
|
74
|
+
Max: false
|
|
2
75
|
Exclude:
|
|
3
|
-
|
|
76
|
+
- CHANGELOG.md
|
|
4
77
|
|
|
5
|
-
|
|
78
|
+
Spellcheck:
|
|
79
|
+
DictionaryFiles:
|
|
80
|
+
en:
|
|
81
|
+
- gem:rubocop-spellcheck/data/en/en.dic
|
|
82
|
+
- ".spellcheck.txt"
|
|
83
|
+
Spellcheck/Spelling:
|
|
84
|
+
Exclude: []
|
|
85
|
+
|
|
86
|
+
Markdown/CompactLists:
|
|
87
|
+
inherit_mode:
|
|
88
|
+
merge:
|
|
89
|
+
- Exclude
|
|
90
|
+
Exclude:
|
|
91
|
+
- CHANGELOG.md
|
|
92
|
+
|
|
93
|
+
Markdown/FenceLanguage:
|
|
94
|
+
inherit_mode:
|
|
95
|
+
merge:
|
|
96
|
+
- Exclude
|
|
97
|
+
Exclude:
|
|
98
|
+
- CHANGELOG.md
|
data/.rubocop_todo.yml
CHANGED
|
@@ -1,41 +1,106 @@
|
|
|
1
|
-
# This configuration was generated by
|
|
2
|
-
#
|
|
1
|
+
# This configuration was generated by
|
|
2
|
+
# `rubocop --auto-gen-config --no-exclude-limit --no-offense-counts --no-auto-gen-timestamp`
|
|
3
|
+
# using RuboCop version 1.92.3.
|
|
3
4
|
# The point is for the user to remove these configuration records
|
|
4
5
|
# one by one as the offenses are removed from the code base.
|
|
5
6
|
# Note that changes in the inspected code, or installation of new
|
|
6
7
|
# versions of RuboCop, may require this file to be generated again.
|
|
7
8
|
|
|
8
|
-
#
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
10
|
+
Gemspec/DeprecatedAttributeAssignment:
|
|
11
|
+
Exclude:
|
|
12
|
+
- 'gem-licenses.gemspec'
|
|
11
13
|
|
|
12
|
-
#
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
15
|
+
Gemspec/RequireMFA:
|
|
16
|
+
Exclude:
|
|
17
|
+
- 'gem-licenses.gemspec'
|
|
18
|
+
|
|
19
|
+
Gemspec/RequiredRubyVersion:
|
|
20
|
+
Exclude:
|
|
21
|
+
- 'gem-licenses.gemspec'
|
|
15
22
|
|
|
16
|
-
#
|
|
17
|
-
|
|
18
|
-
|
|
23
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
24
|
+
Layout/EmptyLineAfterGuardClause:
|
|
25
|
+
Exclude:
|
|
26
|
+
- 'lib/gem/specification.rb'
|
|
19
27
|
|
|
20
|
-
#
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
29
|
+
Lint/RedundantStringCoercion:
|
|
30
|
+
Exclude:
|
|
31
|
+
- 'tasks/licenses.rake'
|
|
24
32
|
|
|
25
|
-
#
|
|
26
|
-
|
|
33
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
|
|
34
|
+
Metrics/AbcSize:
|
|
35
|
+
Exclude:
|
|
36
|
+
- 'lib/gem/specification.rb'
|
|
37
|
+
|
|
38
|
+
# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns.
|
|
27
39
|
Metrics/MethodLength:
|
|
28
|
-
|
|
40
|
+
Exclude:
|
|
41
|
+
- 'lib/gem/licenses.rb'
|
|
42
|
+
- 'lib/gem/specification.rb'
|
|
43
|
+
|
|
44
|
+
# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms.
|
|
45
|
+
# CheckDefinitionPathHierarchyRoots: lib, spec, test, src
|
|
46
|
+
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
|
|
47
|
+
Naming/FileName:
|
|
48
|
+
Exclude:
|
|
49
|
+
- 'lib/gem-licenses.rb'
|
|
29
50
|
|
|
30
|
-
#
|
|
31
|
-
|
|
32
|
-
|
|
51
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
52
|
+
Rake/Desc:
|
|
53
|
+
Exclude:
|
|
54
|
+
- 'tasks/licenses.rake'
|
|
33
55
|
|
|
34
|
-
#
|
|
56
|
+
# Configuration parameters: AllowedConstants.
|
|
35
57
|
Style/Documentation:
|
|
36
|
-
|
|
58
|
+
Exclude:
|
|
59
|
+
- 'lib/gem-licenses/install_tasks.rb'
|
|
60
|
+
- 'lib/gem/licenses.rb'
|
|
61
|
+
- 'lib/gem/specification.rb'
|
|
62
|
+
|
|
63
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
64
|
+
Style/ExpandPathArguments:
|
|
65
|
+
Exclude:
|
|
66
|
+
- 'gem-licenses.gemspec'
|
|
67
|
+
- 'lib/gem/licenses.rb'
|
|
68
|
+
- 'lib/gem/specification.rb'
|
|
69
|
+
- 'spec/spec_helper.rb'
|
|
70
|
+
|
|
71
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
72
|
+
# Configuration parameters: EnforcedStyle.
|
|
73
|
+
# SupportedStyles: always, always_true, never
|
|
74
|
+
Style/FrozenStringLiteralComment:
|
|
75
|
+
Exclude:
|
|
76
|
+
- 'Gemfile'
|
|
77
|
+
- 'Rakefile'
|
|
78
|
+
- 'gem-licenses.gemspec'
|
|
79
|
+
- 'lib/gem-licenses.rb'
|
|
80
|
+
- 'lib/gem-licenses/install_tasks.rb'
|
|
81
|
+
- 'lib/gem-licenses/version.rb'
|
|
82
|
+
- 'lib/gem/licenses.rb'
|
|
83
|
+
- 'lib/gem/specification.rb'
|
|
84
|
+
- 'lib/gem_licenses.rb'
|
|
85
|
+
- 'spec/gem/licenses_spec.rb'
|
|
86
|
+
- 'spec/gem/specification_spec.rb'
|
|
87
|
+
- 'spec/spec_helper.rb'
|
|
88
|
+
- 'tasks/licenses.rake'
|
|
89
|
+
|
|
90
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
91
|
+
# Configuration parameters: AllowSplatArgument.
|
|
92
|
+
Style/HashConversion:
|
|
93
|
+
Exclude:
|
|
94
|
+
- 'lib/gem/specification.rb'
|
|
95
|
+
|
|
96
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
97
|
+
Style/RedundantRegexpCharacterClass:
|
|
98
|
+
Exclude:
|
|
99
|
+
- 'lib/gem/specification.rb'
|
|
37
100
|
|
|
38
|
-
#
|
|
39
|
-
# Configuration parameters:
|
|
40
|
-
|
|
41
|
-
|
|
101
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
102
|
+
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
|
|
103
|
+
# AllowedMethods: present?, blank?, presence, try, try!
|
|
104
|
+
Style/SafeNavigation:
|
|
105
|
+
Exclude:
|
|
106
|
+
- 'lib/gem/specification.rb'
|
data/.spellcheck.txt
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
Bundler
|
|
2
|
+
caiosba
|
|
3
|
+
CHANGELOG
|
|
4
|
+
Changelog
|
|
5
|
+
config
|
|
6
|
+
CSV
|
|
7
|
+
dabooze
|
|
8
|
+
dblock
|
|
9
|
+
Doubrovkine
|
|
10
|
+
edennis
|
|
11
|
+
exe
|
|
12
|
+
Gemfile
|
|
13
|
+
GemLicensesRelease
|
|
14
|
+
gemspec
|
|
15
|
+
GPL
|
|
16
|
+
gpl
|
|
17
|
+
HTTPS
|
|
18
|
+
joeyAghion
|
|
19
|
+
JRuby
|
|
20
|
+
linters
|
|
21
|
+
md
|
|
22
|
+
mit
|
|
23
|
+
newrelic
|
|
24
|
+
nitpicky
|
|
25
|
+
olleolleolle
|
|
26
|
+
railtie
|
|
27
|
+
Railtie
|
|
28
|
+
Rakefile
|
|
29
|
+
rb
|
|
30
|
+
README
|
|
31
|
+
rebase
|
|
32
|
+
Redistributions
|
|
33
|
+
RSpec
|
|
34
|
+
RuboCop
|
|
35
|
+
rubocop
|
|
36
|
+
RubyGems
|
|
37
|
+
rubygems
|
|
38
|
+
TODO
|
|
39
|
+
txt
|
|
40
|
+
unparseable
|
|
41
|
+
whitespace
|
|
42
|
+
YAML
|
|
43
|
+
yaml
|
|
44
|
+
yml
|
data/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,23 @@
|
|
|
1
|
-
#### 0.
|
|
1
|
+
#### 0.3.0 (11/25/2026)
|
|
2
2
|
|
|
3
|
-
*
|
|
3
|
+
* [#25](https://github.com/dblock/gem-licenses/pull/25): Replace Travis CI with GitHub Actions testing Ruby 2.7 through 4.0, and make the license normalization spec independent of installed gems - [@dblock](https://github.com/dblock).
|
|
4
|
+
* [#26](https://github.com/dblock/gem-licenses/pull/26): Lint Ruby, Markdown, YAML, and spelling with current RuboCop, rubocop-md, rubocop-prose, rubocop-spellcheck, and rubocop-yaml in a separate Lint workflow, and clean up documentation - [@dblock](https://github.com/dblock).
|
|
5
|
+
* [#27](https://github.com/dblock/gem-licenses/pull/27): Run CI pushes only on the default branch, cancel superseded pull request runs, and bound test job times - [@dblock](https://github.com/dblock).
|
|
6
|
+
* [#29](https://github.com/dblock/gem-licenses/pull/29): Release with ruby-gem-release through a manually dispatched GitHub Actions workflow and RubyGems Trusted Publishing - [@dblock](https://github.com/dblock).
|
|
7
|
+
* [#30](https://github.com/dblock/gem-licenses/pull/30): Test the Rake tasks, and fail with a usage message when `gem:licenses:csv` has no filename - [@dblock](https://github.com/dblock).
|
|
8
|
+
* [#31](https://github.com/dblock/gem-licenses/pull/31): Load the Rake tasks automatically in Rails applications, load them only once, and clarify loading them from a `Rakefile` - [@olleolleolle](https://github.com/olleolleolle), [@dblock](https://github.com/dblock).
|
|
9
|
+
* [#32](https://github.com/dblock/gem-licenses/pull/32): Find licenses named in Markdown headings such as `LICENSE.md`, match "same terms of", skip references without a license name, and warn about unreadable files, carried from [newrelic/gem-licenses](https://github.com/newrelic/gem-licenses) - [@olleolleolle](https://github.com/olleolleolle), [@dblock](https://github.com/dblock).
|
|
10
|
+
* [#34](https://github.com/dblock/gem-licenses/pull/34): Detect licenses from "Licensed under the ___ License", such as the Apache License notice - [@dabooze](https://github.com/dabooze), [@DavidL06](https://github.com/DavidL06), [@dblock](https://github.com/dblock).
|
|
11
|
+
* [#35](https://github.com/dblock/gem-licenses/pull/35): Collect copyright lines from license, notice, and readme files with `Gem::Specification#copyrights`, and write them with `rake gem:licenses:copyrights:csv` - [@DavidL06](https://github.com/DavidL06), [@dblock](https://github.com/dblock).
|
|
12
|
+
* [#33](https://github.com/dblock/gem-licenses/pull/33): Add a `gem-licenses` command that lists the licenses of a project's bundle or writes them to CSV, with `--strict` to fail on gems without a guessable license, and sort CSV output by license - [@dblock](https://github.com/dblock).
|
|
13
|
+
|
|
14
|
+
#### 0.2.2 (2/16/2018)
|
|
15
|
+
|
|
16
|
+
* [#18](https://github.com/dblock/gem-licenses/pull/18): Make order of rake gem:licenses deterministic - [@edennis](https://github.com/edennis).
|
|
4
17
|
|
|
5
18
|
#### 0.2.1 (5/31/2016)
|
|
6
19
|
|
|
7
|
-
* [#10](https://github.com/dblock/gem-licenses/pull/10): Rename class (from `Gem::Licenses` to `Gem::GemLicenses`) in order to avoid conflict with
|
|
20
|
+
* [#10](https://github.com/dblock/gem-licenses/pull/10): Rename class (from `Gem::Licenses` to `Gem::GemLicenses`) in order to avoid conflict with RubyGems 2.5 - [@caiosba](https://github.com/caiosba).
|
|
8
21
|
|
|
9
22
|
#### 0.2.0 (7/17/2015)
|
|
10
23
|
|
|
@@ -17,4 +30,3 @@
|
|
|
17
30
|
#### 0.1.2 (7/27/2011)
|
|
18
31
|
|
|
19
32
|
* Initial public release - [@dblock](https://github.com/dblock).
|
|
20
|
-
|
data/CONTRIBUTING.md
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
# Contributing to Gem-Licenses
|
|
2
2
|
|
|
3
|
-
This project is work of [many contributors](https://github.com/dblock/gem-licenses/graphs/contributors).
|
|
4
|
-
You're encouraged to submit [pull requests](https://github.com/dblock/gem-licenses/pulls),
|
|
5
|
-
[propose features and discuss issues](https://github.com/dblock/gem-licenses/issues).
|
|
3
|
+
This project is work of [many contributors](https://github.com/dblock/gem-licenses/graphs/contributors). You're encouraged to submit [pull requests](https://github.com/dblock/gem-licenses/pulls), [propose features and discuss issues](https://github.com/dblock/gem-licenses/issues).
|
|
6
4
|
|
|
7
|
-
In the examples below, substitute your
|
|
5
|
+
In the examples below, substitute your GitHub username for `contributor` in URLs.
|
|
8
6
|
|
|
9
7
|
## Fork the Project
|
|
10
8
|
|
|
11
|
-
Fork the [project on
|
|
9
|
+
Fork the [project on GitHub](https://github.com/dblock/gem-licenses) and check out your copy.
|
|
12
10
|
|
|
13
|
-
```
|
|
11
|
+
```shell
|
|
14
12
|
git clone https://github.com/contributor/gem-licenses.git
|
|
15
13
|
cd gem-licenses
|
|
16
14
|
git remote add upstream https://github.com/dblock/gem-licenses.git
|
|
@@ -20,7 +18,7 @@ git remote add upstream https://github.com/dblock/gem-licenses.git
|
|
|
20
18
|
|
|
21
19
|
Make sure your fork is up-to-date and create a topic branch for your feature or bug fix.
|
|
22
20
|
|
|
23
|
-
```
|
|
21
|
+
```shell
|
|
24
22
|
git checkout master
|
|
25
23
|
git pull upstream master
|
|
26
24
|
git checkout -b my-feature-branch
|
|
@@ -30,15 +28,16 @@ git checkout -b my-feature-branch
|
|
|
30
28
|
|
|
31
29
|
Ensure that you can build the project and run tests.
|
|
32
30
|
|
|
33
|
-
```
|
|
31
|
+
```shell
|
|
34
32
|
bundle install
|
|
35
33
|
bundle exec rake
|
|
36
34
|
```
|
|
37
35
|
|
|
36
|
+
`bundle exec rake` runs RuboCop and the specs. RuboCop also checks Ruby examples in Markdown, YAML, and spelling; add reviewed project vocabulary to [.spellcheck.txt](.spellcheck.txt). Run `bundle exec rake lint` to lint only. The linters install only on MRI Ruby 3.3 and newer; on older Rubies `rake` runs only the specs.
|
|
37
|
+
|
|
38
38
|
## Write Tests
|
|
39
39
|
|
|
40
|
-
Try to write a test that reproduces the problem you're trying to fix or describes a feature that you want to build.
|
|
41
|
-
Add to [spec](spec).
|
|
40
|
+
Try to write a test that reproduces the problem you're trying to fix or describes a feature that you want to build. Add to [spec](spec).
|
|
42
41
|
|
|
43
42
|
We definitely appreciate pull requests that highlight or reproduce a problem, even without a fix.
|
|
44
43
|
|
|
@@ -54,38 +53,38 @@ Document any external behavior in the [README](README.md).
|
|
|
54
53
|
|
|
55
54
|
## Update Changelog
|
|
56
55
|
|
|
57
|
-
Add a line to [CHANGELOG](CHANGELOG.md) under *Next
|
|
58
|
-
Make it look like every other line, including your name and link to your Github account.
|
|
56
|
+
Add a line to [CHANGELOG](CHANGELOG.md) under *Next*. Make it look like every other line, including your name and link to your GitHub account.
|
|
59
57
|
|
|
60
58
|
## Push
|
|
61
59
|
|
|
62
|
-
```
|
|
60
|
+
```shell
|
|
63
61
|
git push origin my-feature-branch
|
|
64
62
|
```
|
|
65
63
|
|
|
66
64
|
## Make a Pull Request
|
|
67
65
|
|
|
68
|
-
Go to https://github.com/contributor/
|
|
69
|
-
Click the 'Pull Request' button and fill out the form. Pull requests are usually reviewed within a few days.
|
|
66
|
+
Go to https://github.com/contributor/gem-licenses and select your feature branch. Click the 'Pull Request' button and fill out the form. Pull requests are usually reviewed within a few days.
|
|
70
67
|
|
|
71
68
|
## Update CHANGELOG Again
|
|
72
69
|
|
|
73
70
|
Update the [CHANGELOG](CHANGELOG.md) with the pull request number. A typical entry looks as follows.
|
|
74
71
|
|
|
75
|
-
```
|
|
72
|
+
```markdown
|
|
76
73
|
* [#123](https://github.com/dblock/gem-licenses/pull/123): Reticulated splines - [@contributor](https://github.com/contributor).
|
|
77
74
|
```
|
|
78
75
|
|
|
79
76
|
Amend your previous commit and force push the changes.
|
|
80
77
|
|
|
81
|
-
```
|
|
78
|
+
```shell
|
|
82
79
|
git commit --amend
|
|
83
80
|
git push origin my-feature-branch -f
|
|
81
|
+
```
|
|
82
|
+
|
|
84
83
|
## Rebase
|
|
85
84
|
|
|
86
85
|
If you've been working on a change for a while, rebase with upstream/master.
|
|
87
86
|
|
|
88
|
-
```
|
|
87
|
+
```shell
|
|
89
88
|
git fetch upstream
|
|
90
89
|
git rebase upstream/master
|
|
91
90
|
git push origin my-feature-branch -f
|
|
@@ -93,7 +92,7 @@ git push origin my-feature-branch -f
|
|
|
93
92
|
|
|
94
93
|
## Check on Your Pull Request
|
|
95
94
|
|
|
96
|
-
Go back to your pull request after a few minutes and see whether it passed muster with
|
|
95
|
+
Go back to your pull request after a few minutes and see whether it passed muster with GitHub Actions. Everything should look green, otherwise fix issues and amend your commit as described above.
|
|
97
96
|
|
|
98
97
|
## Be Patient
|
|
99
98
|
|
data/Gemfile
CHANGED
|
@@ -4,6 +4,15 @@ gemspec
|
|
|
4
4
|
|
|
5
5
|
group :development do
|
|
6
6
|
gem 'rake'
|
|
7
|
-
gem 'rspec', '~> 3.
|
|
8
|
-
|
|
7
|
+
gem 'rspec', '~> 3.7'
|
|
8
|
+
if RUBY_ENGINE == 'ruby' && Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.3')
|
|
9
|
+
gem 'commonmarker', '~> 2.10', require: false
|
|
10
|
+
gem 'rubocop', '~> 1.92'
|
|
11
|
+
gem 'rubocop-md', '~> 3.0', require: false
|
|
12
|
+
gem 'rubocop-prose', '~> 0.2', require: false
|
|
13
|
+
gem 'rubocop-rake', '~> 0.7', require: false
|
|
14
|
+
gem 'rubocop-spellcheck', '~> 0.2', require: false
|
|
15
|
+
gem 'rubocop-yaml', '~> 0.1.0', require: false
|
|
16
|
+
gem 'ruby-gem-release', '0.9.0', require: false
|
|
17
|
+
end
|
|
9
18
|
end
|
data/README.md
CHANGED
|
@@ -1,59 +1,73 @@
|
|
|
1
|
-
Gem-Licenses
|
|
2
|
-
============
|
|
1
|
+
# Gem-Licenses
|
|
3
2
|
|
|
4
|
-
[](https://github.com/dblock/gem-licenses/actions/workflows/test.yml)
|
|
5
4
|
|
|
6
|
-
Gem-licenses is an attempt to collect license information from project's gems. Similar to [3licenses](https://github.com/dblock/3licenses).
|
|
5
|
+
Gem-licenses is an attempt to collect license information from a project's gems. Similar to [3licenses](https://github.com/dblock/3licenses).
|
|
7
6
|
|
|
8
|
-
Motivation
|
|
9
|
-
==========
|
|
7
|
+
## Motivation
|
|
10
8
|
|
|
11
|
-
The overwhelming majority of
|
|
9
|
+
The overwhelming majority of third-party licenses require the application that uses them to reproduce the license verbatim in an artifact that is installed with the application itself. For instance, the BSD license states the following.
|
|
12
10
|
|
|
13
|
-
_“Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.”_
|
|
11
|
+
> _“Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.”_
|
|
14
12
|
|
|
15
|
-
Are you currently copying individual license.txt files "by hand" or are you including license text in your documentation with copy/paste? This project aims at improving this situation.
|
|
13
|
+
Are you currently copying individual `license.txt` files "by hand" or are you including license text in your documentation with copy/paste? This project aims at improving this situation.
|
|
16
14
|
|
|
17
|
-
Usage
|
|
18
|
-
=====
|
|
15
|
+
## Usage
|
|
19
16
|
|
|
20
17
|
Include gem-licenses in your project's Gemfile.
|
|
21
18
|
|
|
22
|
-
```
|
|
19
|
+
```ruby
|
|
23
20
|
group :development, :test do
|
|
24
21
|
gem 'gem-licenses'
|
|
25
22
|
end
|
|
26
23
|
```
|
|
27
24
|
|
|
28
|
-
|
|
25
|
+
Rails applications load the Rake tasks automatically. In other projects, load them in your `Rakefile`. This makes the tasks available each time Rake runs and doesn't copy any files into your project.
|
|
29
26
|
|
|
30
|
-
```
|
|
27
|
+
```ruby
|
|
28
|
+
require 'rake'
|
|
29
|
+
require 'gem-licenses'
|
|
31
30
|
Gem::GemLicenses.install_tasks
|
|
32
31
|
```
|
|
33
32
|
|
|
34
33
|
To list licenses try the following Rake task.
|
|
35
34
|
|
|
36
|
-
```
|
|
35
|
+
```shell
|
|
37
36
|
rake gem:licenses
|
|
38
37
|
```
|
|
39
38
|
|
|
40
|
-
To write a CSV file of gems
|
|
39
|
+
To write a CSV file of gems and licenses.
|
|
41
40
|
|
|
42
|
-
```
|
|
41
|
+
```shell
|
|
43
42
|
rake gem:licenses:csv['licenses.csv']
|
|
44
43
|
```
|
|
45
44
|
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
To write a CSV file of gems, licenses, and the copyright lines found in each gem's license, notice, and readme files.
|
|
46
|
+
|
|
47
|
+
```shell
|
|
48
|
+
rake gem:licenses:copyrights:csv['copyrights.csv']
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Command Line
|
|
52
|
+
|
|
53
|
+
The `gem-licenses` command reports on a project's bundle without changing its `Rakefile`. Run it under `bundle exec` when gem-licenses is in the Gemfile, or install the gem and point it at a project.
|
|
54
|
+
|
|
55
|
+
```shell
|
|
56
|
+
bundle exec gem-licenses
|
|
57
|
+
gem-licenses --gemfile path/to/Gemfile
|
|
58
|
+
gem-licenses --csv licenses.csv
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Without `--gemfile`, it reads the bundle that `BUNDLE_GEMFILE` or the `Gemfile` in the current directory describes, whose gems must be installed. Pass `--strict` to exit with status 1 when a gem has no guessable license, for example in CI. Run `gem-licenses --help` for all options.
|
|
62
|
+
|
|
63
|
+
## Contributing
|
|
48
64
|
|
|
49
|
-
See [CONTRIBUTING](CONTRIBUTING.md).
|
|
65
|
+
See [CONTRIBUTING](CONTRIBUTING.md), [CHANGELOG](CHANGELOG.md), and [RELEASING](RELEASING.md).
|
|
50
66
|
|
|
51
|
-
License
|
|
52
|
-
=======
|
|
67
|
+
## License
|
|
53
68
|
|
|
54
|
-
This project is
|
|
69
|
+
This project is licensed under the MIT license, see [LICENSE](LICENSE) for details.
|
|
55
70
|
|
|
56
|
-
Copyright
|
|
57
|
-
=========
|
|
71
|
+
## Copyright
|
|
58
72
|
|
|
59
73
|
Copyright (c) Daniel Doubrovkine, 2011-2016, Artsy, Inc.
|