rubocop-cask 0.13.1 → 0.13.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -0
- data/lib/rubocop/cask/ast/stanza.rb +2 -2
- data/lib/rubocop/cask/extend/node.rb +5 -5
- data/lib/rubocop/cask/version.rb +1 -1
- data/lib/rubocop/cop/cask/homepage_url_trailing_slash.rb +1 -1
- data/spec/rubocop/cop/cask/stanza_order_spec.rb +1 -1
- data/spec/support/cop_shared_examples.rb +9 -9
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e35cb45141219854be2f103929cca3c7cc5dd68
|
4
|
+
data.tar.gz: d5a858d92468080ff329af0ab01ddfce94be981e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ff8f36c00b1ff154badc1bd56ff65eb9f9fa931d3f13027bb7e13c9a02acfec902027abea90c3d8415ea59f7b698a9b36090dec94ddac2817f95b0384a73844
|
7
|
+
data.tar.gz: 82a6e8f0dbf13e1ffed5f41095aae62990c7154daf1be1a8389ebf4de8d7a8fbd64713b4e6a64ecf30ede04f4fbad2369af52e69bc7b79ae43892cf3cb63eac6
|
data/README.md
CHANGED
@@ -74,6 +74,17 @@ Cask/NoDslVersion:
|
|
74
74
|
4. Push to the branch (`git push origin my-new-feature`)
|
75
75
|
5. Create new Pull Request
|
76
76
|
|
77
|
+
|
78
|
+
## Maintaining
|
79
|
+
|
80
|
+
To publish a new release:
|
81
|
+
|
82
|
+
1. update the version in `lib/rubocop/cask/version.rb`
|
83
|
+
2. run `bundle exec rake build` to run tests and generate the changelog
|
84
|
+
3. commit the changes
|
85
|
+
4. run `bundle exec rake release`
|
86
|
+
|
87
|
+
|
77
88
|
## License
|
78
89
|
|
79
90
|
`rubocop-cask` is MIT licensed. [See the accompanying file](MIT-LICENSE.md) for
|
@@ -54,11 +54,11 @@ module RuboCop
|
|
54
54
|
alias eql? ==
|
55
55
|
|
56
56
|
Constants::STANZA_ORDER.each do |stanza_name|
|
57
|
-
class_eval <<-
|
57
|
+
class_eval <<-RUBY, __FILE__, __LINE__
|
58
58
|
def #{stanza_name}?
|
59
59
|
stanza_name == :#{stanza_name}
|
60
60
|
end
|
61
|
-
|
61
|
+
RUBY
|
62
62
|
end
|
63
63
|
end
|
64
64
|
end
|
@@ -4,12 +4,12 @@ module RuboCop
|
|
4
4
|
class Node
|
5
5
|
include RuboCop::Cask::Constants
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
def_node_matcher :method_node, '{$(send ...) (block $(send ...) ...)}'
|
8
|
+
def_node_matcher :block_args, '(block _ $_ _)'
|
9
|
+
def_node_matcher :block_body, '(block _ _ $_)'
|
10
10
|
|
11
|
-
|
12
|
-
|
11
|
+
def_node_matcher :key_node, '{(pair $_ _) (hash (pair $_ _) ...)}'
|
12
|
+
def_node_matcher :val_node, '{(pair _ $_) (hash (pair _ $_) ...)}'
|
13
13
|
|
14
14
|
def cask_block?
|
15
15
|
block_type? && method_node.cask_header?
|
data/lib/rubocop/cask/version.rb
CHANGED
@@ -12,7 +12,7 @@ module RuboCop
|
|
12
12
|
MSG_NO_SLASH = "'%s' must have a slash after the domain.".freeze
|
13
13
|
|
14
14
|
def on_homepage_stanza(stanza)
|
15
|
-
url_node = stanza.stanza_node.
|
15
|
+
url_node = stanza.stanza_node.first_argument
|
16
16
|
url = url_node.str_content
|
17
17
|
|
18
18
|
return if url !~ %r{^.+://[^/]+$}
|
@@ -1,29 +1,29 @@
|
|
1
1
|
module CopSharedExamples
|
2
2
|
shared_examples 'does not report any offenses' do
|
3
3
|
it 'does not report any offenses' do
|
4
|
-
expect_no_offenses(
|
4
|
+
expect_no_offenses(source)
|
5
5
|
end
|
6
6
|
end
|
7
7
|
|
8
8
|
shared_examples 'reports offenses' do
|
9
9
|
it 'reports offenses' do
|
10
|
-
expect_reported_offenses(
|
10
|
+
expect_reported_offenses(source, expected_offenses)
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
14
|
shared_examples 'autocorrects source' do
|
15
15
|
it 'autocorrects source' do
|
16
|
-
expect_autocorrected_source(
|
16
|
+
expect_autocorrected_source(source, correct_source)
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
-
def expect_no_offenses(
|
21
|
-
inspect_source(
|
20
|
+
def expect_no_offenses(source)
|
21
|
+
inspect_source(source)
|
22
22
|
expect(cop.offenses).to be_empty
|
23
23
|
end
|
24
24
|
|
25
|
-
def expect_reported_offenses(
|
26
|
-
inspect_source(
|
25
|
+
def expect_reported_offenses(source, expected_offenses)
|
26
|
+
inspect_source(source)
|
27
27
|
expect(cop.offenses.size).to eq(expected_offenses.size)
|
28
28
|
expected_offenses.zip(cop.offenses).each do |expected, actual|
|
29
29
|
expect_offense(expected, actual)
|
@@ -38,8 +38,8 @@ module CopSharedExamples
|
|
38
38
|
expect(actual.location.source).to eq(expected[:source])
|
39
39
|
end
|
40
40
|
|
41
|
-
def expect_autocorrected_source(
|
42
|
-
new_source = autocorrect_source(
|
41
|
+
def expect_autocorrected_source(source, correct_source)
|
42
|
+
new_source = autocorrect_source(source)
|
43
43
|
expect(new_source).to eq(Array(correct_source).join("\n"))
|
44
44
|
end
|
45
45
|
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.13.
|
4
|
+
version: 0.13.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Hagins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: public_suffix
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.50.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.50.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|