more_math 0.3.0 → 0.3.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: 727430367eb365e3a57f00b0b83df2dd5f1b35ae
4
- data.tar.gz: fbd16cb6b25ae158ec78de6aba6fd3f5508927be
3
+ metadata.gz: f1d5d444c84412e2b3fb7246e52f29d9672e27ef
4
+ data.tar.gz: 981958d5893c22734588a132edd51fd28a759691
5
5
  SHA512:
6
- metadata.gz: 2cad965b73aed2534cdaba035189a358a17dca229ddbc3480869d4178fb1aca6c4513c3137b635401bbfb6cf90e3723283aa3a92e9bbdf9394bda0ca1232c881
7
- data.tar.gz: 6b3021affc41dd7b7535c4a9fc20852ab51e192be248100d39e1ea1bf5fd52fca75d2556c69bbf8ee230f30ba0c0a2e7c3110290c5fbceb6534ad9333762a7f1
6
+ metadata.gz: 5438f1293d698a5379a56ba70f3fedafa3931044ad36c4a6bc78d34826d01e118957e27244daaf0b0008d0d598cc8bf49c25f5608fbfed15823ce7041531f023
7
+ data.tar.gz: ebdde22957a5d1dc9152f673f43e694404db3a8c793070efada5208bbef0f577839eff065d88d5046be705d13dd33843bc020b29b15cbc0fd772289065ac6ec6
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
@@ -17,7 +17,7 @@ module MoreMath
17
17
  -1.0 * size * frequency * Math.log2(frequency)
18
18
  end
19
19
 
20
- def entropy_percentage(text)
20
+ def entropy_ratio(text)
21
21
  size = text.each_char.size
22
22
  size <= 1 and return 0.0
23
23
  entropy(text) / entropy_ideal(size)
@@ -1,6 +1,6 @@
1
1
  module MoreMath
2
2
  # MoreMath version
3
- VERSION = '0.3.0'
3
+ VERSION = '0.3.1'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
@@ -1,9 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: more_math 0.3.0 ruby lib
2
+ # stub: more_math 0.3.1 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "more_math".freeze
6
- s.version = "0.3.0"
6
+ s.version = "0.3.1"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib".freeze]
@@ -34,11 +34,11 @@ class EntropyTest < Test::Unit::TestCase
34
34
  assert_in_delta 4, entropy_ideal(16), 1E-3
35
35
  end
36
36
 
37
- def test_entropy_percentage
38
- assert_equal 0, entropy_percentage(@empty)
39
- assert_equal 0, entropy_percentage(@low)
40
- assert_in_delta 0.6834, entropy_percentage(@string), 1E-3
41
- assert_in_delta 0.8167, entropy_percentage(@high), 1E-3
42
- assert_in_delta 1.0, entropy_percentage(@random), 1E-3
37
+ def test_entropy_ratio
38
+ assert_equal 0, entropy_ratio(@empty)
39
+ assert_equal 0, entropy_ratio(@low)
40
+ assert_in_delta 0.6834, entropy_ratio(@string), 1E-3
41
+ assert_in_delta 0.8167, entropy_ratio(@high), 1E-3
42
+ assert_in_delta 1.0, entropy_ratio(@random), 1E-3
43
43
  end
44
44
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: more_math
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank