haml_lint 0.54.0 → 0.55.0
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/haml_lint/runner.rb +2 -2
- data/lib/haml_lint/source.rb +7 -7
- data/lib/haml_lint/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54085c44173d09dee5402e01e6d0d6daedd8cafcf9bd680c9ff0dd58a56648ad
|
4
|
+
data.tar.gz: '09cca038ff259c096d34398dc23f07d1c2a89af596eeb72389dc5e14d2aeb0af'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15dfc1078747b42d5bba6af59adcf98803f05bfbc228e30322420e9c4876ba47c202a6d89412e1e30de72cfba5bc2cf1b9ffebe105717e76ee167df4540de591
|
7
|
+
data.tar.gz: 0f5d12c1c4336536d3574b5d40ebb8cad94af8124def6b5273148c984271dd7e4e10c8abea51bb69d4d3ee2208fccc5a76d94060d9c6db811c19b8621fbde501
|
data/lib/haml_lint/runner.rb
CHANGED
@@ -137,14 +137,14 @@ module HamlLint
|
|
137
137
|
# @return [Array<HamlLint::Source>]
|
138
138
|
def extract_applicable_sources(config, options)
|
139
139
|
if options[:stdin]
|
140
|
-
[HamlLint::Source.new($stdin, options[:stdin])]
|
140
|
+
[HamlLint::Source.new(io: $stdin, path: options[:stdin])]
|
141
141
|
else
|
142
142
|
included_patterns = options[:files]
|
143
143
|
excluded_patterns = config['exclude']
|
144
144
|
excluded_patterns += options.fetch(:excluded_files, [])
|
145
145
|
|
146
146
|
HamlLint::FileFinder.new(config).find(included_patterns, excluded_patterns).map do |file_path|
|
147
|
-
HamlLint::Source.new
|
147
|
+
HamlLint::Source.new path: file_path
|
148
148
|
end
|
149
149
|
end
|
150
150
|
end
|
data/lib/haml_lint/source.rb
CHANGED
@@ -1,24 +1,24 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module HamlLint
|
4
|
-
# Wrapper class representing a single target for HamlLint::Runner to run against, comprised of
|
5
|
-
#
|
4
|
+
# Wrapper class representing a single target for HamlLint::Runner to run against, comprised of a file path to
|
5
|
+
# eventually read from, and an optional IO argument to override with.
|
6
6
|
class Source
|
7
7
|
# @return [String] File path associated with the given IO object.
|
8
8
|
attr_reader :path
|
9
9
|
|
10
|
-
# Wraps an IO object and file path to a source object.
|
10
|
+
# Wraps an optional IO object and file path to a source object.
|
11
11
|
#
|
12
|
-
# @param [IO] io
|
13
12
|
# @param [String] path
|
14
|
-
|
15
|
-
|
13
|
+
# @param [IO] io
|
14
|
+
def initialize(path: nil, io: nil)
|
16
15
|
@path = path
|
16
|
+
@io = io
|
17
17
|
end
|
18
18
|
|
19
19
|
# @return [String] Contents of the given IO object.
|
20
20
|
def contents
|
21
|
-
@contents ||= @io.read
|
21
|
+
@contents ||= @io&.read || File.read(path)
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
data/lib/haml_lint/version.rb
CHANGED
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: haml_lint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.55.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shane da Silva
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2024-01-23 00:00:00.000000000 Z
|
@@ -200,7 +200,7 @@ homepage: https://github.com/sds/haml-lint
|
|
200
200
|
licenses:
|
201
201
|
- MIT
|
202
202
|
metadata: {}
|
203
|
-
post_install_message:
|
203
|
+
post_install_message:
|
204
204
|
rdoc_options: []
|
205
205
|
require_paths:
|
206
206
|
- lib
|
@@ -215,8 +215,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
215
215
|
- !ruby/object:Gem::Version
|
216
216
|
version: '0'
|
217
217
|
requirements: []
|
218
|
-
rubygems_version: 3.
|
219
|
-
signing_key:
|
218
|
+
rubygems_version: 3.0.3.1
|
219
|
+
signing_key:
|
220
220
|
specification_version: 4
|
221
221
|
summary: HAML lint tool
|
222
222
|
test_files: []
|