pronto-scss 0.4.5 → 0.4.6

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: 519ba862568be95cc76cb7122cd7ce315c63ddc3
4
- data.tar.gz: 7ab89268f3f435af6b9455ca2c9f49e44aa3d839
3
+ metadata.gz: 9190bdcc337cfb257f4e1381d138e785b7f3b337
4
+ data.tar.gz: 5bfc485a6ab31cab101a5269a725fb6a1392241f
5
5
  SHA512:
6
- metadata.gz: 290b0965972321ff04fd0c14c0327bdc5e7a80dbdc365c2aa683ededeaaee23d074892e55ee0a79e55fa7ecca1ae4b08e6f742431f69c11a1f26ac7b89decf52
7
- data.tar.gz: 51fe744a35d08c7bd11338bcd68872fd660024f8197cc7dd605687ee4af20938f3633e0b562cd6c54ebc0cf632105d1c4d024fd1e297d3094345fa438e5a501b
6
+ metadata.gz: 015dc8b574b65e11cefafc47b49d535053b2752aebdf07acf3a9999abefb764fa574be2b2ee82b9329758a3483abdb9322b0cde377b25b3c8863960af92b7e2f
7
+ data.tar.gz: 0784f75f22435dafe8887805459995fb94288e939db2f85d704c0020381caac8fff46fa02b0e66cd971f3c98f3ea4850db6fb9db99d9b9154bb884ea85fb2a2f
data/lib/pronto/scss.rb CHANGED
@@ -3,16 +3,6 @@ require 'scss_lint'
3
3
 
4
4
  module Pronto
5
5
  class Scss < Runner
6
- def initialize
7
- file_name = SCSSLint::Config::FILE_NAME
8
- config = if File.exist?(file_name)
9
- SCSSLint::Config.load(file_name)
10
- else
11
- SCSSLint::Config.default
12
- end
13
- @runner = SCSSLint::Runner.new(config)
14
- end
15
-
16
6
  def run(patches, _)
17
7
  return [] unless patches
18
8
 
@@ -22,15 +12,30 @@ module Pronto
22
12
  files = scss_patches.map(&:new_file_full_path)
23
13
 
24
14
  if files.any?
25
- @runner.run(files)
15
+ runner.run(SCSSLint::FileFinder.new(config).find(files))
26
16
  messages_for(scss_patches)
27
17
  else
28
18
  []
29
19
  end
30
20
  end
31
21
 
22
+ def runner
23
+ @runner ||= SCSSLint::Runner.new(config)
24
+ end
25
+
26
+ def config
27
+ @config ||= begin
28
+ file_name = SCSSLint::Config::FILE_NAME
29
+ if File.exist?(file_name)
30
+ SCSSLint::Config.load(file_name)
31
+ else
32
+ SCSSLint::Config.default
33
+ end
34
+ end
35
+ end
36
+
32
37
  def messages_for(scss_patches)
33
- @runner.lints.map do |lint|
38
+ runner.lints.map do |lint|
34
39
  patch = patch_for_lint(scss_patches, lint)
35
40
 
36
41
  line = patch.added_lines.find do |added_line|
@@ -1,5 +1,5 @@
1
1
  module Pronto
2
2
  module ScssVersion
3
- VERSION = '0.4.5'
3
+ VERSION = '0.4.6'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pronto-scss
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.6
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-05-30 00:00:00.000000000 Z
11
+ date: 2015-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: scss_lint