rubocop-cask 0.10.2 → 0.10.4
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb185f419db5f05fa689970df5fe5efc4e52799c
|
4
|
+
data.tar.gz: 82ecdb2f683f0a97652fe067741c8d4641f5f2b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 951eb890253e4a31ee1fdd61ed2efcce02835b1b863b287b37fef7f2ae75ba9f158a12877e2f5788bf6b929425cc36993e404525ded9e78fab290a01fa81b192
|
7
|
+
data.tar.gz: 5f79342f4218cff5e71aeb860a9c8d14dc724cbd73ad18204a9624c9a564a32d9142fa44e7be5eac4d3db23c9b7cc53de34b020021d36bd4b76f851042183139
|
data/lib/rubocop/cask/version.rb
CHANGED
@@ -8,7 +8,7 @@ module RuboCop
|
|
8
8
|
# or if it doesn't, checks if a comment in the form
|
9
9
|
# `# example.com was verified as official when first introduced to the cask`
|
10
10
|
# is present.
|
11
|
-
class HomepageMatchesUrl < Cop
|
11
|
+
class HomepageMatchesUrl < Cop # rubocop:disable Metrics/ClassLength
|
12
12
|
extend Forwardable
|
13
13
|
include CaskHelp
|
14
14
|
|
@@ -29,6 +29,7 @@ module RuboCop
|
|
29
29
|
|
30
30
|
def on_cask(cask_block)
|
31
31
|
@cask_block = cask_block
|
32
|
+
return unless homepage_stanza
|
32
33
|
add_offenses
|
33
34
|
end
|
34
35
|
|
@@ -133,7 +134,11 @@ module RuboCop
|
|
133
134
|
end
|
134
135
|
|
135
136
|
def homepage
|
136
|
-
PublicSuffix.domain(domain(
|
137
|
+
PublicSuffix.domain(domain(homepage_stanza))
|
138
|
+
end
|
139
|
+
|
140
|
+
def homepage_stanza
|
141
|
+
toplevel_stanzas.find(&:homepage?)
|
137
142
|
end
|
138
143
|
end
|
139
144
|
end
|
@@ -196,4 +196,16 @@ describe RuboCop::Cop::Cask::HomepageMatchesUrl do
|
|
196
196
|
include_examples 'reports offenses'
|
197
197
|
end
|
198
198
|
end
|
199
|
+
|
200
|
+
context 'when there is no homepage' do
|
201
|
+
let(:source) do
|
202
|
+
<<-CASK.undent
|
203
|
+
cask 'foo' do
|
204
|
+
url 'https://example.com/foo.zip'
|
205
|
+
end
|
206
|
+
CASK
|
207
|
+
end
|
208
|
+
|
209
|
+
include_examples 'does not report any offenses'
|
210
|
+
end
|
199
211
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-cask
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Hagins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: public_suffix
|