guard-haml_lint 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +5 -0
- data/MIT-LICENSE +1 -1
- data/README.md +4 -0
- data/guard-haml_lint.gemspec +3 -1
- data/lib/guard/haml_lint.rb +9 -9
- data/lib/guard/hamllint/templates/Guardfile +3 -0
- data/lib/guard/hamllint/version.rb +1 -1
- data/spec/guard/haml_lint_spec.rb +21 -18
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d4f0e16c0c697387cdf311fb01538c8e11f323d
|
4
|
+
data.tar.gz: 1bd8da34a9e8353a888181679ca2d02de985584e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dec8daf1b3096d9dc24677453623940ab03be5d742f8d5ff11b78078ceb05dc686a65afc409e94d25bb0ff21e9ca82c956a85bebace9f67c5aedefd805ccef29
|
7
|
+
data.tar.gz: 39224d3cfaf3e1966485fcd02f56be9a845234b15a0d693e2f8e19d3680eb56f0dad5ac33609e0dba7669948ac724233b473b885ed18ef35119a6afa323b473d
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -45,3 +45,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
45
45
|
## Contributing
|
46
46
|
|
47
47
|
Bug reports and pull requests are welcome on GitHub at https://github.com/yatmsu/guard-haml_lint.
|
48
|
+
|
49
|
+
## License
|
50
|
+
|
51
|
+
Ruby on Rails is released under the [MIT License](https://opensource.org/licenses/MIT).
|
data/guard-haml_lint.gemspec
CHANGED
@@ -19,12 +19,14 @@ Gem::Specification.new do |spec|
|
|
19
19
|
|
20
20
|
spec.required_ruby_version = '>= 2.2.6'
|
21
21
|
|
22
|
+
spec.license = 'MIT'
|
23
|
+
|
22
24
|
spec.add_dependency 'guard', '~> 2.2'
|
23
25
|
spec.add_dependency 'guard-compat', '~> 1.2'
|
24
26
|
spec.add_runtime_dependency 'haml_lint', '>= 0.15.2'
|
25
27
|
|
26
28
|
spec.add_development_dependency 'bundler', '>= 1.0.0'
|
27
29
|
spec.add_development_dependency 'rake', '~> 10.0'
|
28
|
-
spec.add_development_dependency 'rspec'
|
30
|
+
spec.add_development_dependency 'rspec', '~> 3.6.0'
|
29
31
|
spec.add_development_dependency 'guard-rubocop', '~> 1.2.0'
|
30
32
|
end
|
data/lib/guard/haml_lint.rb
CHANGED
@@ -20,7 +20,8 @@ module Guard
|
|
20
20
|
#
|
21
21
|
def initialize(options = {})
|
22
22
|
super
|
23
|
-
|
23
|
+
default_options = DEFAULT_OPTIONS.dup
|
24
|
+
@options = default_options.merge!(haml_dires: default_haml_dirs).merge!(options)
|
24
25
|
end
|
25
26
|
|
26
27
|
# Called once when Guard starts. Please override initialize method to init stuff.
|
@@ -38,8 +39,7 @@ module Guard
|
|
38
39
|
#
|
39
40
|
# @return [nil]
|
40
41
|
#
|
41
|
-
def reload
|
42
|
-
end
|
42
|
+
def reload; end
|
43
43
|
|
44
44
|
# Called when just `enter` is pressed
|
45
45
|
# This method should be principally used for long action like running all specs/tests/...
|
@@ -73,16 +73,16 @@ module Guard
|
|
73
73
|
|
74
74
|
# Called on file(s) removals that the Guard plugin watches.
|
75
75
|
#
|
76
|
-
# @
|
77
|
-
# @raise [:task_has_failed] when run_on_removals has failed
|
78
|
-
# @return [Object] the task result
|
76
|
+
# @return [nil]
|
79
77
|
#
|
80
|
-
def run_on_removals(paths)
|
81
|
-
run(paths)
|
82
|
-
end
|
78
|
+
def run_on_removals(paths); end
|
83
79
|
|
84
80
|
private
|
85
81
|
|
82
|
+
# @param [Array<String>] paths the changes files or paths
|
83
|
+
# @raise [:task_has_failed] when run_on_additions has failed
|
84
|
+
# @return [Object] the task result
|
85
|
+
#
|
86
86
|
def run(paths = [])
|
87
87
|
command = ['haml-lint']
|
88
88
|
if paths.empty?
|
@@ -1,3 +1,6 @@
|
|
1
|
+
# Guard-HamlLint supports a lot options with default values:
|
2
|
+
# all_on_start: true # Check all files at Guard startup. default: true
|
3
|
+
# haml_dires: ['app/views'] # Check Directories. default: 'app/views' or '.'
|
1
4
|
guard :haml_lint do
|
2
5
|
watch(%r{.+\.html.*\.haml$})
|
3
6
|
watch(%r{(?:.+/)?\.haml-lint\.yml$}) { |m| File.dirname(m[0]) }
|
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Guard::HamlLint do
|
4
|
-
subject {
|
5
|
-
let(:options) { {} }
|
4
|
+
subject { described_class.new(options) }
|
5
|
+
let(:options) { { all_on_start: true } }
|
6
6
|
|
7
7
|
describe '#initialize' do
|
8
8
|
context 'when default initialized' do
|
@@ -28,12 +28,7 @@ describe Guard::HamlLint do
|
|
28
28
|
|
29
29
|
describe '#start' do
|
30
30
|
context 'when :all_on_start option is enabled' do
|
31
|
-
let(:options)
|
32
|
-
{
|
33
|
-
all_on_start: true,
|
34
|
-
haml_dires: ['spec/views']
|
35
|
-
}
|
36
|
-
end
|
31
|
+
let(:options) { { all_on_start: true } }
|
37
32
|
|
38
33
|
it 'call #run' do
|
39
34
|
expect(subject).to receive(:run)
|
@@ -42,12 +37,7 @@ describe Guard::HamlLint do
|
|
42
37
|
end
|
43
38
|
|
44
39
|
context 'when :all_on_start option is disabled' do
|
45
|
-
let(:options)
|
46
|
-
{
|
47
|
-
all_on_start: false,
|
48
|
-
haml_dires: ['spec/views']
|
49
|
-
}
|
50
|
-
end
|
40
|
+
let(:options) { { all_on_start: false } }
|
51
41
|
|
52
42
|
it 'does nothing' do
|
53
43
|
expect(subject).not_to receive(:run)
|
@@ -60,15 +50,28 @@ describe Guard::HamlLint do
|
|
60
50
|
it { expect(subject.reload).to eq nil }
|
61
51
|
end
|
62
52
|
|
63
|
-
|
53
|
+
describe '#run_all' do
|
54
|
+
it 'call #run' do
|
55
|
+
expect(subject).to receive(:run)
|
56
|
+
subject.run_all
|
57
|
+
end
|
64
58
|
end
|
65
59
|
|
66
|
-
|
60
|
+
describe '#run_on_additions' do
|
61
|
+
it 'call #run' do
|
62
|
+
expect(subject).to receive(:run).with(['spec/views/sample.html.haml'])
|
63
|
+
subject.run_on_additions(['spec/views/sample.html.haml'])
|
64
|
+
end
|
67
65
|
end
|
68
66
|
|
69
|
-
|
67
|
+
describe '#run_on_modifications' do
|
68
|
+
it 'call #run' do
|
69
|
+
expect(subject).to receive(:run).with(['spec/views/sample.html.haml'])
|
70
|
+
subject.run_on_modifications(['spec/views/sample.html.haml'])
|
71
|
+
end
|
70
72
|
end
|
71
73
|
|
72
|
-
|
74
|
+
describe '#run_on_removals' do
|
75
|
+
it { expect(subject.reload).to eq nil }
|
73
76
|
end
|
74
77
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-haml_lint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- y@su
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|
@@ -84,16 +84,16 @@ dependencies:
|
|
84
84
|
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 3.6.0
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 3.6.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: guard-rubocop
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -134,7 +134,8 @@ files:
|
|
134
134
|
- spec/guard/haml_lint_spec.rb
|
135
135
|
- spec/spec_helper.rb
|
136
136
|
homepage: https://github.com/yatmsu/guard-haml-lint
|
137
|
-
licenses:
|
137
|
+
licenses:
|
138
|
+
- MIT
|
138
139
|
metadata: {}
|
139
140
|
post_install_message:
|
140
141
|
rdoc_options: []
|