simplex-text-parser 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: e1e2ce0577ea46c2112fdc5efa0a4d804db0d72a
4
- data.tar.gz: bc1524c0c3d51594935bbd0b34caaa688b42cddc
3
+ metadata.gz: fbc0af83029f811427e0800b497e68368da659ca
4
+ data.tar.gz: 05b174c9b90d721855277f3c9ccb700daa2231e6
5
5
  SHA512:
6
- metadata.gz: 93b0f2a2745d4b4a5b24f904987b933ceda6210061ab847823e0c675f4df755dee6db403e74365a1a9afcb827141228214cb14f7c4412f654a26277b7dcc5382
7
- data.tar.gz: 4f1196c3f3208744c5b9f046349dc7afffb68e3d76effe20c4a9cab52ced0ac945e26d7dc9e856fcb6fd778c0b385a3852bcd7280c5377dffc72d5eda98e3112
6
+ metadata.gz: f21053a35f00335a8aa0f89ca7409a31cc1095424fdf66c6e142de0f251a0f1a2b548a2a028ea5a8686db574e4dc876545eb4ee4a8cb521f74e9eedaf92cf585
7
+ data.tar.gz: b8d4aba802ac91e2815c4a77694c29077fb68b764ac32252762f5ab69cf8bf4d2366ce4267caac1e9ace3779f5003ac377202bc7445d01cb95225bd549ec8501
@@ -5,7 +5,8 @@ module Simplex
5
5
 
6
6
  def extract_coefficients(str)
7
7
  line = find_line str
8
- line.scan(/[^\s]?\d/).map(&:to_i)
8
+ coefficients = line.scan(/[^\s\w]?\s*\d/).map{|line| line.gsub(/\s/,'')}
9
+ coefficients.map(&:to_i)
9
10
  end
10
11
 
11
12
  private
@@ -17,7 +17,7 @@ module Simplex
17
17
 
18
18
  def find_values(line)
19
19
  line = line.scan(/.*(?==)/).first
20
- line.scan(/[^\s]?\d/)
20
+ line.scan(/[^\s\w]?\s*\d/).map{|line| line.gsub(/\s/,'')}
21
21
  end
22
22
  end
23
23
  end
@@ -5,7 +5,8 @@ module Simplex
5
5
 
6
6
  def extract_rhs(str)
7
7
  lines = find_lines str
8
- lineNumbers = lines.map{|linha|linha.scan(/([^\s]?\d)\n*$/).first}.flatten
8
+ lineNumbers = lines.map{|linha|linha.scan(/([^\s\w=]?\s*\d)\n*$/).first}.flatten
9
+ lineNumbers = lineNumbers.map{|line|line.gsub(/\s/,'')}
9
10
  lineNumbers.map(&:to_i)
10
11
  end
11
12
 
@@ -1,7 +1,7 @@
1
1
  module Simplex
2
2
  module Text
3
3
  module Parser
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
6
6
  end
7
7
  end
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Kaio Magalhães"]
10
10
  spec.email = ["contato@kaiomagalhaes.com.br"]
11
11
 
12
- spec.summary = "A naive gem to parse simplex formulas to an map"
13
- spec.description = "A naive gem to parse simplex formulas to an map"
12
+ spec.summary = "A naive gem to parse simplex formulas into hashs"
13
+ spec.description = "A naive gem to parse simplex formulas into hashs"
14
14
  spec.homepage = "https://github.com/kaiomagalhaes/simplex-text-parser"
15
15
  spec.license = "MIT"
16
16
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplex-text-parser
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
  - Kaio Magalhães
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- description: A naive gem to parse simplex formulas to an map
55
+ description: A naive gem to parse simplex formulas into hashs
56
56
  email:
57
57
  - contato@kaiomagalhaes.com.br
58
58
  executables: []
@@ -100,5 +100,5 @@ rubyforge_project:
100
100
  rubygems_version: 2.4.6
101
101
  signing_key:
102
102
  specification_version: 4
103
- summary: A naive gem to parse simplex formulas to an map
103
+ summary: A naive gem to parse simplex formulas into hashs
104
104
  test_files: []