sentino 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4f201f48f4b522c8ff4686c0a5450dcf8586e3d8
4
- data.tar.gz: b1f59dd4d9a35600a127c79f7c45dc31c02ea480
3
+ metadata.gz: d248961bc584b3dd5908477776a03126337a822b
4
+ data.tar.gz: 02134d3edbb165f9b1cb3b25f59e1e2f34007226
5
5
  SHA512:
6
- metadata.gz: 2be893ed10a18d19ce449b5d68fcd02fae74b1a8637e96df5090a743c093c907d943c3cf0ad19fe65441a1276af635ac82eca1a687df11f53476352f0d6f7c6e
7
- data.tar.gz: dfc68b4dd6f1d1cc7c7c0e6cd73ec06d3aef6248a64e5790e8f32b0c25af34b0fa10f61bb0636adc3843262ad0dc95361a52fed54e5151dc30dc84b67b5d6462
6
+ metadata.gz: c8651282b7b1d78f89a084def4e353da86d069bfbff835137817a102bb2212fe747b50f45b12c961ea3a0511c09658c44cdc08c40be6b4c14eb3e8565d961485
7
+ data.tar.gz: 092d68aaaa736fbff7e88f510fa7ec67cd48b63adfbc0737ec264d488e50e4ebc85399b7d8e11db8e38017b105b2cc7087f76a2e193c61ad07c31b819723cf63
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -40,14 +40,13 @@ private
40
40
  for mathcer in @reference
41
41
  counts << count_matchings(string, mathcer)
42
42
  end
43
- puts counts
44
43
  total_length = counts.map{|x| x == 0 ? 1 : x}.reduce(:+)
45
44
  matching_length = counts.reduce(:+)
46
45
  matching_length.to_f/total_length.to_f
47
46
  end
48
47
 
49
48
  def count_matchings(string, substring)
50
- string.scan(/(?=#{substring})/).count
49
+ string.scan(/(?=#{Regexp.quote(substring)})/).count
51
50
  end
52
51
 
53
52
  end
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: sentino 0.2.0 ruby lib
5
+ # stub: sentino 0.2.1 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "sentino"
9
- s.version = "0.2.0"
9
+ s.version = "0.2.1"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sentino
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ferhat Ziba