tailor 1.3.1 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/Gemfile.lock +27 -25
- data/History.md +36 -0
- data/README.md +10 -4
- data/Rakefile +6 -6
- data/features/support/env.rb +2 -2
- data/features/support/legacy/bad_ternary_colon_spacing.rb +1 -1
- data/features/support/legacy/long_file_with_indentation.rb +2 -2
- data/features/support/world.rb +1 -1
- data/features/valid_ruby.feature +1 -1
- data/lib/tailor/cli/options.rb +19 -1
- data/lib/tailor/configuration.rb +2 -2
- data/lib/tailor/configuration/style.rb +6 -0
- data/lib/tailor/lexed_line.rb +2 -2
- data/lib/tailor/lexer/lexer_constants.rb +1 -0
- data/lib/tailor/lexer/token.rb +2 -2
- data/lib/tailor/logger.rb +2 -2
- data/lib/tailor/rake_task.rb +2 -2
- data/lib/tailor/ruler.rb +0 -1
- data/lib/tailor/rulers/allow_camel_case_methods_ruler.rb +0 -1
- data/lib/tailor/rulers/allow_conditional_parentheses.rb +65 -0
- data/lib/tailor/rulers/allow_unnecessary_double_quotes_ruler.rb +61 -0
- data/lib/tailor/rulers/allow_unnecessary_interpolation_ruler.rb +87 -0
- data/lib/tailor/rulers/indentation_spaces_ruler.rb +40 -50
- data/lib/tailor/rulers/indentation_spaces_ruler/argument_alignment.rb +63 -0
- data/lib/tailor/rulers/indentation_spaces_ruler/ast_xml.rb +89 -0
- data/lib/tailor/rulers/indentation_spaces_ruler/indentation_manager.rb +2 -14
- data/lib/tailor/rulers/indentation_spaces_ruler/line_continuations.rb +58 -0
- data/lib/tailor/rulers/max_code_lines_in_class_ruler.rb +3 -3
- data/lib/tailor/rulers/max_code_lines_in_method_ruler.rb +3 -3
- data/lib/tailor/rulers/spaces_after_comma_ruler.rb +3 -3
- data/lib/tailor/rulers/spaces_after_conditional_ruler.rb +3 -3
- data/lib/tailor/rulers/spaces_after_lbrace_ruler.rb +3 -3
- data/lib/tailor/rulers/spaces_after_lbracket_ruler.rb +3 -3
- data/lib/tailor/rulers/spaces_after_lparen_ruler.rb +3 -3
- data/lib/tailor/rulers/spaces_before_comma_ruler.rb +3 -3
- data/lib/tailor/rulers/spaces_before_rbrace_ruler.rb +2 -2
- data/lib/tailor/rulers/spaces_in_empty_braces_ruler.rb +2 -2
- data/lib/tailor/tailorrc.erb +28 -0
- data/lib/tailor/version.rb +1 -1
- data/spec/functional/conditional_parentheses_spec.rb +325 -0
- data/spec/functional/conditional_spacing_spec.rb +66 -42
- data/spec/functional/configuration_spec.rb +1 -1
- data/spec/functional/horizontal_spacing/braces_spec.rb +10 -9
- data/spec/functional/horizontal_spacing/hard_tabs_spec.rb +4 -4
- data/spec/functional/horizontal_spacing_spec.rb +5 -5
- data/spec/functional/indentation_spacing/argument_alignment_spec.rb +511 -0
- data/spec/functional/indentation_spacing/line_continuations_spec.rb +181 -0
- data/spec/functional/indentation_spacing_spec.rb +17 -0
- data/spec/functional/string_interpolation_spec.rb +117 -0
- data/spec/functional/string_quoting_spec.rb +97 -0
- data/spec/functional/vertical_spacing/class_length_spec.rb +1 -1
- data/spec/spec_helper.rb +8 -2
- data/spec/support/argument_alignment_cases.rb +93 -0
- data/spec/support/bad_indentation_cases.rb +20 -20
- data/spec/support/conditional_parentheses_cases.rb +60 -0
- data/spec/support/good_indentation_cases.rb +31 -31
- data/spec/support/horizontal_spacing_cases.rb +1 -1
- data/spec/support/line_indentation_cases.rb +71 -0
- data/spec/support/string_interpolation_cases.rb +45 -0
- data/spec/support/string_quoting_cases.rb +25 -0
- data/spec/unit/tailor/configuration/file_set_spec.rb +3 -3
- data/spec/unit/tailor/configuration/style_spec.rb +24 -21
- data/spec/unit/tailor/configuration_spec.rb +4 -1
- data/spec/unit/tailor/formatter_spec.rb +10 -10
- data/spec/unit/tailor/reporter_spec.rb +0 -1
- data/spec/unit/tailor/rulers/indentation_spaces_ruler/indentation_manager_spec.rb +0 -11
- data/spec/unit/tailor/rulers/indentation_spaces_ruler_spec.rb +1 -1
- data/spec/unit/tailor/version_spec.rb +1 -1
- data/tailor.gemspec +1 -0
- metadata +72 -33
- data/.infinity_test +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f1026ecc89830b0c65269c0bd76a2704e5231f6
|
4
|
+
data.tar.gz: 038711b887bb8afcaa7236f214b502a058de9d6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e22f50e1f616b69c4c431de2ba6e50021ee4cb03535744307c843ae24876dcdc1fba00da47660ef512fa13a65efbfa5aa844bc095e23051bda60d934b44bade8
|
7
|
+
data.tar.gz: b90cea7791ba0ef3415fadb5497fcc5e340e7f0352e81d3de6da22c391d4d02791ff81c4a279656fd147d65465bf8eeec634f13bc4c560128fc9410c06c458c6
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,59 +1,61 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
tailor (1.3.
|
4
|
+
tailor (1.3.1)
|
5
5
|
log_switch (>= 0.3.0)
|
6
|
+
nokogiri (>= 1.6.0)
|
6
7
|
term-ansicolor (>= 1.0.5)
|
7
8
|
text-table (>= 1.2.2)
|
8
9
|
|
9
10
|
GEM
|
10
11
|
remote: https://rubygems.org/
|
11
12
|
specs:
|
12
|
-
aruba (0.5.
|
13
|
+
aruba (0.5.4)
|
13
14
|
childprocess (>= 0.3.6)
|
14
15
|
cucumber (>= 1.1.1)
|
15
16
|
rspec-expectations (>= 2.7.0)
|
16
17
|
builder (3.2.2)
|
17
|
-
childprocess (0.
|
18
|
+
childprocess (0.4.0)
|
18
19
|
ffi (~> 1.0, >= 1.0.11)
|
19
|
-
cucumber (1.3.
|
20
|
+
cucumber (1.3.10)
|
20
21
|
builder (>= 2.1.2)
|
21
22
|
diff-lcs (>= 1.1.3)
|
22
|
-
gherkin (~> 2.12
|
23
|
+
gherkin (~> 2.12)
|
23
24
|
multi_json (>= 1.7.5, < 2.0)
|
24
25
|
multi_test (>= 0.0.2)
|
25
|
-
diff-lcs (1.2.
|
26
|
-
|
27
|
-
|
28
|
-
ffi (1.9.
|
29
|
-
gherkin (2.12.
|
30
|
-
multi_json (~> 1.3)
|
31
|
-
gherkin (2.12.1-java)
|
26
|
+
diff-lcs (1.2.5)
|
27
|
+
docile (1.1.2)
|
28
|
+
fakefs (0.5.0)
|
29
|
+
ffi (1.9.3)
|
30
|
+
gherkin (2.12.2)
|
32
31
|
multi_json (~> 1.3)
|
33
32
|
log_switch (0.4.0)
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
mini_portile (0.5.2)
|
34
|
+
multi_json (1.8.4)
|
35
|
+
multi_test (0.0.3)
|
36
|
+
nokogiri (1.6.1)
|
37
|
+
mini_portile (~> 0.5.0)
|
38
|
+
rake (10.1.1)
|
37
39
|
rspec (2.14.1)
|
38
40
|
rspec-core (~> 2.14.0)
|
39
41
|
rspec-expectations (~> 2.14.0)
|
40
42
|
rspec-mocks (~> 2.14.0)
|
41
|
-
rspec-core (2.14.
|
42
|
-
rspec-expectations (2.14.
|
43
|
+
rspec-core (2.14.7)
|
44
|
+
rspec-expectations (2.14.4)
|
43
45
|
diff-lcs (>= 1.1.3, < 2.0)
|
44
|
-
rspec-mocks (2.14.
|
45
|
-
simplecov (0.
|
46
|
-
|
47
|
-
|
48
|
-
|
46
|
+
rspec-mocks (2.14.4)
|
47
|
+
simplecov (0.8.2)
|
48
|
+
docile (~> 1.1.0)
|
49
|
+
multi_json
|
50
|
+
simplecov-html (~> 0.8.0)
|
51
|
+
simplecov-html (0.8.0)
|
49
52
|
term-ansicolor (1.2.2)
|
50
53
|
tins (~> 0.8)
|
51
54
|
text-table (1.2.3)
|
52
|
-
tins (0.
|
53
|
-
yard (0.8.7.
|
55
|
+
tins (0.13.1)
|
56
|
+
yard (0.8.7.3)
|
54
57
|
|
55
58
|
PLATFORMS
|
56
|
-
java
|
57
59
|
ruby
|
58
60
|
|
59
61
|
DEPENDENCIES
|
data/History.md
CHANGED
@@ -1,3 +1,39 @@
|
|
1
|
+
### 1.4.0 2014-01-23
|
2
|
+
|
3
|
+
* Features
|
4
|
+
* Added Ruby 2.1.0 to the list of tested Rubies.
|
5
|
+
* Overall better indentation checking.
|
6
|
+
* [gh-143](https://github.com/turboladen/tailor/issues/143) and
|
7
|
+
[gh-102](https://github.com/turboladen/tailor/issues/102)
|
8
|
+
* The indentation ruler can now be told, using the `:line_continuations`
|
9
|
+
option, that when a statement spans multiple lines, second and
|
10
|
+
subsequent lines are/are not indented. See [these tests](https://github.com/turboladen/tailor/blob/aca324e449d3814c4473db3c28a7f719c0023750/spec/functional/indentation_spacing/line_continuations_spec.rb)
|
11
|
+
for more info.
|
12
|
+
* [gh-144](https://github.com/turboladen/tailor/issues/143) and
|
13
|
+
[gh-94](https://github.com/turboladen/tailor/issues/94)
|
14
|
+
* Added the `:argument_alignment` option to the indentation ruler,
|
15
|
+
which tells tailor to expect method declarations and calls that span
|
16
|
+
multiple lines to have their params be indented to the same spot
|
17
|
+
as the first param of the first line. See [these tests](https://github.com/acrmp/tailor/blob/f8f3cb3c69bd4704cf8548d2c119a8d196a92043/spec/functional/indentation_spacing/argument_alignment_spec.rb)
|
18
|
+
for more info.
|
19
|
+
* [gh-148](https://github.com/turboladen/tailor/issues/148)
|
20
|
+
* Added new ruler: `allow_conditional_parentheses`. This lets you
|
21
|
+
tell tailor to expect parentheses around statements that conditionals
|
22
|
+
check. Defaults to true.
|
23
|
+
* [gh-149](https://github.com/turboladen/tailor/issues/149)
|
24
|
+
* Added new ruler: `allow_unnecessary_interpolation`. This lets you
|
25
|
+
tell tailor to check for strings that use interpolation, but do it in
|
26
|
+
a gross way. Defaults to false.
|
27
|
+
* [gh-150](https://github.com/turboladen/tailor/issues/150)
|
28
|
+
* Added new ruler: `allow_unnecessary_double_quotes`. This lets you
|
29
|
+
tell tailor to check for strings that use double-quotes but aren't
|
30
|
+
doing interpolation. Defaults to false.
|
31
|
+
* Bug fixes
|
32
|
+
* [gh-154](https://github.com/turboladen/tailor/issues/154)
|
33
|
+
* Fixed indentation when do/end block chained on a {} block. This
|
34
|
+
change also simplified IndentationManager. Thanks @hollow!
|
35
|
+
|
36
|
+
|
1
37
|
### 1.3.1 2013-09-29
|
2
38
|
|
3
39
|
* Bug fixes
|
data/README.md
CHANGED
@@ -43,6 +43,10 @@ project, whatever style that may be.
|
|
43
43
|
* Name cases
|
44
44
|
* Snake case class & module names
|
45
45
|
* Camel case method names
|
46
|
+
* Common syntax
|
47
|
+
* Conditionals wrapped in parentheses
|
48
|
+
* Unnecessary interpolation in strings
|
49
|
+
* Unnecessary use of double-quotes for strings
|
46
50
|
* Valid Ruby (warns by default)
|
47
51
|
* Configurable
|
48
52
|
* Specify style in
|
@@ -78,9 +82,9 @@ other aspects of your Ruby code.
|
|
78
82
|
|
79
83
|
### Since 0.x...
|
80
84
|
|
81
|
-
tailor 1.x is a marked
|
85
|
+
tailor 1.x is a marked improvement over 0.x. While 0.x provided a few (pretty
|
82
86
|
inconsistent) style checks, its design made the code get all spaghetti-like,
|
83
|
-
with lots of really gnarly regular expression matching, making it a
|
87
|
+
with lots of really gnarly regular expression matching, making it a really bear
|
84
88
|
to add new features and fix bugs. tailor 1.x is completely redesigned to make
|
85
89
|
that whole process much easier.
|
86
90
|
|
@@ -273,7 +277,7 @@ In the default config file, you see a single parameter being passed to
|
|
273
277
|
`config.file_set`--this is the glob that defines the list of files for that
|
274
278
|
file set. While you don't see it, `config.file_set` takes a second optional
|
275
279
|
parameter that allows you to *label* your style properties, and thus use
|
276
|
-
different sets of style properties for
|
280
|
+
different sets of style properties for different sets of files. The label is
|
277
281
|
simply just a name to refer to that file set by; it will show in your report
|
278
282
|
(in the case that problems were found, of course) so you know what set of
|
279
283
|
rulers caused the problem to be found.
|
@@ -374,7 +378,7 @@ Ruler must have:
|
|
374
378
|
#### Add the Ruler to the list of Styles
|
375
379
|
|
376
380
|
Internally, this all happens in `lib/tailor/configuration/style.rb`, but you
|
377
|
-
can add
|
381
|
+
can add information about your ruler to your config file. If you created a
|
378
382
|
Ruler:
|
379
383
|
|
380
384
|
```ruby
|
@@ -449,9 +453,11 @@ tailor.execute!
|
|
449
453
|
* Rubies (tested)
|
450
454
|
* 1.9.3
|
451
455
|
* 2.0.0
|
456
|
+
* 2.1.0
|
452
457
|
|
453
458
|
* Gems
|
454
459
|
* log_switch
|
460
|
+
* nokogiri
|
455
461
|
* term-ansicolor
|
456
462
|
* text-table
|
457
463
|
|
data/Rakefile
CHANGED
@@ -18,19 +18,19 @@ end
|
|
18
18
|
RSpec::Core::RakeTask.new
|
19
19
|
|
20
20
|
namespace :spec do
|
21
|
-
desc
|
21
|
+
desc 'Run specs with Ruby warnings turned on'
|
22
22
|
RSpec::Core::RakeTask.new(:warn) do |t|
|
23
23
|
t.ruby_opts = %w(-w)
|
24
24
|
end
|
25
25
|
|
26
|
-
desc
|
26
|
+
desc 'Run unit tests'
|
27
27
|
RSpec::Core::RakeTask.new(:unit) do |t|
|
28
|
-
t.pattern =
|
28
|
+
t.pattern = './spec/unit/**/*_spec.rb'
|
29
29
|
end
|
30
30
|
|
31
|
-
desc
|
31
|
+
desc 'Run functional tests'
|
32
32
|
RSpec::Core::RakeTask.new(:functional) do |t|
|
33
|
-
t.pattern =
|
33
|
+
t.pattern = './spec/functional/**/*_spec.rb'
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
@@ -50,6 +50,6 @@ YARD::Rake::YardocTask.new do |t|
|
|
50
50
|
end
|
51
51
|
|
52
52
|
|
53
|
-
desc
|
53
|
+
desc 'Run RSpec examples and Cucumber features'
|
54
54
|
task test: [:spec, :features]
|
55
55
|
task default: [:test]
|
data/features/support/env.rb
CHANGED
@@ -17,7 +17,7 @@ bobo = true ? true : false
|
|
17
17
|
bobo = true ? true : false
|
18
18
|
|
19
19
|
# Skip when colon is part of a symbol or namespace operator
|
20
|
-
bobo = { :
|
20
|
+
bobo = { thing: ":clown" }
|
21
21
|
bobo[:thing] == :dog ? bobo[:thing] : Math::PI
|
22
22
|
|
23
23
|
# Skip when colon is part of Regexp class
|
data/features/support/world.rb
CHANGED
@@ -6,7 +6,7 @@ module IndentationHelpers
|
|
6
6
|
# @return [String]
|
7
7
|
def get_file_contents(file_name)
|
8
8
|
path_chunks = file_name.split('/')
|
9
|
-
const_name = path_chunks.first(2).each { |c| c.upcase! }.join(
|
9
|
+
const_name = path_chunks.first(2).each { |c| c.upcase! }.join('_')
|
10
10
|
const = Kernel.const_get(const_name)
|
11
11
|
|
12
12
|
const[path_chunks.last.to_sym]
|
data/features/valid_ruby.feature
CHANGED
data/lib/tailor/cli/options.rb
CHANGED
@@ -64,6 +64,12 @@ class Tailor
|
|
64
64
|
|
65
65
|
opt.separator ''
|
66
66
|
opt.separator ' * Horizontal Spacing:'
|
67
|
+
|
68
|
+
opt.on('--allow-conditional-parentheses BOOL',
|
69
|
+
'Check for conditionals wrapped in parentheses? (default: true)') do |c|
|
70
|
+
options.style[:allow_conditional_parentheses] = c
|
71
|
+
end
|
72
|
+
|
67
73
|
opt.on('--allow-hard-tabs BOOL',
|
68
74
|
'Check for hard tabs? (default: true)') do |c|
|
69
75
|
options.style[:allow_hard_tabs] = c
|
@@ -75,6 +81,18 @@ class Tailor
|
|
75
81
|
options.style[:allow_trailing_line_spaces] = c
|
76
82
|
end
|
77
83
|
|
84
|
+
opt.on('--allow-unnecessary-interpolation BOOL',
|
85
|
+
'Check for unnecessary interpolation in strings?',
|
86
|
+
'(default: false)') do |c|
|
87
|
+
options.style[:allow_unnecessary_interpolation] = c
|
88
|
+
end
|
89
|
+
|
90
|
+
opt.on('--allow-unnecessary-double-quotes BOOL',
|
91
|
+
'Check for unnecessary use of double quotes?',
|
92
|
+
'(default: false)') do |c|
|
93
|
+
options.style[:allow_unnecessary_double_quotes] = c
|
94
|
+
end
|
95
|
+
|
78
96
|
opt.on('--indentation-spaces NUMBER', INTEGER_OR_OFF,
|
79
97
|
'Spaces to expect indentation. (default: 2)') do |c|
|
80
98
|
options.style[:indentation_spaces] = c
|
@@ -200,7 +218,7 @@ class Tailor
|
|
200
218
|
Tailor::Logger.log = true
|
201
219
|
end
|
202
220
|
|
203
|
-
opt.on_tail('-h', '--help', 'Show this message') do |
|
221
|
+
opt.on_tail('-h', '--help', 'Show this message') do |_|
|
204
222
|
puts opt
|
205
223
|
exit
|
206
224
|
end
|
data/lib/tailor/configuration.rb
CHANGED
@@ -92,7 +92,7 @@ class Tailor
|
|
92
92
|
@config_from_file =
|
93
93
|
instance_eval(File.read(user_config_file), user_config_file)
|
94
94
|
log "Got new config from file: #{user_config_file}"
|
95
|
-
rescue LoadError
|
95
|
+
rescue LoadError
|
96
96
|
raise Tailor::RuntimeError,
|
97
97
|
"Couldn't load config file: #{user_config_file}"
|
98
98
|
end
|
@@ -162,7 +162,7 @@ class Tailor
|
|
162
162
|
|
163
163
|
# Only use options set for the :default file set because the user gave
|
164
164
|
# a different set of files to measure.
|
165
|
-
@file_sets.delete_if { |k,
|
165
|
+
@file_sets.delete_if { |k, _| k != :default }
|
166
166
|
|
167
167
|
if @file_sets.include? :default
|
168
168
|
@file_sets[:default].file_list = @runtime_file_list
|
@@ -26,10 +26,13 @@ class Tailor
|
|
26
26
|
end
|
27
27
|
|
28
28
|
define_property :allow_camel_case_methods
|
29
|
+
define_property :allow_conditional_parentheses
|
29
30
|
define_property :allow_hard_tabs
|
30
31
|
define_property :allow_screaming_snake_case_classes
|
31
32
|
define_property :allow_trailing_line_spaces
|
33
|
+
define_property :allow_unnecessary_double_quotes
|
32
34
|
define_property :allow_invalid_ruby
|
35
|
+
define_property :allow_unnecessary_interpolation
|
33
36
|
define_property :indentation_spaces
|
34
37
|
define_property :max_code_lines_in_class
|
35
38
|
define_property :max_code_lines_in_method
|
@@ -50,9 +53,12 @@ class Tailor
|
|
50
53
|
# Sets up default values.
|
51
54
|
def initialize
|
52
55
|
allow_camel_case_methods(false, level: :error)
|
56
|
+
allow_conditional_parentheses(false, level: :warn)
|
53
57
|
allow_hard_tabs(false, level: :error)
|
54
58
|
allow_screaming_snake_case_classes(false, level: :error)
|
55
59
|
allow_trailing_line_spaces(false, level: :error)
|
60
|
+
allow_unnecessary_interpolation(false, level: :warn)
|
61
|
+
allow_unnecessary_double_quotes(false, level: :warn)
|
56
62
|
allow_invalid_ruby(false, level: :warn)
|
57
63
|
indentation_spaces(2, level: :error)
|
58
64
|
max_code_lines_in_class(300, level: :error)
|
data/lib/tailor/lexed_line.rb
CHANGED
@@ -174,7 +174,7 @@ class Tailor
|
|
174
174
|
|
175
175
|
# @param [Fixnum] column Number of the column to get the event for.
|
176
176
|
# @return [Array] The event at the given column.
|
177
|
-
def event_at
|
177
|
+
def event_at(column)
|
178
178
|
self.find { |e| e.first.last == column }
|
179
179
|
end
|
180
180
|
|
@@ -186,7 +186,7 @@ class Tailor
|
|
186
186
|
# @param [Fixnum] column Number of the column of which event to get the
|
187
187
|
# index for.
|
188
188
|
# @return [Fixnum] The index within +self+ that the event is at.
|
189
|
-
def event_index
|
189
|
+
def event_index(column)
|
190
190
|
column_event = self.event_at column
|
191
191
|
self.index(column_event)
|
192
192
|
end
|
data/lib/tailor/lexer/token.rb
CHANGED
@@ -7,7 +7,7 @@ class Tailor
|
|
7
7
|
|
8
8
|
# Helper methods for tokens that are parsed by {Tailor::Lexer}.
|
9
9
|
class Token < String
|
10
|
-
include LexerConstants
|
10
|
+
include Tailor::LexerConstants
|
11
11
|
include Tailor::Logger::Mixin
|
12
12
|
|
13
13
|
# @param [String] the_token
|
@@ -63,7 +63,7 @@ class Tailor
|
|
63
63
|
# @return [Boolean] True if there's a modifier in the current line that
|
64
64
|
# is the same type as +token+.
|
65
65
|
def modifier_keyword?
|
66
|
-
return false
|
66
|
+
return false unless keyword_to_indent?
|
67
67
|
|
68
68
|
line_of_text = @options[:full_line_of_text]
|
69
69
|
log "Line of text: #{line_of_text}"
|
data/lib/tailor/logger.rb
CHANGED
@@ -10,7 +10,7 @@ class Tailor
|
|
10
10
|
return @logger if @logger
|
11
11
|
@logger ||= ::Logger.new $stdout
|
12
12
|
|
13
|
-
def @logger.format_message(
|
13
|
+
def @logger.format_message(_, time, _, msg)
|
14
14
|
"[#{time.strftime('%Y-%m-%d %H:%M:%S')}] #{msg}\n"
|
15
15
|
end
|
16
16
|
|
@@ -20,7 +20,7 @@ class Tailor
|
|
20
20
|
# Provides an .included hook to insert the name of the class for each log
|
21
21
|
# message in the class that includes the Mixin.
|
22
22
|
module Mixin
|
23
|
-
def self.included(
|
23
|
+
def self.included(_)
|
24
24
|
define_method :log do |*args|
|
25
25
|
class_minus_main_name = self.class.to_s.sub(/^.*::/, '')
|
26
26
|
args.first.insert(0, "<#{class_minus_main_name}> ")
|
data/lib/tailor/rake_task.rb
CHANGED
@@ -133,7 +133,7 @@ class Tailor
|
|
133
133
|
end
|
134
134
|
|
135
135
|
# @param [Tailor::Configuration] config
|
136
|
-
def create_recursive_file_sets_for
|
136
|
+
def create_recursive_file_sets_for(config)
|
137
137
|
unless @recursive_file_sets.empty?
|
138
138
|
@recursive_file_sets.each do |fs|
|
139
139
|
config.recursive_file_set(fs[0], fs[1], &fs[2])
|
@@ -142,7 +142,7 @@ class Tailor
|
|
142
142
|
end
|
143
143
|
|
144
144
|
# @param [Tailor::Configuration] config
|
145
|
-
def create_file_sets_for
|
145
|
+
def create_file_sets_for(config)
|
146
146
|
unless @file_sets.empty?
|
147
147
|
@file_sets.each { |fs| config.file_set(fs[0], fs[1], &fs[2]) }
|
148
148
|
end
|