fasterer 0.5.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +4 -0
- data/README.md +2 -1
- data/lib/fasterer/config.rb +11 -2
- data/lib/fasterer/version.rb +1 -1
- data/spec/lib/fasterer/config_spec.rb +25 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f8497be57df6a101c8259f8909a2977b68727e0595de1c2b09bec0492b80d806
|
4
|
+
data.tar.gz: 7364812466aa12114dbada36fc6cb3865e4497478d60d8df0a4c4aad58f50d5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8d177745b079e9b2608a698757165b595c0b9d25b4af28387194d8ecd308014487e19f228358fdcfdedfcfa3638846f23606b7b60c2bd9071a7f9a9b4946a50
|
7
|
+
data.tar.gz: a51a0dcc58688bb1bb2673543f9b2961381d9345e19f6e3c3fc0691eeea2c199792afeb6157303a45140962b4a9f034fd095c9bfc5fcd823725ba3611c1a7e80
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -44,7 +44,8 @@ spec/cache/mem_cache_store_spec.rb:161 Use tr instead of gsub when grepping plai
|
|
44
44
|
```
|
45
45
|
## Configuration
|
46
46
|
|
47
|
-
Configuration is done through the **.fasterer.yml** file placed in the root of your
|
47
|
+
Configuration is done through the **.fasterer.yml** file. This can placed in the root of your
|
48
|
+
project, or any ancestor folder.
|
48
49
|
|
49
50
|
Options:
|
50
51
|
|
data/lib/fasterer/config.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'yaml'
|
2
|
+
require 'pathname'
|
2
3
|
|
3
4
|
module Fasterer
|
4
5
|
class Config
|
@@ -18,14 +19,22 @@ module Fasterer
|
|
18
19
|
|
19
20
|
def file
|
20
21
|
@file ||= begin
|
21
|
-
return nil_file
|
22
|
+
return nil_file if file_location.nil?
|
22
23
|
# Yaml.load_file returns false if the content is blank
|
23
|
-
loaded = YAML.load_file(
|
24
|
+
loaded = YAML.load_file(file_location) || nil_file
|
24
25
|
# if the loaded file misses any of the two keys.
|
25
26
|
loaded.merge!(nil_file) { |_k, v1, v2| v1 || v2 }
|
26
27
|
end
|
27
28
|
end
|
28
29
|
|
30
|
+
def file_location
|
31
|
+
@file_location ||=
|
32
|
+
Pathname(Dir.pwd)
|
33
|
+
.enum_for(:ascend)
|
34
|
+
.map { |dir| File.join(dir.to_s, FILE_NAME) }
|
35
|
+
.find { |f| File.exist?(f) }
|
36
|
+
end
|
37
|
+
|
29
38
|
def nil_file
|
30
39
|
{ SPEEDUPS_KEY => {}, EXCLUDE_PATHS_KEY => [] }
|
31
40
|
end
|
data/lib/fasterer/version.rb
CHANGED
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'pathname'
|
3
|
+
|
4
|
+
describe Fasterer::Config do
|
5
|
+
let(:root) { Pathname.new("#{File.dirname(__FILE__)}/../../..").cleanpath }
|
6
|
+
let(:expected_location) { "#{root}/.fasterer.yml" }
|
7
|
+
|
8
|
+
describe '#file_location' do
|
9
|
+
it 'returns a file that is in the current dir (eg the project root)' do
|
10
|
+
expect(described_class.new.file_location).to eq(expected_location)
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'returns a file in an ancestor dir' do
|
14
|
+
Dir.chdir("#{root}/spec/lib") do
|
15
|
+
expect(described_class.new.file_location).to eq(expected_location)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'returns nil when there is no ancestor file' do
|
20
|
+
Dir.tmpdir do
|
21
|
+
expect(described_class.new.file_location).to be nil
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fasterer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Damir Svrtan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -168,6 +168,7 @@ files:
|
|
168
168
|
- spec/lib/fasterer/analyzer/98_misc_spec.rb
|
169
169
|
- spec/lib/fasterer/analyzer/99_exceptional_files_spec.rb
|
170
170
|
- spec/lib/fasterer/cli_spec.rb
|
171
|
+
- spec/lib/fasterer/config_spec.rb
|
171
172
|
- spec/lib/fasterer/file_traverser_spec.rb
|
172
173
|
- spec/lib/fasterer/method_call_spec.rb
|
173
174
|
- spec/lib/fasterer/method_definition_spec.rb
|
@@ -246,8 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
246
247
|
- !ruby/object:Gem::Version
|
247
248
|
version: '0'
|
248
249
|
requirements: []
|
249
|
-
|
250
|
-
rubygems_version: 2.5.1
|
250
|
+
rubygems_version: 3.0.1
|
251
251
|
signing_key:
|
252
252
|
specification_version: 4
|
253
253
|
summary: Run Ruby more than fast. Fasterer
|
@@ -274,6 +274,7 @@ test_files:
|
|
274
274
|
- spec/lib/fasterer/analyzer/98_misc_spec.rb
|
275
275
|
- spec/lib/fasterer/analyzer/99_exceptional_files_spec.rb
|
276
276
|
- spec/lib/fasterer/cli_spec.rb
|
277
|
+
- spec/lib/fasterer/config_spec.rb
|
277
278
|
- spec/lib/fasterer/file_traverser_spec.rb
|
278
279
|
- spec/lib/fasterer/method_call_spec.rb
|
279
280
|
- spec/lib/fasterer/method_definition_spec.rb
|