r_odds 0.1.0 → 0.1.5

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: 2ca0bcfc66295acd8241062d6e4d9cf69189da75ec32eed54ab57363fb54062e
4
- data.tar.gz: f3c80f76b9489ad53748cd1cc3371c4647373d1c09c09634624bea8525181d8b
3
+ metadata.gz: 692678515e8d91144bd8addc0ad0fec7768decda5bdc2d467a2dfd8980c613a1
4
+ data.tar.gz: 3c48be31d731c242d06ab34497f96074372407612dfc6bc9fadb687b3e2311a1
5
5
  SHA512:
6
- metadata.gz: c603d57b51ebeb2b402b10c9af7dc4de309725069da4b054ba06efe0cbaf9e60cc83a4ad35b5f8568c9e1075a0f6c5afd74c5f5067985fb9584e886eb9e879d3
7
- data.tar.gz: c45c8321c58a1db2c4170a66800aea2a07e6f51257b9ec8e28ecab8cfbc9b54c9b866ebca61bc1a8c5171668761a71d0fe4fa747945362c35bf8b5dad52f3d7c
6
+ metadata.gz: f584f062a05c7c9de24b67933313eb14a2a628b88d193603829e4395e9194305176420df5276591b81b344903c6d4d4b9181cb92a936793258dd7ad75d4d8d6a
7
+ data.tar.gz: 655b686da540ab207d69358bda0bc982ce92e8f336412adfeacf50ca093da87971e90e50abda2b07b594ee9eebd9db56b463ac17fb1580626b886d0725e3b368
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- r_odds (0.1.0)
4
+ r_odds (0.1.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -13,7 +13,7 @@ GEM
13
13
  coderay (~> 1.1.0)
14
14
  method_source (~> 0.8.1)
15
15
  slop (~> 3.4)
16
- rake (10.5.0)
16
+ rake (13.0.1)
17
17
  rspec (3.7.0)
18
18
  rspec-core (~> 3.7.0)
19
19
  rspec-expectations (~> 3.7.0)
@@ -36,8 +36,8 @@ DEPENDENCIES
36
36
  bundler (~> 1.16)
37
37
  pry (~> 0.10.3)
38
38
  r_odds!
39
- rake (~> 10.0)
39
+ rake (>= 12.3.3)
40
40
  rspec (~> 3.7)
41
41
 
42
42
  BUNDLED WITH
43
- 1.16.2
43
+ 1.17.2
data/README.md CHANGED
@@ -15,7 +15,7 @@ require 'r_odds'
15
15
  ```
16
16
 
17
17
  ## How to use the gem
18
- Use the `:convert` method to convert between any of the following formats: `:american`, `:decimal`, `:fractional` or `:implied probability`
18
+ Use the `:convert` method to convert between any of the following formats: `:american`, `:decimal`, `:fractional` or `:implied_probability`
19
19
 
20
20
  ```ruby
21
21
  ROdds.convert('+150', to: :decimal)
@@ -32,7 +32,7 @@ You can also specify the format you're passing in for ambiguous formats like `'1
32
32
  ROdds.convert('1/4', to: :decimal)
33
33
  #=> 1.25
34
34
 
35
- ROdds.convert('1/4', from: :probability, to: :american)
35
+ ROdds.convert('1/4', from: :implied_probability, to: :american)
36
36
  #=> +300
37
37
  ```
38
38
 
@@ -13,7 +13,7 @@ module ROdds
13
13
  case odd
14
14
  when /^(?:[1-9]\d*)+(\/|:)(?:[1-9]\d*)+$/
15
15
  :fractional
16
- when /^[+-][1-9]\d{2,}\.?\d*$/
16
+ when /^[+-]?[1-9]\d{2,}\.?\d*$/
17
17
  :american
18
18
  when /\d*.?\d++%/
19
19
  :implied_probability
@@ -1,7 +1,8 @@
1
1
  module ROdds
2
2
  module OddStandardizer
3
3
  class Fractional
4
- NUMERATOR_AND_DENOMINATOR = /(?<numerator>\d+)(\/|-to-| to |to|)(?<denominator>\d+)/
4
+ NUMERATOR_AND_DENOMINATOR =
5
+ /(?<numerator>\d+\.?\d*)(\D*)(?<denominator>\d+\.?\d*)/
5
6
 
6
7
  def self.call(params)
7
8
  new(params).call
@@ -1,3 +1,3 @@
1
1
  module ROdds
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.5"
3
3
  end
data/r_odds.gemspec CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["George Wambold"]
10
10
  spec.email = ["georgewambold@gmail.com"]
11
11
 
12
- spec.summary = %q{Easy to work with odd conversions}
12
+ spec.summary = %q{Simple odds conversions -- Written in Ruby!}
13
13
  spec.license = "MIT"
14
14
 
15
15
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.require_paths = ["lib"]
32
32
 
33
33
  spec.add_development_dependency "bundler", "~> 1.16"
34
- spec.add_development_dependency "rake", "~> 10.0"
34
+ spec.add_development_dependency "rake", ">= 12.3.3"
35
35
  spec.add_development_dependency "rspec", "~> 3.7"
36
36
  spec.add_development_dependency "pry", "~> 0.10.3"
37
37
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r_odds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - George Wambold
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-26 00:00:00.000000000 Z
11
+ date: 2021-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: 12.3.3
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: 12.3.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.10.3
69
- description:
69
+ description:
70
70
  email:
71
71
  - georgewambold@gmail.com
72
72
  executables: []
@@ -108,11 +108,11 @@ files:
108
108
  - lib/r_odds/standardizer.rb
109
109
  - lib/r_odds/version.rb
110
110
  - r_odds.gemspec
111
- homepage:
111
+ homepage:
112
112
  licenses:
113
113
  - MIT
114
114
  metadata: {}
115
- post_install_message:
115
+ post_install_message:
116
116
  rdoc_options: []
117
117
  require_paths:
118
118
  - lib
@@ -127,9 +127,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  - !ruby/object:Gem::Version
128
128
  version: '0'
129
129
  requirements: []
130
- rubyforge_project:
131
- rubygems_version: 2.7.6
132
- signing_key:
130
+ rubygems_version: 3.1.2
131
+ signing_key:
133
132
  specification_version: 4
134
- summary: Easy to work with odd conversions
133
+ summary: Simple odds conversions -- Written in Ruby!
135
134
  test_files: []