rulp 0.0.21 → 0.0.22

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: ec8daf9136bd2d1a25039ae705d7f12307496228
4
- data.tar.gz: 20512ada8648c033c169b78a91b6179e36a39ccd
3
+ metadata.gz: 912368647d83dea0e265b19db45e2fd01ca13eae
4
+ data.tar.gz: 5021fac9d0b62dc4a4160ce43cdf1c085327d632
5
5
  SHA512:
6
- metadata.gz: e91767654d60fe39c8c23f1660515a533bc35a4eaef79a52c79b2dec07769ab5e6d62e809e1aeac0929234466feaffc208229a541937472058f39033f0ff2830
7
- data.tar.gz: fe2172bac01fb624a5fdcaf1e13e33987dd0a2f3591cc42a2d99a8f962bd6f2fdebcd7933340f7364dd0c3056b0ffc1a885160c33af8a335d89accb660e9bad0
6
+ metadata.gz: 72b4248581c87d1cace2d073667ba70de3b02f9381d16e483454d162422e69f887ea08d4596c0353f7e602c8915f0348af73bd413ec8ea22426153eb2078b25e
7
+ data.tar.gz: 15b32b970cf4d0404f5c160831f3b2dc08851633d39377be87ffeef3c4506b5a00577f130d52437b47bc224479c76404a9ca266925648467178f0fba637f46fd
data/lib/rulp/rulp.rb CHANGED
@@ -170,6 +170,9 @@ module Rulp
170
170
  "Parsing result".log(:info)
171
171
  solver.store_results(@variables)
172
172
 
173
+ solver.remove_lp_file if options[:remove_lp_file]
174
+ solver.remove_sol_file if options[:remove_sol_file]
175
+
173
176
  self.result = @objective_expression.evaluate
174
177
 
175
178
  "Objective: #{result}\n#{@variables.map{|v|[v.name, "=", v.value].join(' ') if v.value}.compact.join("\n")}".log(:debug)
@@ -25,6 +25,14 @@ class Solver
25
25
  Rulp.exec(command)
26
26
  end
27
27
 
28
+ def remove_lp_file
29
+ FileUtils.rm(@filename)
30
+ end
31
+
32
+ def remove_sol_file
33
+ FileUtils.rm(@outfile)
34
+ end
35
+
28
36
  def solver_exists?
29
37
  @solver_exists || false
30
38
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rulp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.21
4
+ version: 0.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wouter Coppieters
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-06 00:00:00.000000000 Z
11
+ date: 2016-01-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A simple Ruby LP description DSL
14
14
  email: wc@pico.net.nz