ducalis 0.5.7 → 0.5.8

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: 2287c52a483de43813b38fd3dbbb76dbe3780655
4
- data.tar.gz: 70aabac07f3332f1f93066e8b62a0735e10d312c
3
+ metadata.gz: 21e653839c1ac51f59d14a84abede1d7f3fc8d95
4
+ data.tar.gz: 89f274016015741d35d85b1c664191b41ec05948
5
5
  SHA512:
6
- metadata.gz: c83807a339d46e105dd31d431676215d3e5096ec1a4e24001f2d2f04b9b986a436a4d8f4cce5190d048472d0a52ff0dd98230842be0ec044eca77a37e4a479cd
7
- data.tar.gz: 7141de63c1e561a7a509d37b461a9bbba0f77da84c1f7e45cb6b181fd6f8162789e23de5edbd473ffeee8a6a3ddd014877ae60d62e8b92762572b02272162685
6
+ metadata.gz: e2ac4461691ba39f23a0e1f5fa7bef701daf5b50cad2c31bec1ced0556899f27923efc0490d37bbcffa00fec3c594015497e6c406d325dc5d40e40d7ff9e2a92
7
+ data.tar.gz: 78e397569b05a3859b4ef295298f03cf17ea91746a1791d86f01688712cb9ad0619c46259f2f171cf71a58967275886e9075acc6751a002d8e11af8b0878bc65
data/.travis.yml CHANGED
@@ -1,6 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - 2.2.8
3
4
  - 2.3.4
5
+ - 2.4.2
4
6
  before_install:
5
7
  - gem update --system
6
8
  - gem --version
data/DOCUMENTATION.md CHANGED
@@ -489,47 +489,6 @@ def stop_terminated_employee
489
489
  end
490
490
 
491
491
 
492
- ```
493
-
494
- ![](https://placehold.it/10/2cbe4e/000000?text=+) [bugfix] calling methods on possible tap variable
495
- ```ruby
496
-
497
- def create_message_struct(message)
498
- objects = message.map { |object| process(object) }
499
- Auditor::Message.new(message.process, objects)
500
- end
501
-
502
- ```
503
-
504
- ![](https://placehold.it/10/2cbe4e/000000?text=+) [bugfix] methods which simply returns instance var without changes
505
- ```ruby
506
-
507
- def employee
508
- @employee
509
- end
510
-
511
- ```
512
-
513
- ![](https://placehold.it/10/2cbe4e/000000?text=+) [bugfix] methods which ends with if condition
514
- ```ruby
515
-
516
- def complete=(value, complete_at)
517
- value = value.to_b
518
- self.complete_at = complete_at if complete && value
519
- self.complete_at = nil unless value
520
- end
521
-
522
- ```
523
-
524
- ![](https://placehold.it/10/2cbe4e/000000?text=+) [bugfix] methods with args without children nodes
525
- ```ruby
526
-
527
- def filtered_admins(reducers)
528
- reducers
529
- .map { |reducer| @base_scope.public_send(reducer) }
530
- .order("admin_users.created_at DESC")
531
- end
532
-
533
492
  ```
534
493
  ## Ducalis::PreferableMethods
535
494
 
@@ -667,7 +626,7 @@ MAPPING.find do |x|
667
626
  end
668
627
 
669
628
  ```
670
- ## Ducalis::RaiseWithourErrorClass
629
+ ## Ducalis::RaiseWithoutErrorClass
671
630
 
672
631
  It's better to add exception class as raise argument. It will make
673
632
  easier to catch and process it later.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ducalis (0.5.7)
4
+ ducalis (0.5.8)
5
5
  git (~> 1.3, >= 1.3.0)
6
6
  policial (= 0.0.4)
7
7
  regexp-examples (~> 1.3, >= 1.3.2)
data/config/.ducalis.yml CHANGED
@@ -71,7 +71,7 @@ Ducalis/ControllersExcept:
71
71
  Ducalis/PrivateInstanceAssign:
72
72
  Enabled: true
73
73
 
74
- Ducalis/RaiseWithourErrorClass:
74
+ Ducalis/RaiseWithoutErrorClass:
75
75
  Enabled: true
76
76
 
77
77
  Ducalis/ModuleLikeClass:
@@ -3,7 +3,7 @@
3
3
  require 'rubocop'
4
4
 
5
5
  module Ducalis
6
- class RaiseWithourErrorClass < RuboCop::Cop::Cop
6
+ class RaiseWithoutErrorClass < RuboCop::Cop::Cop
7
7
  OFFENSE = <<-MESSAGE.gsub(/^ +\|/, '').strip
8
8
  | It's better to add exception class as raise argument. It will make
9
9
  | easier to catch and process it later.
@@ -12,7 +12,7 @@ module Ducalis
12
12
  def on_send(node)
13
13
  _who, what, *args = *node
14
14
  return if what != :raise
15
- return if args.first.type != :str
15
+ return if args.first && args.first.type != :str
16
16
  add_offense(node, :expression, OFFENSE)
17
17
  end
18
18
  end
@@ -60,6 +60,7 @@ class Documentation
60
60
  RED_SQUARE = '![](https://placehold.it/10/f03c15/000000?text=+)'
61
61
  GREEN_SQUARE = '![](https://placehold.it/10/2cbe4e/000000?text=+)'
62
62
  SIGNAL_WORD = 'raises'
63
+ IGNORE_WORDS = ['[bugfix]'].freeze
63
64
 
64
65
  def call
65
66
  Dir['./lib/ducalis/cops/*.rb'].sort.map do |f|
@@ -100,7 +101,12 @@ class Documentation
100
101
  )
101
102
  SpecsProcessor.new.tap do |processor|
102
103
  processor.process(Parser::CurrentRuby.parse(source_code))
103
- end.cases
104
+ end.cases.reject(&method(:ignored?))
105
+ end
106
+
107
+ def ignored?(example)
108
+ desc, _code = example
109
+ IGNORE_WORDS.any? { |word| desc.include?(word) }
104
110
  end
105
111
 
106
112
  def klass_const_for(f)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ducalis
4
- VERSION = '0.5.7'
4
+ VERSION = '0.5.8'
5
5
  end
data/lib/ducalis.rb CHANGED
@@ -42,7 +42,7 @@ require 'ducalis/cops/possible_tap'
42
42
  require 'ducalis/cops/private_instance_assign'
43
43
  require 'ducalis/cops/preferable_methods'
44
44
  require 'ducalis/cops/protected_scope_cop'
45
- require 'ducalis/cops/raise_withour_error_class'
45
+ require 'ducalis/cops/raise_without_error_class'
46
46
  require 'ducalis/cops/regex_cop'
47
47
  require 'ducalis/cops/rest_only_cop'
48
48
  require 'ducalis/cops/rubocop_disable'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ducalis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.7
4
+ version: 0.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ignat Zakrevsky
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-15 00:00:00.000000000 Z
11
+ date: 2017-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: git
@@ -141,7 +141,7 @@ files:
141
141
  - lib/ducalis/cops/preferable_methods.rb
142
142
  - lib/ducalis/cops/private_instance_assign.rb
143
143
  - lib/ducalis/cops/protected_scope_cop.rb
144
- - lib/ducalis/cops/raise_withour_error_class.rb
144
+ - lib/ducalis/cops/raise_without_error_class.rb
145
145
  - lib/ducalis/cops/regex_cop.rb
146
146
  - lib/ducalis/cops/rest_only_cop.rb
147
147
  - lib/ducalis/cops/rubocop_disable.rb