fasterer 0.7.0 → 0.7.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
  SHA256:
3
- metadata.gz: d9948b922544838685466166a577f49d09424d93b9d04337fb731198427f15bc
4
- data.tar.gz: fad2c9125b232a13454d0bf168236713f59938ff01d85670597a2d8c7374e321
3
+ metadata.gz: 5e99fc2f38833d5224d0e6875dee83fbe221c197fb452e655b20613438408abc
4
+ data.tar.gz: b6289e01ed3ecb79819a2f4e59297bd83291ef10ce2b282f74918d7b4c5cf4c7
5
5
  SHA512:
6
- metadata.gz: 4645193c53c5b78bda14a72b0368164673df1bf28ea726464c701d5f1e1d3f0a5f102089df55ae656ad090cc90aee0f8d8e488baefbb04d082cc4742479dc2f5
7
- data.tar.gz: ce2e88f3d450299b42986cc9f3ee014a281aadf7f833d6413bfd0d5d80a7e43f4a21564060e7e440b664a93c99ff229ddd94d47282a0ee61970a43ffaccbcf35
6
+ metadata.gz: bf39d1f39d954b331d81326cff413cd7a65359b123514655639c34bc91e0c5001c8fdd6ed2f317b9f34ecb519af3efb694fdc1cdc99fdeb210d987271ce798aa
7
+ data.tar.gz: 5cf1ba87677e9e3bfaa203981052961d0c12b3ea381f2af14bab4471cee7f9e147f0d88b16518d375f543da7e535c8a5883173770e8c32e536874c61a3f831a4
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.1
4
+
5
+ - Fix `check_symbol_to_proc` rule from crashing when there is no receiver [#67](https://github.com/DamirSvrtan/fasterer/pull/67)
6
+
3
7
  ## 0.7.0
4
8
 
5
9
  - More inclusive `check_symbol_to_proc` rule - don't only look at #each but any method that could leverage the symbol to proc rule. Merged through [#41](https://github.com/DamirSvrtan/fasterer/pull/41)
@@ -130,6 +130,7 @@ module Fasterer
130
130
 
131
131
  return unless body_method_call.arguments.count.zero?
132
132
  return if body_method_call.has_block?
133
+ return if body_method_call.receiver.nil?
133
134
  return unless body_method_call.receiver.name == method_call.block_argument_names.first
134
135
 
135
136
  add_offense(:block_vs_symbol_to_proc)
@@ -1,3 +1,3 @@
1
1
  module Fasterer
2
- VERSION = '0.7.0'
2
+ VERSION = '0.7.1'
3
3
  end
@@ -3,9 +3,9 @@ require 'spec_helper'
3
3
  describe Fasterer::Analyzer do
4
4
  let(:test_file_path) { RSpec.root.join('support', 'analyzer', '18_block_vs_symbol_to_proc.rb') }
5
5
 
6
- it 'should block that could be called with symbol 6 times' do
6
+ it 'should block that could be called with symbol 7 times' do
7
7
  analyzer = Fasterer::Analyzer.new(test_file_path)
8
8
  analyzer.scan
9
- expect(analyzer.errors[:block_vs_symbol_to_proc].count).to eq(6)
9
+ expect(analyzer.errors[:block_vs_symbol_to_proc].count).to eq(7)
10
10
  end
11
11
  end
@@ -34,3 +34,6 @@ numbers.each { |number| number.to_s }
34
34
  numbers.map { |number| number.to_s }
35
35
  numbers.any? { |number| number.even? }
36
36
  numbers.find { |number| number.even? }
37
+
38
+ instance_eval { |_| method_call_without_receiver }
39
+ instance_eval { |object| object.to_s }
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.7.0
4
+ version: 0.7.1
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-09-22 00:00:00.000000000 Z
11
+ date: 2019-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize