diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 600a552..d716104 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,15 +4,18 @@ on: [push, pull_request] jobs: build: + runs-on: macos-latest - runs-on: macOS-latest + strategy: + matrix: + ruby-version: ['2.6', '2.7', '3.0', '3.1'] steps: - uses: actions/checkout@v1 - - name: Set up Ruby 2.6 + - name: Set up Ruby ${{ matrix.ruby-version }} uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6 + ruby-version: ${{ matrix.ruby-version }} bundler-cache: true - name: Run tests - run: make tests \ No newline at end of file + run: make tests diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ab5737..a58d5e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [UNRELEASE] +- Add support for Ruby 3.x ([#16](https://github.com/faberNovel/ad_licenselint/pull/16)) + ## [1.3.0] - 2021-09-02 ### Fixed diff --git a/Gemfile.lock b/Gemfile.lock index 213b0a8..a3da098 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,15 +9,16 @@ PATH GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.3) - activesupport (6.1.4.1) + CFPropertyList (3.0.5) + rexml + activesupport (6.1.6.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) zeitwerk (~> 2.3) - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) + addressable (2.8.1) + public_suffix (>= 2.0.2, < 6.0) algoliasearch (1.27.5) httpclient (~> 2.8, >= 2.8.3) json (>= 1.5.1) @@ -25,11 +26,11 @@ GEM atomos (0.1.3) builder (3.2.4) byebug (11.1.3) - claide (1.0.3) - cocoapods (1.11.0) + claide (1.1.0) + cocoapods (1.11.3) addressable (~> 2.8) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.11.0) + cocoapods-core (= 1.11.3) cocoapods-deintegrate (>= 1.0.3, < 2.0) cocoapods-downloader (>= 1.4.0, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0) @@ -44,7 +45,7 @@ GEM nap (~> 1.0) ruby-macho (>= 1.0, < 3.0) xcodeproj (>= 1.21.0, < 2.0) - cocoapods-core (1.11.0) + cocoapods-core (1.11.3) activesupport (>= 5.0, < 7) addressable (~> 2.8) algoliasearch (~> 1.0) @@ -55,7 +56,7 @@ GEM public_suffix (~> 4.0) typhoeus (~> 1.0) cocoapods-deintegrate (1.0.5) - cocoapods-downloader (1.5.0) + cocoapods-downloader (1.6.3) cocoapods-plugins (1.0.0) nap cocoapods-search (1.0.1) @@ -65,22 +66,22 @@ GEM cocoapods-try (1.2.0) colored2 (3.1.2) colorize (0.8.1) - concurrent-ruby (1.1.9) + concurrent-ruby (1.1.10) escape (0.0.4) - ethon (0.14.0) + ethon (0.15.0) ffi (>= 1.15.0) - ffi (1.15.4) + ffi (1.15.5) fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) httpclient (2.8.3) - i18n (1.8.10) + i18n (1.12.0) concurrent-ruby (~> 1.0) - json (2.5.1) - minitest (5.14.1) + json (2.6.2) + minitest (5.16.3) minitest-hooks (1.5.0) minitest (> 5.3) - minitest-reporters (1.4.2) + minitest-reporters (1.5.0) ansi builder minitest (>= 5.0) @@ -89,26 +90,26 @@ GEM nanaimo (0.3.0) nap (1.1.0) netrc (0.11.0) - public_suffix (4.0.6) + public_suffix (4.0.7) rake (12.3.3) rexml (3.2.5) ruby-macho (2.5.1) - ruby-progressbar (1.10.1) + ruby-progressbar (1.11.0) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) typhoeus (1.4.0) ethon (>= 0.9.0) - tzinfo (2.0.4) + tzinfo (2.0.5) concurrent-ruby (~> 1.0) - unicode-display_width (1.7.0) - xcodeproj (1.21.0) + unicode-display_width (1.8.0) + xcodeproj (1.22.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) nanaimo (~> 0.3.0) rexml (~> 3.2.4) - zeitwerk (2.4.2) + zeitwerk (2.6.0) PLATFORMS ruby @@ -117,10 +118,10 @@ DEPENDENCIES ad_licenselint! bundler (>= 1.12.0, < 3.0.0) byebug (~> 11.0) - minitest (~> 5.11) + minitest (~> 5.16) minitest-hooks (~> 1.5) minitest-reporters (~> 1.3) rake (~> 12.3) BUNDLED WITH - 2.1.4 + 2.3.22 diff --git a/README.md b/README.md index d082a22..0d963a9 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,22 @@ # ADLicenselint -The purpose of this gem is to automatically generate a summary of the licenses for the pods used in an iOS project. - +The purpose of this gem is to automatically generate a summary of the licenses for the pods used in +an iOS project. ## Example -``` +```ruby bundle exec ad_licenselint -f term -p /path/to/Podfile -a -+-------------------+----------------------------+----------------------------------------------------+ -| Pod | License | Source | -+-------------------+----------------------------+----------------------------------------------------+ -| Alamofire | MIT | https://github.com/Alamofire/Alamofire | -| Firebase | Apache | https://github.com/firebase/firebase-ios-sdk | -| ObjectivePGP | BSD for non-commercial use | https://github.com/krzyzanowskim/ObjectivePGP | -| SwiftGen | MIT | https://github.com/SwiftGen/SwiftGen | -| SwiftLint | MIT | https://github.com/realm/SwiftLint | -+-------------------+----------------------------+----------------------------------------------------+ ++-------------------+----------------------------+-----------------------------------------------+ +| Pod | License | Source | ++-------------------+----------------------------+-----------------------------------------------+ +| Alamofire | MIT | https://github.com/Alamofire/Alamofire | +| Firebase | Apache | https://github.com/firebase/firebase-ios-sdk | +| ObjectivePGP | BSD for non-commercial use | https://github.com/krzyzanowskim/ObjectivePGP | +| SwiftGen | MIT | https://github.com/SwiftGen/SwiftGen | +| SwiftLint | MIT | https://github.com/realm/SwiftLint | ++-------------------+----------------------------+-----------------------------------------------+ ``` ## Installation @@ -28,54 +28,57 @@ gem 'ad_licenselint' ``` And then execute: -``` + +```ruby bundle install ``` You can also install it globally running: -``` + +```ruby gem install ad_licenselint ``` ## Usage -### Command line: +### Command line -``` +```bash cd path/to/Podfile bundle exec ad_licenselint # Alternatively, use the -p option bundle exec ad_licenselint -p path/to/Podfile -+-------------------+----------------------------+----------------------------------------------------+ -| Pod | License | Source | -+-------------------+----------------------------+----------------------------------------------------+ -| ObjectivePGP | BSD for non-commercial use | https://github.com/krzyzanowskim/ObjectivePGP | -+-------------------+----------------------------+----------------------------------------------------+ ++-------------------+----------------------------+-----------------------------------------------+ +| Pod | License | Source | ++-------------------+----------------------------+-----------------------------------------------+ +| ObjectivePGP | BSD for non-commercial use | https://github.com/krzyzanowskim/ObjectivePGP | ++-------------------+----------------------------+-----------------------------------------------+ ``` -This will output the licenses that are not free to use in your project. By default, `MIT`, `Apache` or `BSD` are considered valid. +This will output the licenses that are not free to use in your project. By default, `MIT`, `Apache` +or `BSD` are considered valid. If you want to see licenses that are valid anyway, run: -``` +```bash bundle exec ad_licenselint -a -+-------------------+----------------------------+----------------------------------------------------+ -| Pod | License | Source | -+-------------------+----------------------------+----------------------------------------------------+ -| Alamofire | MIT | https://github.com/Alamofire/Alamofire | -| Firebase | Apache | https://github.com/firebase/firebase-ios-sdk | -| ObjectivePGP | BSD for non-commercial use | https://github.com/krzyzanowskim/ObjectivePGP | -| SwiftGen | MIT | https://github.com/SwiftGen/SwiftGen | -| SwiftLint | MIT | https://github.com/realm/SwiftLint | -+-------------------+----------------------------+----------------------------------------------------+ ++-------------------+----------------------------+-----------------------------------------------+ +| Pod | License | Source | ++-------------------+----------------------------+-----------------------------------------------+ +| Alamofire | MIT | https://github.com/Alamofire/Alamofire | +| Firebase | Apache | https://github.com/firebase/firebase-ios-sdk | +| ObjectivePGP | BSD for non-commercial use | https://github.com/krzyzanowskim/ObjectivePGP | +| SwiftGen | MIT | https://github.com/SwiftGen/SwiftGen | +| SwiftLint | MIT | https://github.com/realm/SwiftLint | ++-------------------+----------------------------+-----------------------------------------------+ ``` By default the output format is set to `term`. You can use `md` to generate a markdown output: -``` +```bash bundle exec ad_licenselint -f md ``` @@ -88,10 +91,12 @@ The output becomes: | ObjectivePGP | BSD for non-commercial use | https://github.com/krzyzanowskim/ObjectivePGP |
+ Licenses ### ObjectivePGP -``` + +```markdown The ObjectivePGP stays under a dual license: ==================================================================== @@ -127,13 +132,15 @@ Paid for commercial use: Commercial-use license to use in commercial products. Please contact me via email (marcin@krzyzanowskim.com) for details. ``` +
--- -If you want to see the warnings for a subset of pods (and not the whole pod list from the Podfile), use the `-o` option: +If you want to see the warnings for a subset of pods (and not the whole pod list from the Podfile), +use the `-o` option: -``` +```bash bundle exec ad_licenselint -o Alamofire -a +-------------------+---------+----------------------------------------------------+ @@ -143,25 +150,27 @@ bundle exec ad_licenselint -o Alamofire -a +-------------------+---------+----------------------------------------------------+ ``` -``` +```bash bundle exec ad_licenselint -o ObjectivePGP -+-------------------+----------------------------+----------------------------------------------------+ -| Pod | License | Source | -+-------------------+----------------------------+----------------------------------------------------+ -| ObjectivePGP | BSD for non-commercial use | https://github.com/krzyzanowskim/ObjectivePGP | -+-------------------+----------------------------+----------------------------------------------------+ ++-------------------+----------------------------+-----------------------------------------------+ +| Pod | License | Source | ++-------------------+----------------------------+-----------------------------------------------+ +| ObjectivePGP | BSD for non-commercial use | https://github.com/krzyzanowskim/ObjectivePGP | ++-------------------+----------------------------+-----------------------------------------------+ ``` If you want to see all the options available, display help: -``` +```bash bundle exec ad_licenselint -h ``` ### Allow list -You may want to hide warnings for pods you know are valid (for instance private pods that have a commercial license). For this purpose, you can create a file `.ad_licenselint.yml` next to your `Podfile` that looks like this: +You may want to hide warnings for pods you know are valid (for instance private pods that have a +commercial license). For this purpose, you can create a file `.ad_licenselint.yml` next to your +`Podfile` that looks like this: ```yaml allow: @@ -196,4 +205,5 @@ Run `make tests` to run the tests. ## License -The gem is available as open source under the terms of the [MIT license](http://opensource.org/licenses/mit-license.php) +The gem is available as open source under the terms of the +[MIT license](http://opensource.org/licenses/mit-license.php) diff --git a/ad_licenselint.gemspec b/ad_licenselint.gemspec index 73f1ccd..e6cdf21 100644 --- a/ad_licenselint.gemspec +++ b/ad_licenselint.gemspec @@ -13,7 +13,7 @@ Gem::Specification.new do |s| s.add_development_dependency 'bundler', '>= 1.12.0', '< 3.0.0' s.add_development_dependency 'rake', '~> 12.3' - s.add_development_dependency 'minitest', '~> 5.11' + s.add_development_dependency 'minitest', '~> 5.16' s.add_development_dependency 'byebug', '~> 11.0' s.add_development_dependency 'minitest-reporters', '~> 1.3' s.add_development_dependency 'minitest-hooks', '~> 1.5' @@ -22,5 +22,5 @@ Gem::Specification.new do |s| s.add_dependency 'terminal-table', '~> 1.8' s.add_dependency 'cocoapods', '~> 1.9' - s.required_ruby_version = '~> 2.3' -end \ No newline at end of file + s.required_ruby_version = '>= 2.6' +end diff --git a/fastlane-plugin-ad_licenselint/fastlane-plugin-ad_licenselint.gemspec b/fastlane-plugin-ad_licenselint/fastlane-plugin-ad_licenselint.gemspec index 1947fe1..ea14eb3 100644 --- a/fastlane-plugin-ad_licenselint/fastlane-plugin-ad_licenselint.gemspec +++ b/fastlane-plugin-ad_licenselint/fastlane-plugin-ad_licenselint.gemspec @@ -22,7 +22,7 @@ Gem::Specification.new do |spec| # Don't add a dependency to fastlane or fastlane_re # since this would cause a circular dependency - spec.add_dependency 'ad_licenselint', '~> 1.1' + spec.add_dependency 'ad_licenselint', '~> 1' spec.add_development_dependency('pry') spec.add_development_dependency('bundler')