danger-ad_licenselint 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e1147bc11ec4609617531e4f35ded80e5ed823673b59553b240b71a7d02605f1
4
- data.tar.gz: 9095eba40b60ae7a5154deb89aabf9c0be073220c51e3a71bed5776924600b45
3
+ metadata.gz: d8b10e8d4d50d1bd66f67405c00eb6daf71409c98b0d42da939a102e06a942ab
4
+ data.tar.gz: cfd159ba9cf615e2840f8ed83f645eb45e428a35d201b9d170509db41c42b7cc
5
5
  SHA512:
6
- metadata.gz: c9aaa770a433616ccd9a604bcaba1b6828c2a5356e798d08c0d9c0e7c1151c1904d5bda41e2c85413ee2fb24305c900b5d45e4a2ca023dbad6ef2dd898d9e2c1
7
- data.tar.gz: 7705f712e7fdc1881a1b79105ea1c56ee1f975a0bd8603e803367f70666ab78b452d03204e19d2bbb83e5aa4030a7793d8770b5b05ab482e95dd99cbd932b825
6
+ metadata.gz: 7b96cdf59a4b701ffe9367c3658b8e6d394d109d8e728ae7db238fe92916fc3a9bd10a7be21aa6677dda6d7f8f93b9c0b574bcb3b668d1e01d3de7fac19b68bc
7
+ data.tar.gz: 7d813b58ce7b1eb45ede7fc0877611dc9c743de71bbcfc4caa247b9a76ccb216a41aa0cb198c23f2c6b3841bc0c822184bfd85dc19f6db58844161a8d645c719
data/CHANGELOG.md ADDED
@@ -0,0 +1,17 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [UNRELEASE]
8
+
9
+ ## [1.0.1] - 2021-03-23
10
+
11
+ ### Fixed
12
+
13
+ - Fix `Podfile` and `Podfile.lock` paths ([#12](https://github.com/faberNovel/ad_licenselint/pull/12))
14
+
15
+ ## [1.0.0] - 2021-03-23
16
+
17
+ Initial version
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- danger-ad_licenselint (1.0.0)
4
+ danger-ad_licenselint (1.0.1)
5
5
  ad_licenselint (~> 1.1)
6
6
  danger-plugin-api (~> 1.0)
7
7
 
@@ -13,7 +13,7 @@ GEM
13
13
  i18n (>= 0.7, < 2)
14
14
  minitest (~> 5.1)
15
15
  tzinfo (~> 1.1)
16
- ad_licenselint (1.1.0)
16
+ ad_licenselint (1.2.0)
17
17
  cocoapods-core (~> 1.9)
18
18
  colorize (~> 0.8)
19
19
  terminal-table (~> 1.8)
@@ -1,3 +1,3 @@
1
1
  module AdLicenselint
2
- VERSION = "1.0.0".freeze
2
+ VERSION = "1.0.1".freeze
3
3
  end
@@ -30,7 +30,7 @@ module Danger
30
30
  #
31
31
 
32
32
  def lint_licenses(inline_mode: false)
33
- return if git.modified_files.grep(/Podfile/).empty?
33
+ return if podfile_path.nil? || lockfile_path.nil?
34
34
 
35
35
  runner = ADLicenseLint::Runner.new({
36
36
  format: ADLicenseLint::Constant::MARKDOWN_FORMAT_OPTION,
@@ -49,6 +49,14 @@ module Danger
49
49
 
50
50
  private
51
51
 
52
+ def podfile_path
53
+ git.modified_files.grep(/Podfile\z/).first
54
+ end
55
+
56
+ def lockfile_path
57
+ git.modified_files.grep(/Podfile.lock\z/).first
58
+ end
59
+
52
60
  def write_to_file(content)
53
61
  result = nil
54
62
  Tempfile.create { |f|
@@ -85,10 +93,10 @@ module Danger
85
93
  end
86
94
 
87
95
  def get_modified_pods_from_diff
88
- after_podfile = write_to_file(git.info_for_file("Podfile")[:after]) { |path|
96
+ after_podfile = write_to_file(git.info_for_file(podfile_path)[:after]) { |path|
89
97
  Pod::Podfile.from_file path
90
98
  }
91
- before_lockfile = write_to_file(git.info_for_file("Podfile.lock")[:before]) { |path|
99
+ before_lockfile = write_to_file(git.info_for_file(lockfile_path)[:before]) { |path|
92
100
  Pod::Lockfile.from_file(Pathname(path))
93
101
  }
94
102
  changes = before_lockfile.detect_changes_with_podfile(after_podfile)
@@ -96,14 +104,14 @@ module Danger
96
104
  end
97
105
 
98
106
  def post_inline_messages(report)
99
- podfile_content = git.info_for_file("Podfile")[:after]
107
+ podfile_content = git.info_for_file(podfile_path)[:after]
100
108
  report
101
109
  .entries
102
110
  .each { |pod_report|
103
111
  line = line_for_content(pod_report.pod_name, podfile_content)
104
112
  warn(
105
113
  comment_for_report(pod_report),
106
- file: "Podfile",
114
+ file: podfile_path,
107
115
  line: line
108
116
  )
109
117
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-ad_licenselint
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre Felgines
@@ -172,6 +172,7 @@ extensions: []
172
172
  extra_rdoc_files: []
173
173
  files:
174
174
  - ".rubocop.yml"
175
+ - CHANGELOG.md
175
176
  - Gemfile
176
177
  - Gemfile.lock
177
178
  - Guardfile