cbc 0.1.1 → 0.1.2

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: b77d0c48415a2615b0bf795b962bee34e7f2265306bdbf621a57fb1351206ecc
4
- data.tar.gz: ed1ef4406e42333df474c5b1741ffa35a2653ba66f36a792246fa0b84de1419c
3
+ metadata.gz: 872906265947008e72d46ca695d37f3787b58207e985e22e0446c1ecea0e7696
4
+ data.tar.gz: 0bc422b8cc9b5d7aff800f6210799f4003509c62d5d3833a0c5eee3fbc5b4c62
5
5
  SHA512:
6
- metadata.gz: 8b3d02b70ffd66a09f23e1694093f1479e0ddffee9117ece84ea641efadad458d6389ed0bafe6403e809f68b68c6f3e440909e4c067918ddec9d7f6feaa7c6e2
7
- data.tar.gz: 611329db4f441e8717ec7b633b191b5569204b180934dae6e369fe81b0c766fcc2c6b09678dd5f6e5fdcd33a6365fdfb545710f2bc0ba7845a59fc7d55ea8d71
6
+ metadata.gz: 9df3966a5841c3cb280a40153f8c3e97d6b60e52702850b9f5a1f2193759fd17f7f6040830b4f30828686a4b9354f164b79db247102d1c433d80e9a5e2f16e36
7
+ data.tar.gz: 7937bccb59ba45630c137ec8a415e7e8f15255db4a4ff860bd89629a91682c66f0d338788a1f943684ed16e8617bfc2b9ca8942cd853800feebf45b7353ba431
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.1.2 (2023-06-07)
2
+
3
+ - Improved support for Mac ARM
4
+ - Fixed error with `dup` and `clone`
5
+
1
6
  ## 0.1.1 (2022-06-12)
2
7
 
3
8
  - Fixed status
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  [Cbc](https://github.com/coin-or/Cbc) - the mixed-integer 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/cbc-ruby/workflows/build/badge.svg?branch=master)](https://github.com/ankane/cbc-ruby/actions)
6
8
 
7
9
  ## Installation
data/lib/cbc/model.rb CHANGED
@@ -2,7 +2,7 @@ module Cbc
2
2
  class Model
3
3
  def initialize
4
4
  @model = FFI.Cbc_newModel
5
- ObjectSpace.define_finalizer(self, self.class.finalize(@model))
5
+ @model.free = FFI["Cbc_deleteModel"]
6
6
 
7
7
  @below210 = Gem::Version.new(Cbc.lib_version) < Gem::Version.new("2.10.0")
8
8
  FFI.Cbc_setLogLevel(model, 0) unless @below210
@@ -96,11 +96,6 @@ module Cbc
96
96
  }
97
97
  end
98
98
 
99
- def self.finalize(model)
100
- # must use proc instead of stabby lambda
101
- proc { FFI.Cbc_deleteModel(model) }
102
- end
103
-
104
99
  private
105
100
 
106
101
  def model
data/lib/cbc/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Cbc
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/cbc.rb CHANGED
@@ -2,8 +2,8 @@
2
2
  require "fiddle/import"
3
3
 
4
4
  # modules
5
- require "cbc/model"
6
- require "cbc/version"
5
+ require_relative "cbc/model"
6
+ require_relative "cbc/version"
7
7
 
8
8
  module Cbc
9
9
  class Error < StandardError; end
@@ -16,7 +16,11 @@ module Cbc
16
16
  # TODO test
17
17
  ["CbcSolver.dll"]
18
18
  elsif RbConfig::CONFIG["host_os"] =~ /darwin/i
19
- ["libCbcSolver.dylib"]
19
+ if RbConfig::CONFIG["host_cpu"] =~ /arm|aarch64/i
20
+ ["libCbcSolver.dylib", "/opt/homebrew/lib/libCbcSolver.dylib"]
21
+ else
22
+ ["libCbcSolver.dylib"]
23
+ end
20
24
  else
21
25
  # coinor-libcbc-dev has libCbcSolver.so
22
26
  # coinor-libcbc3 has libCbcSolver.so.3
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cbc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
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-06-12 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: Mixed-integer programming for Ruby