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: 590cfc6dfa78c2b1582915ba0e5701bf429586fc
4
- data.tar.gz: d0570e1b7c9462920ff6c244c2dff6c30371b9eb
3
+ metadata.gz: bb185f419db5f05fa689970df5fe5efc4e52799c
4
+ data.tar.gz: 82ecdb2f683f0a97652fe067741c8d4641f5f2b3
5
5
  SHA512:
6
- metadata.gz: 1df927d6eceb701e4c24d8cde86d47df3790bcc80419ad5307af524f6ed8a91cab2276a3073d77cd3e878c325e3a1bf7b1e80c8fbbdbd431f3407a6325a3cceb
7
- data.tar.gz: 49ff1d810d554dc56d5ee75af8ec3dda0d5876de520f1c62e945c48b71b53b509ca0c9d9c535ea57db9d2420690759e089ac70ed712ccedde42cd4708ec24c10
6
+ metadata.gz: 951eb890253e4a31ee1fdd61ed2efcce02835b1b863b287b37fef7f2ae75ba9f158a12877e2f5788bf6b929425cc36993e404525ded9e78fab290a01fa81b192
7
+ data.tar.gz: 5f79342f4218cff5e71aeb860a9c8d14dc724cbd73ad18204a9624c9a564a32d9142fa44e7be5eac4d3db23c9b7cc53de34b020021d36bd4b76f851042183139
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Cask
5
5
  # Version information for the Cask RuboCop plugin.
6
6
  module Version
7
- STRING = '0.10.2'.freeze
7
+ STRING = '0.10.4'.freeze
8
8
 
9
9
  def self.gem_version
10
10
  Gem::Version.new(STRING)
@@ -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(toplevel_stanzas.find(&:homepage?)))
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.2
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-08 00:00:00.000000000 Z
11
+ date: 2016-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: public_suffix