pronto-haml 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/pronto/haml.rb +11 -3
- data/lib/pronto/haml/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bae8f6460dbd4edf786ecbf520db45bf20745ff
|
4
|
+
data.tar.gz: 5f30adeb9f6839ced1d96b1d5e8bcd80f54f9fa5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2a0552408dc1148813f0c961a3cc47683af85670d5caa17281c090220d93b91bf3610b72c421273bc32dd32db0b276856e322a26dea4cb09b137584e07b1479
|
7
|
+
data.tar.gz: 800c9fed4082e7262175244659277c30a69c5a32c4e1dabe191d3d5236f327c95c27919238cda5d678897619f54728c64896b53c046b67a7cf8870d2e95601bc
|
data/lib/pronto/haml.rb
CHANGED
@@ -10,15 +10,17 @@ module Pronto
|
|
10
10
|
def run(patches, _)
|
11
11
|
return [] unless patches
|
12
12
|
|
13
|
-
|
14
|
-
|
13
|
+
patches.select { |patch| patch.additions > 0 }
|
14
|
+
.select { |patch| haml_file?(patch.new_file_full_path) }
|
15
|
+
.map { |patch| inspect(patch) }
|
16
|
+
.flatten.compact
|
15
17
|
end
|
16
18
|
|
17
19
|
def inspect(patch)
|
18
20
|
lints = @runner.run(files: [patch.new_file_full_path.to_s]).lints
|
19
21
|
lints.map do |lint|
|
20
22
|
patch.added_lines.select { |line| line.new_lineno == lint.line }
|
21
|
-
|
23
|
+
.map { |line| new_message(lint, line) }
|
22
24
|
end
|
23
25
|
end
|
24
26
|
|
@@ -26,5 +28,11 @@ module Pronto
|
|
26
28
|
path = line.patch.delta.new_file[:path]
|
27
29
|
Message.new(path, line, lint.severity, lint.message)
|
28
30
|
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def haml_file?(path)
|
35
|
+
File.extname(path) == '.haml'
|
36
|
+
end
|
29
37
|
end
|
30
38
|
end
|
data/lib/pronto/haml/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pronto-haml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mindaugas Mozūras
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: haml-lint
|
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
116
|
version: 1.3.6
|
117
117
|
requirements: []
|
118
118
|
rubyforge_project:
|
119
|
-
rubygems_version: 2.
|
119
|
+
rubygems_version: 2.4.2
|
120
120
|
signing_key:
|
121
121
|
specification_version: 4
|
122
122
|
summary: Pronto runner for HAML-Lint, tool for writing clean and consistent HAML
|