pelusa 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Readme.md +20 -0
- data/lib/pelusa/configuration.rb +6 -1
- data/lib/pelusa/version.rb +1 -1
- data/test/pelusa/configuration_test.rb +7 -0
- metadata +4 -4
data/Readme.md
CHANGED
@@ -39,6 +39,26 @@ Or just run all the Ruby files (`**/*.rb`) without arguments:
|
|
39
39
|
|
40
40
|
pelusa
|
41
41
|
|
42
|
+
## Configuration
|
43
|
+
|
44
|
+
You can use per-project configurations as per which lints to use and their
|
45
|
+
configurations. Just put a `.pelusa.yml` file the root directory of your
|
46
|
+
project, like this:
|
47
|
+
|
48
|
+
sources: lib/**/*.rb
|
49
|
+
lints:
|
50
|
+
InstanceVariables:
|
51
|
+
limit: 5
|
52
|
+
LineRestriction:
|
53
|
+
limit: 80
|
54
|
+
exclude:
|
55
|
+
- SomeClass
|
56
|
+
Properties:
|
57
|
+
enabled: false
|
58
|
+
|
59
|
+
This allows you to disable lints, configure their variables, and exclude some
|
60
|
+
classes from being analyzed by certain lints.
|
61
|
+
|
42
62
|
## About the default set of Lints
|
43
63
|
|
44
64
|
This project was born as an inspiration from [one of our Monday
|
data/lib/pelusa/configuration.rb
CHANGED
@@ -46,7 +46,12 @@ module Pelusa
|
|
46
46
|
# Pelusa.configuration.sources # => lib/**/*.rb
|
47
47
|
#
|
48
48
|
def sources
|
49
|
-
|
49
|
+
default = "lib/**/*.rb"
|
50
|
+
if present?
|
51
|
+
@_configuration.fetch('sources') { default }
|
52
|
+
else
|
53
|
+
default
|
54
|
+
end
|
50
55
|
end
|
51
56
|
|
52
57
|
# Public: Returns an Array of enabled lints
|
data/lib/pelusa/version.rb
CHANGED
@@ -21,6 +21,13 @@ module Pelusa
|
|
21
21
|
it 'returns path to sources' do
|
22
22
|
configuration.sources.must_equal 'lib/**/*.rb'
|
23
23
|
end
|
24
|
+
|
25
|
+
describe 'by default' do
|
26
|
+
it 'returns lib/**/*.rb' do
|
27
|
+
empty_configuration = Pelusa::Configuration.new("unexistent_yml")
|
28
|
+
empty_configuration.sources.must_equal 'lib/**/*.rb'
|
29
|
+
end
|
30
|
+
end
|
24
31
|
end
|
25
32
|
|
26
33
|
describe '#enabled_lints' do
|
metadata
CHANGED
@@ -2,24 +2,24 @@
|
|
2
2
|
name: pelusa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Josep M. Bach
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-03-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
version_requirements: &
|
15
|
+
version_requirements: &6620 !ruby/object:Gem::Requirement
|
16
16
|
none: false
|
17
17
|
requirements:
|
18
18
|
- - ! '>='
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '0'
|
21
21
|
prerelease: false
|
22
|
-
requirement: *
|
22
|
+
requirement: *6620
|
23
23
|
name: mocha
|
24
24
|
type: :development
|
25
25
|
description: Static analysis Lint-type tool to improve your OO Ruby code
|