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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 620db5bb9d732b1a9eec638ebce4a73f017669f6
4
- data.tar.gz: 9313e119b655d1dbc74af7b4034c46d92869154a
3
+ metadata.gz: d38f688e76e0184f193b88afa35ff1927f25e6cc
4
+ data.tar.gz: 522cd7370dec52c9cb474e97c508042a25c2f3d8
5
5
  SHA512:
6
- metadata.gz: 59baeb7f5713ba0db9615070929dd8541136a711ce277b9e9401eeb1bd5113474dd24909ca6c394796c14bdb8346e563488b697ee8c168dcfde48a4d55638453
7
- data.tar.gz: 5b9525bcab3cd83d9280656b38b3246a69642479607b53ba6c2476166d5772b3c9b51e5de58b0f99660848d7ae333208dbf895b940faad895396f13a1d25f96c
6
+ metadata.gz: 972010c07b11854743da0110d83090c7197cf729adffb3e69b4276db00cc4f80cc87912758a2cad20ec7d0efce5564c9b44c0feaf856c83682c93aef2a8583c4
7
+ data.tar.gz: f15d19e9e64c35fa3f204821a5e3835a64864ff0ce29e375bf1b7ba0093ce5f31b7ffc3a37cdee6443b2aedfaa9e8bbda6dff3378eeba0b0d5e1b5f9b923dd49
@@ -1,5 +1,5 @@
1
1
  module Pronto
2
2
  module FastererVersion
3
- VERSION = '0.5.0'
3
+ VERSION = '0.5.1'
4
4
  end
5
5
  end
@@ -1,14 +1,11 @@
1
1
  require 'pronto'
2
2
  require 'fasterer'
3
- require 'yaml'
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
- !ignored_files.include?(patch.delta.new_file[:path])
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| !ignored_speedups.include?(error.name) }
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
@@ -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.11')
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.0
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-02 00:00:00.000000000 Z
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.11
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.11
26
+ version: 0.1.12
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: pronto
29
29
  requirement: !ruby/object:Gem::Requirement