guard-haml_lint 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 +4 -4
- data/guard-haml_lint.gemspec +1 -1
- data/lib/guard/haml_lint.rb +12 -1
- data/lib/guard/hamllint/version.rb +1 -1
- data/spec/guard/haml_lint_spec.rb +17 -1
- 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: e0aca0f2bef11e3af10fdb9224f9141b8c4b0db6
|
4
|
+
data.tar.gz: b934c4aff61f332bc1066f10a15e6cade268738e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2450edc23cf90442c85a79bfc6d500f35390e83b43324f17ec49300413517ceedcf1047e3f8a8182e58231133876fdf8cba54388681b443614c23c4df2eba995
|
7
|
+
data.tar.gz: fbc8ca42ea7b36b72f406478360e1f740935af87341d1457b13df62c9bec9609b895e44ceac007f3239c289f630235d364c69d98adccc37ddd2b83f665a8263e
|
data/guard-haml_lint.gemspec
CHANGED
@@ -28,5 +28,5 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_development_dependency 'bundler', '>= 1.0.0'
|
29
29
|
spec.add_development_dependency 'rake', '~> 10.0'
|
30
30
|
spec.add_development_dependency 'rspec', '~> 3.6.0'
|
31
|
-
spec.add_development_dependency 'guard-rubocop', '~> 1.
|
31
|
+
spec.add_development_dependency 'guard-rubocop', '~> 1.3.0'
|
32
32
|
end
|
data/lib/guard/haml_lint.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'guard/compat/plugin'
|
2
|
+
require 'shellwords'
|
2
3
|
|
3
4
|
module Guard
|
4
5
|
# This class is Guard plugin
|
@@ -86,7 +87,7 @@ module Guard
|
|
86
87
|
#
|
87
88
|
def run(paths = [])
|
88
89
|
command = ['haml-lint']
|
89
|
-
command
|
90
|
+
command.concat build_cli_command(@options[:cli])
|
90
91
|
|
91
92
|
if paths.empty?
|
92
93
|
Guard::Compat::UI.info 'Running HAML-Lint for all haml files'
|
@@ -99,6 +100,16 @@ module Guard
|
|
99
100
|
throw :task_has_failed unless system(*command)
|
100
101
|
end
|
101
102
|
|
103
|
+
# @param [String] commands
|
104
|
+
#
|
105
|
+
def build_cli_command(commands)
|
106
|
+
case commands
|
107
|
+
when String then commands.shellsplit
|
108
|
+
when NilClass then []
|
109
|
+
else raise ArgumentError, 'Please specify only String for :cli option'
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
102
113
|
# @return [Array<String>] haml directory paths
|
103
114
|
#
|
104
115
|
def default_haml_dirs
|
@@ -46,6 +46,14 @@ describe Guard::HamlLint do
|
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
|
+
context 'when more than one :cli option is specified' do
|
50
|
+
let(:options) { { cli: '--fail-level error --fail-fast' } }
|
51
|
+
|
52
|
+
it 'not raise error' do
|
53
|
+
expect { subject.start }.to_not raise_error
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
49
57
|
context 'when correct value is specified for the :cli option' do
|
50
58
|
let(:options) { { cli: '--fail-fast' } }
|
51
59
|
|
@@ -58,7 +66,15 @@ describe Guard::HamlLint do
|
|
58
66
|
let(:options) { { cli: '--error-option' } }
|
59
67
|
|
60
68
|
it 'raise UncaughtThrowError' do
|
61
|
-
expect { subject.start }.to raise_error(UncaughtThrowError)
|
69
|
+
expect { subject.start }.to raise_error(UncaughtThrowError, /task_has_failed/)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
context 'when abnormal value is specified for the :cli option' do
|
74
|
+
let(:options) { { cli: ['--fail-fast'] } }
|
75
|
+
|
76
|
+
it 'raise Guard::HamlLint::ArgumentError' do
|
77
|
+
expect { subject.start }.to raise_error(Guard::HamlLint::ArgumentError, 'Please specify only String for :cli option')
|
62
78
|
end
|
63
79
|
end
|
64
80
|
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: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yasuhiko Katoh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-12-
|
11
|
+
date: 2017-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 1.
|
103
|
+
version: 1.3.0
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 1.
|
110
|
+
version: 1.3.0
|
111
111
|
description: Guard::HamlLint automatically runs Haml Lint tools.
|
112
112
|
email:
|
113
113
|
- toyasyu@gmail.com
|