fasterer 0.1.0 → 0.1.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
  SHA1:
3
- metadata.gz: 700f1de5e4957667423d3e045970c1046e86579f
4
- data.tar.gz: 7c60c88efa59abe5857436f1a229a96b54f77e6d
3
+ metadata.gz: 5326a0412657a2db9c2b84efad1a746aaf21f476
4
+ data.tar.gz: c04d001a94792fdcee7ea2fd31f5bf58f0d1048a
5
5
  SHA512:
6
- metadata.gz: 70b4baaf83af7c16e926245b5685b9a2b52568f4f81c279da6d0f70a68cd1af49b82dda342c43d0a4f5c4e6bb65ab027cb9fee19afdd0601be6815db660d2865
7
- data.tar.gz: 26543c720eefaf8f678e4353d4a5837d336912def1359d300a3d3f45903ca1bf4e2185446e916ef9fdf4b74c4548e829989f1d2f9131f1438cd6180141435565
6
+ metadata.gz: d37d2a91589c7c9d89eb2e7edfeda0f7c89824c37c2871e2f50b111b83cf40a5ee2fa22034df6837b969da5129aa769e11a61331ea1fa20d9f7c3715599a0942
7
+ data.tar.gz: f2055f3eb1d3473ed18d14a9e461bae2600b1dca20e447460b8f2da63a46315e0f59496cf479f1f90678e9951381395d5913f624b8012a2572f7ed2a48c78f7e
data/README.md CHANGED
@@ -45,7 +45,7 @@ Use tr instead of gsub when grepping plain strings. Occured at lines: 161.
45
45
  ```
46
46
  ## Configuration
47
47
 
48
- You can turn of speed suggestions with a simple yaml file called **.fasterer.yml** in the root of your project. Example:
48
+ You can turn off speed suggestions with a simple yaml file called **.fasterer.yml** in the root of your project. Example:
49
49
 
50
50
 
51
51
  ```yaml
@@ -68,7 +68,7 @@ speedups:
68
68
  gsub_vs_tr: true
69
69
  ```
70
70
 
71
- ## TODOs:
71
+ ## Speedups TODO:
72
72
 
73
73
  4. find vs bsearch
74
74
  5. Array#count vs Array#size
@@ -79,11 +79,6 @@ speedups:
79
79
  22. String#match vs String#start_with?/String#end_with?
80
80
  23. String#gsub vs String#sub
81
81
 
82
- # New
83
-
84
- values each -> each_value
85
- class_eval
86
-
87
82
  ## Contributing
88
83
 
89
84
  1. Fork it ( https://github.com/DamirSvrtan/fasterer/fork )
@@ -47,7 +47,10 @@ module Fasterer
47
47
  end
48
48
 
49
49
  def check_gsub_offense
50
- unless method_call.arguments.first.value.is_a? Regexp
50
+ first_argument = method_call.arguments.first
51
+ return if first_argument.nil?
52
+
53
+ if first_argument.value.is_a?(String) && first_argument.value.size == 1
51
54
  add_offense(:gsub_vs_tr)
52
55
  end
53
56
  end
@@ -1,3 +1,3 @@
1
1
  module Fasterer
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
@@ -12,3 +12,5 @@ class Hello
12
12
  'alfabet'.gsub('r', 'b'.gsub('a', 'z'))
13
13
  end
14
14
  end
15
+
16
+ petar.gsub('pet', 'fat')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fasterer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damir Svrtan