pronto-fasterer 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pronto/fasterer/version.rb +1 -1
- data/lib/pronto/fasterer.rb +4 -30
- data/pronto-fasterer.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d38f688e76e0184f193b88afa35ff1927f25e6cc
|
4
|
+
data.tar.gz: 522cd7370dec52c9cb474e97c508042a25c2f3d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 972010c07b11854743da0110d83090c7197cf729adffb3e69b4276db00cc4f80cc87912758a2cad20ec7d0efce5564c9b44c0feaf856c83682c93aef2a8583c4
|
7
|
+
data.tar.gz: f15d19e9e64c35fa3f204821a5e3835a64864ff0ce29e375bf1b7ba0093ce5f31b7ffc3a37cdee6443b2aedfaa9e8bbda6dff3378eeba0b0d5e1b5f9b923dd49
|
data/lib/pronto/fasterer.rb
CHANGED
@@ -1,14 +1,11 @@
|
|
1
1
|
require 'pronto'
|
2
2
|
require 'fasterer'
|
3
|
-
require '
|
3
|
+
require 'fasterer/config'
|
4
4
|
|
5
5
|
module Pronto
|
6
6
|
class Fasterer < Runner
|
7
|
-
CONFIG_FILE_NAME = '.fasterer.yml'
|
8
|
-
SPEEDUPS_KEY = 'speedups'
|
9
|
-
EXCLUDE_PATHS_KEY = 'exclude_paths'
|
10
|
-
|
11
7
|
def initialize
|
8
|
+
@config = ::Fasterer::Config.new
|
12
9
|
end
|
13
10
|
|
14
11
|
def run(patches, _)
|
@@ -17,7 +14,7 @@ module Pronto
|
|
17
14
|
valid_patches = patches.select do |patch|
|
18
15
|
patch.additions > 0 &&
|
19
16
|
ruby_file?(patch.new_file_full_path) &&
|
20
|
-
|
17
|
+
!@config.ignored_files.include?(patch.delta.new_file[:path])
|
21
18
|
end
|
22
19
|
|
23
20
|
valid_patches.map { |patch| inspect(patch) }.flatten.compact
|
@@ -31,7 +28,7 @@ module Pronto
|
|
31
28
|
analyzer.errors.each { |error| errors << error }
|
32
29
|
|
33
30
|
errors
|
34
|
-
.select { |error|
|
31
|
+
.select { |error| !@config.ignored_speedups.include?(error.name) }
|
35
32
|
.flat_map do |error|
|
36
33
|
patch.added_lines
|
37
34
|
.select { |line| line.new_lineno == error.line }
|
@@ -43,28 +40,5 @@ module Pronto
|
|
43
40
|
path = line.patch.delta.new_file[:path]
|
44
41
|
Message.new(path, line, :warning, error.explanation)
|
45
42
|
end
|
46
|
-
|
47
|
-
def ignored_speedups
|
48
|
-
@ignored_speedups ||= config[SPEEDUPS_KEY].select do |_, value|
|
49
|
-
value == false
|
50
|
-
end.keys.map(&:to_sym)
|
51
|
-
end
|
52
|
-
|
53
|
-
def ignored_files
|
54
|
-
@ignored_files ||= config[EXCLUDE_PATHS_KEY].flat_map { |path| Dir[path] }
|
55
|
-
end
|
56
|
-
|
57
|
-
def config
|
58
|
-
@config ||=
|
59
|
-
if File.exist?(CONFIG_FILE_NAME)
|
60
|
-
nil_config_file.merge(YAML.load_file(CONFIG_FILE_NAME))
|
61
|
-
else
|
62
|
-
nil_config_file
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
def nil_config_file
|
67
|
-
{ SPEEDUPS_KEY => {}, EXCLUDE_PATHS_KEY => [] }
|
68
|
-
end
|
69
43
|
end
|
70
44
|
end
|
data/pronto-fasterer.gemspec
CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
|
|
32
32
|
s.extra_rdoc_files = ['LICENSE', 'README.md']
|
33
33
|
s.require_paths = ['lib']
|
34
34
|
|
35
|
-
s.add_runtime_dependency('fasterer', '~> 0.1.
|
35
|
+
s.add_runtime_dependency('fasterer', '~> 0.1.12')
|
36
36
|
s.add_runtime_dependency('pronto', '~> 0.5.0')
|
37
37
|
s.add_development_dependency('rake', '~> 10.4')
|
38
38
|
s.add_development_dependency('rspec', '~> 3.3')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pronto-fasterer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.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-12-
|
11
|
+
date: 2015-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fasterer
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.1.
|
19
|
+
version: 0.1.12
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.1.
|
26
|
+
version: 0.1.12
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: pronto
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|