haml_lint 0.54.0 → 0.55.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b017823b15563d033480ee99317c4d0c007624b10ad2ed3b53c254c5686289c8
4
- data.tar.gz: cf83ac415fb7749551466fcc0b23a5a2019bbecb99a67b2c54051a78523f1a33
3
+ metadata.gz: 54085c44173d09dee5402e01e6d0d6daedd8cafcf9bd680c9ff0dd58a56648ad
4
+ data.tar.gz: '09cca038ff259c096d34398dc23f07d1c2a89af596eeb72389dc5e14d2aeb0af'
5
5
  SHA512:
6
- metadata.gz: 17ea23cce399f12712d0f73560553b82068e2ac3be9124c590bbea78948a330811402c15fd2b5f8cbc0b5e8e044bc044e69df78f2e05462580665db814298595
7
- data.tar.gz: d619d3018e139b00ce539da9b9f7e1bfef644c71c8e102d146778c3c322770458a16feb89bb44a1a3699eadacc6038c7186407fc8361e6b354f0c4bdbb2dcd57
6
+ metadata.gz: 15dfc1078747b42d5bba6af59adcf98803f05bfbc228e30322420e9c4876ba47c202a6d89412e1e30de72cfba5bc2cf1b9ffebe105717e76ee167df4540de591
7
+ data.tar.gz: 0f5d12c1c4336536d3574b5d40ebb8cad94af8124def6b5273148c984271dd7e4e10c8abea51bb69d4d3ee2208fccc5a76d94060d9c6db811c19b8621fbde501
@@ -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 File.new(file_path), file_path
147
+ HamlLint::Source.new path: file_path
148
148
  end
149
149
  end
150
150
  end
@@ -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 an IO object
5
- # containing haml code, as well as a file path.
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
- def initialize(io, path)
15
- @io = io
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
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Defines the gem version.
4
4
  module HamlLint
5
- VERSION = '0.54.0'
5
+ VERSION = '0.55.0'
6
6
  end
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.54.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.4.10
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: []