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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 85d686d33847f62e5965960137c1e22cb0777d4a
4
- data.tar.gz: 9ee051406aa8f8090fe1d1c954c73e84c95e3bd9
3
+ metadata.gz: 5bae8f6460dbd4edf786ecbf520db45bf20745ff
4
+ data.tar.gz: 5f30adeb9f6839ced1d96b1d5e8bcd80f54f9fa5
5
5
  SHA512:
6
- metadata.gz: 0c5777a00b85a63bb2bfcc3e02c41039d65e5c237b17cc5515fbaf11b24cf33e56b6d7ee9ce3d28b98449920d5b907b17cc2afee305017dc126f9e925ce85864
7
- data.tar.gz: 0606588a954b8cc11ca46ebc8859727a2d81ab664fc69930e7a93b9134f3b36d3389cd42911571bd7480366878d3e67049b4852f4cb2bed760289f6d1db1ba6e
6
+ metadata.gz: f2a0552408dc1148813f0c961a3cc47683af85670d5caa17281c090220d93b91bf3610b72c421273bc32dd32db0b276856e322a26dea4cb09b137584e07b1479
7
+ data.tar.gz: 800c9fed4082e7262175244659277c30a69c5a32c4e1dabe191d3d5236f327c95c27919238cda5d678897619f54728c64896b53c046b67a7cf8870d2e95601bc
@@ -10,15 +10,17 @@ module Pronto
10
10
  def run(patches, _)
11
11
  return [] unless patches
12
12
 
13
- valid_patches = patches.select { |patch| patch.additions > 0 }
14
- valid_patches.map { |patch| inspect(patch) }.flatten.compact
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
- .map { |line| new_message(lint, line) }
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
@@ -1,5 +1,5 @@
1
1
  module Pronto
2
2
  module HamlLintVersion
3
- VERSION = '0.4.0'
3
+ VERSION = '0.4.1'
4
4
  end
5
5
  end
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.0
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-01-26 00:00:00.000000000 Z
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.2.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