clp 0.1.2 → 0.1.3

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
  SHA256:
3
- metadata.gz: 185f03fde8ab409746c146c6193e34b8beb1317991c52b869d0a9a1714227259
4
- data.tar.gz: b785a19d316b0ff5dea8647ef63d762b42a8891c9a4c5615ee7cfd252018be7a
3
+ metadata.gz: ce8d28ee2e7e1772cfc1cdc8ea027e6946a791a3682ac4865f10f78cce765426
4
+ data.tar.gz: 656c14297cc86e4baf08b33b64940530b3a83e2133a8e944c1c47d75487fae0f
5
5
  SHA512:
6
- metadata.gz: 798dfc96c75bece7fcfb5581b036d78a0f82a4f7b6a904f0253b5c3d765398c5b69bb7b58d70ce9bd7d9a38d692eb24ae41c44eb71f9fabc2597703f38b7b23d
7
- data.tar.gz: 8e95103aecb6162e352cfc12be4048cca63e94cc44e463f04afdd699e8ddccaf55aecb96a2156376965369e4cdb782abdef4ff61123d41c9123c4a5140850402
6
+ metadata.gz: '086c1b6352fb07f1a425b955ccf95eebe4fbf7c4c7a2ba8736ca04811732dd0c9dde9f7233611d12ed71c9880b2646f6ffcc892b334231a33aee9e63f2b1ace7'
7
+ data.tar.gz: 103720186f2a2a547fd9561a381ab9b4bb7b7c8c197a2f573ac6183e52506ecafb6d1513a61cd68862209d915a3dabc3e856d7cbceb3d9e4ca3a9c492ecc2e0c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.1.3 (2023-06-07)
2
+
3
+ - Improved support for Mac ARM
4
+ - Fixed error with `dup` and `clone`
5
+
1
6
  ## 0.1.2 (2022-04-14)
2
7
 
3
8
  - Added `log_level` and `time_limit` options to `solve` method
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  [Clp](https://github.com/coin-or/Clp) - linear programming solver - for Ruby
4
4
 
5
+ Check out [Opt](https://github.com/ankane/opt) for a high-level interface
6
+
5
7
  [![Build Status](https://github.com/ankane/clp-ruby/workflows/build/badge.svg?branch=master)](https://github.com/ankane/clp-ruby/actions)
6
8
 
7
9
  ## Installation
data/lib/clp/model.rb CHANGED
@@ -2,7 +2,7 @@ module Clp
2
2
  class Model
3
3
  def initialize
4
4
  @model = FFI.Clp_newModel
5
- ObjectSpace.define_finalizer(self, self.class.finalize(@model))
5
+ @model.free = FFI["Clp_deleteModel"]
6
6
 
7
7
  FFI.Clp_setLogLevel(model, 0)
8
8
  end
@@ -53,11 +53,6 @@ module Clp
53
53
  }
54
54
  end
55
55
 
56
- def self.finalize(model)
57
- # must use proc instead of stabby lambda
58
- proc { FFI.Clp_deleteModel(model) }
59
- end
60
-
61
56
  private
62
57
 
63
58
  def model
data/lib/clp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Clp
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
data/lib/clp.rb CHANGED
@@ -2,8 +2,8 @@
2
2
  require "fiddle/import"
3
3
 
4
4
  # modules
5
- require "clp/model"
6
- require "clp/version"
5
+ require_relative "clp/model"
6
+ require_relative "clp/version"
7
7
 
8
8
  module Clp
9
9
  class Error < StandardError; end
@@ -16,7 +16,11 @@ module Clp
16
16
  # TODO test
17
17
  ["Clp.dll"]
18
18
  elsif RbConfig::CONFIG["host_os"] =~ /darwin/i
19
- ["libClp.dylib"]
19
+ if RbConfig::CONFIG["host_cpu"] =~ /arm|aarch64/i
20
+ ["libClp.dylib", "/opt/homebrew/lib/libClp.dylib"]
21
+ else
22
+ ["libClp.dylib"]
23
+ end
20
24
  else
21
25
  # coinor-libclp-dev has libClp.so
22
26
  # coinor-libclp1 has libClp.so.1
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-14 00:00:00.000000000 Z
11
+ date: 2023-06-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: andrew@ankane.org
@@ -42,7 +42,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
42
42
  - !ruby/object:Gem::Version
43
43
  version: '0'
44
44
  requirements: []
45
- rubygems_version: 3.3.7
45
+ rubygems_version: 3.4.10
46
46
  signing_key:
47
47
  specification_version: 4
48
48
  summary: Linear programming solver for Ruby