gem-licenses 0.2.2 → 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.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/lint.yml +31 -0
  3. data/.github/workflows/release.yml +27 -0
  4. data/.github/workflows/test.yml +39 -0
  5. data/.gitignore +1 -0
  6. data/.rubocop.yml +90 -4
  7. data/.rubocop_todo.yml +83 -24
  8. data/.spellcheck.txt +44 -0
  9. data/CHANGELOG.md +14 -2
  10. data/CONTRIBUTING.md +10 -13
  11. data/Gemfile +10 -1
  12. data/README.md +34 -21
  13. data/RELEASING.md +20 -48
  14. data/Rakefile +22 -3
  15. data/exe/gem-licenses +8 -0
  16. data/gem-licenses.gemspec +4 -2
  17. data/lib/gem/licenses.rb +2 -2
  18. data/lib/gem/specification.rb +18 -15
  19. data/lib/gem-licenses/cli.rb +97 -0
  20. data/lib/gem-licenses/copyrights.rb +48 -0
  21. data/lib/gem-licenses/install_tasks.rb +2 -0
  22. data/lib/gem-licenses/railtie.rb +12 -0
  23. data/lib/gem-licenses/report.rb +46 -0
  24. data/lib/gem-licenses/version.rb +1 -1
  25. data/lib/gem-licenses.rb +1 -0
  26. data/lib/gem_licenses.rb +2 -0
  27. data/script/release.rb +18 -0
  28. data/spec/fixtures/gems/copyrights/LICENSE +7 -0
  29. data/spec/fixtures/gems/copyrights/README.md +17 -0
  30. data/spec/fixtures/gems/empty_reference_before_license/README +6 -0
  31. data/spec/fixtures/gems/licensed_under_the_apache_license/README.md +4 -0
  32. data/spec/fixtures/gems/mit_license_in_license_md/LICENSE.md +3 -0
  33. data/spec/fixtures/gems/same_terms_of_ruby/README +4 -0
  34. data/spec/gem/licenses_spec.rb +7 -1
  35. data/spec/gem/specification_spec.rb +49 -1
  36. data/spec/gem_licenses/cli_spec.rb +120 -0
  37. data/spec/gem_licenses/install_tasks_spec.rb +55 -0
  38. data/spec/release/release_spec.rb +74 -0
  39. data/spec/tasks/licenses_rake_spec.rb +101 -0
  40. data/tasks/licenses.rake +23 -27
  41. metadata +55 -12
  42. data/.travis.yml +0 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 822e6db6df0f53b90818db751e9476cbf6b5b5bfde69673c54b0444b5761c0b7
4
- data.tar.gz: f090d8718658f5b3f95a0ec6aae9cbdb8c67955b9bd10e6f7fe146db794e404c
3
+ metadata.gz: a3d2d438cff8d4703d16dd7f171118ff15df0cb2bf70adb439ab26b3fe932a04
4
+ data.tar.gz: 863d5331d55f2df94e708be3ec533720f33ed0a112986a8ac16509679117e860
5
5
  SHA512:
6
- metadata.gz: b3a7e50d6f28af9e98f7ff8967b5e828182a13340ef979ae169cb984382e015619a051eb2bd4e3f93e0bfeffc077f62d9d4fd6963a5339905d9d4431e920e584
7
- data.tar.gz: 560bceec5cc8a43e52df4a368a01b40d8a95f7a10f0c1bb3f3751a39a01a2841ff2f4df97cf4f69cfb914e58851d701e15f755a850803d94dffda86ddcc34a52
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
@@ -10,6 +10,7 @@ doc
10
10
 
11
11
  # bundler
12
12
  .bundle
13
+ /vendor/bundle/
13
14
 
14
15
  # jeweler generated
15
16
  pkg
data/.rubocop.yml CHANGED
@@ -1,12 +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:
2
- TargetRubyVersion: 2.2
11
+ NewCops: enable
12
+ TargetRubyVersion: 2.7
3
13
  DisplayCopNames: true
4
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
5
42
  Exclude:
6
- - vendor/**/*
43
+ - "**/*.md"
7
44
 
8
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
9
58
  Exclude:
10
- - tasks/*.rake
59
+ - ".github/workflows/*.yml"
11
60
 
12
- inherit_from: .rubocop_todo.yml
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
75
+ Exclude:
76
+ - CHANGELOG.md
77
+
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,47 +1,106 @@
1
1
  # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2017-11-02 19:09:46 +0100 using RuboCop version 0.51.0.
2
+ # `rubocop --auto-gen-config --no-exclude-limit --no-offense-counts --no-auto-gen-timestamp`
3
+ # using RuboCop version 1.92.3.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 1
10
- Lint/HandleExceptions:
9
+ # This cop supports safe autocorrection (--autocorrect).
10
+ Gemspec/DeprecatedAttributeAssignment:
11
11
  Exclude:
12
- - 'lib/gem/specification.rb'
12
+ - 'gem-licenses.gemspec'
13
13
 
14
- # Offense count: 1
15
- Metrics/AbcSize:
16
- Max: 21
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'
17
22
 
18
- # Offense count: 1
19
- Metrics/CyclomaticComplexity:
20
- Max: 7
23
+ # This cop supports safe autocorrection (--autocorrect).
24
+ Layout/EmptyLineAfterGuardClause:
25
+ Exclude:
26
+ - 'lib/gem/specification.rb'
27
+
28
+ # This cop supports safe autocorrection (--autocorrect).
29
+ Lint/RedundantStringCoercion:
30
+ Exclude:
31
+ - 'tasks/licenses.rake'
21
32
 
22
- # Offense count: 11
23
- # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
24
- # URISchemes: http, https
25
- Metrics/LineLength:
26
- Max: 107
33
+ # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
34
+ Metrics/AbcSize:
35
+ Exclude:
36
+ - 'lib/gem/specification.rb'
27
37
 
28
- # Offense count: 3
29
- # Configuration parameters: CountComments.
38
+ # Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns.
30
39
  Metrics/MethodLength:
31
- Max: 16
40
+ Exclude:
41
+ - 'lib/gem/licenses.rb'
42
+ - 'lib/gem/specification.rb'
32
43
 
33
- # Offense count: 1
34
- # Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
44
+ # Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms.
45
+ # CheckDefinitionPathHierarchyRoots: lib, spec, test, src
35
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
36
47
  Naming/FileName:
37
48
  Exclude:
38
49
  - 'lib/gem-licenses.rb'
39
50
 
40
- # Offense count: 3
51
+ # This cop supports safe autocorrection (--autocorrect).
52
+ Rake/Desc:
53
+ Exclude:
54
+ - 'tasks/licenses.rake'
55
+
56
+ # Configuration parameters: AllowedConstants.
41
57
  Style/Documentation:
42
58
  Exclude:
43
- - 'spec/**/*'
44
- - 'test/**/*'
45
59
  - 'lib/gem-licenses/install_tasks.rb'
46
60
  - 'lib/gem/licenses.rb'
47
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'
100
+
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.3.0 (11/25/2026)
2
+
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
+
1
14
  #### 0.2.2 (2/16/2018)
2
15
 
3
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 Rubygems 2.5 - [@caiosba](https://github.com/caiosba).
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,14 +1,12 @@
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 Github username for `contributor` in URLs.
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 Github](https://github.com/dblock/gem-licenses) and check out your copy.
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
@@ -35,10 +33,11 @@ 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,8 +53,7 @@ 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 Release*.
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
 
@@ -65,14 +63,13 @@ git push origin my-feature-branch
65
63
 
66
64
  ## Make a Pull Request
67
65
 
68
- Go to https://github.com/contributor/gem-licenses and select your feature branch.
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
 
@@ -95,7 +92,7 @@ git push origin my-feature-branch -f
95
92
 
96
93
  ## Check on Your Pull Request
97
94
 
98
- Go back to your pull request after a few minutes and see whether it passed muster with Travis-CI. Everything should look green, otherwise fix issues and amend your commit as described above.
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.
99
96
 
100
97
  ## Be Patient
101
98
 
data/Gemfile CHANGED
@@ -5,5 +5,14 @@ gemspec
5
5
  group :development do
6
6
  gem 'rake'
7
7
  gem 'rspec', '~> 3.7'
8
- gem 'rubocop', '0.51.0'
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,21 +1,18 @@
1
- Gem-Licenses
2
- ============
1
+ # Gem-Licenses
3
2
 
4
- [![Build Status](https://travis-ci.org/dblock/gem-licenses.svg)](https://travis-ci.org/dblock/gem-licenses)
3
+ [![Test](https://github.com/dblock/gem-licenses/actions/workflows/test.yml/badge.svg)](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 3rd 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.
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
 
@@ -25,9 +22,10 @@ group :development, :test do
25
22
  end
26
23
  ```
27
24
 
28
- Install Rake tasks from Rakefile.
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'
31
29
  require 'gem-licenses'
32
30
  Gem::GemLicenses.install_tasks
33
31
  ```
@@ -38,23 +36,38 @@ To list licenses try the following Rake task.
38
36
  rake gem:licenses
39
37
  ```
40
38
 
41
- To write a CSV file of gems + licenses.
39
+ To write a CSV file of gems and licenses.
42
40
 
43
41
  ```shell
44
42
  rake gem:licenses:csv['licenses.csv']
45
43
  ```
46
44
 
47
- Contributing
48
- ============
45
+ To write a CSV file of gems, licenses, and the copyright lines found in each gem's license, notice, and readme files.
49
46
 
50
- See [CONTRIBUTING](CONTRIBUTING.md).
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
64
+
65
+ See [CONTRIBUTING](CONTRIBUTING.md), [CHANGELOG](CHANGELOG.md), and [RELEASING](RELEASING.md).
51
66
 
52
- License
53
- =======
67
+ ## License
54
68
 
55
- This project is licenced under the MIT license, see [LICENSE](LICENSE) for details.
69
+ This project is licensed under the MIT license, see [LICENSE](LICENSE) for details.
56
70
 
57
- Copyright
58
- =========
71
+ ## Copyright
59
72
 
60
73
  Copyright (c) Daniel Doubrovkine, 2011-2016, Artsy, Inc.