Skip to content

Commit

Permalink
Merge pull request #19 from lucas-giaco/feat/support_ruby_3
Browse files Browse the repository at this point in the history
Add Ruby 3.x support
  • Loading branch information
felginep authored Sep 15, 2022
2 parents 0baf261 + 97b5e89 commit 78601e1
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 77 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
run: make tests
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
49 changes: 25 additions & 24 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,28 @@ 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)
ansi (1.5.0)
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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -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
100 changes: 55 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
```

Expand All @@ -88,10 +91,12 @@ The output becomes:
| ObjectivePGP | BSD for non-commercial use | https://github.com/krzyzanowskim/ObjectivePGP |

<details>

<summary>Licenses</summary>

### ObjectivePGP
```

```markdown
The ObjectivePGP stays under a dual license:

====================================================================
Expand Down Expand Up @@ -127,13 +132,15 @@ Paid for commercial use:

Commercial-use license to use in commercial products. Please contact me via email ([email protected]) for details.
```

</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

+-------------------+---------+----------------------------------------------------+
Expand All @@ -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:
Expand Down Expand Up @@ -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)
6 changes: 3 additions & 3 deletions ad_licenselint.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
s.required_ruby_version = '>= 2.6'
end
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 78601e1

Please sign in to comment.