cbc 0.1.1 → 0.2.0

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: db11406633025df703e0c5317e2d035008234c47dadd6aebfcfd3d76c04117e8
4
+ data.tar.gz: cb2f05ed70bbd91685fbb1317dffdf5dc0ea0e1d9b649113baf9ebaf459de1a8
5
5
  SHA512:
6
- metadata.gz: 8b3d02b70ffd66a09f23e1694093f1479e0ddffee9117ece84ea641efadad458d6389ed0bafe6403e809f68b68c6f3e440909e4c067918ddec9d7f6feaa7c6e2
7
- data.tar.gz: 611329db4f441e8717ec7b633b191b5569204b180934dae6e369fe81b0c766fcc2c6b09678dd5f6e5fdcd33a6365fdfb545710f2bc0ba7845a59fc7d55ea8d71
6
+ metadata.gz: f53320ef57ddc9e67c2ac75a8f886d789106e7e5fa204a6d4201b501925aad6d8df9d7712a9402cab966584d7ea0ce49bfb050683e63930e29f17b8365b920d2
7
+ data.tar.gz: 1e0248fafc1510c916b15765abd2677efb63595ae3839bd095c2ab2abce3a603a61df8190d8b8f493588eccb166c098642949843088c5c4d4600ba854cbc85ba
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 0.2.0 (2024-10-22)
2
+
3
+ - Added support for `coinor-libcbc3.1` package
4
+ - Dropped support for Ruby < 3.1
5
+
6
+ ## 0.1.2 (2023-06-07)
7
+
8
+ - Improved support for Mac ARM
9
+ - Fixed error with `dup` and `clone`
10
+
1
11
  ## 0.1.1 (2022-06-12)
2
12
 
3
13
  - Fixed status
data/README.md CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
  [Cbc](https://github.com/coin-or/Cbc) - the mixed-integer programming solver - for Ruby
4
4
 
5
- [![Build Status](https://github.com/ankane/cbc-ruby/workflows/build/badge.svg?branch=master)](https://github.com/ankane/cbc-ruby/actions)
5
+ Check out [Opt](https://github.com/ankane/opt) for a high-level interface
6
+
7
+ [![Build Status](https://github.com/ankane/cbc-ruby/actions/workflows/build.yml/badge.svg)](https://github.com/ankane/cbc-ruby/actions)
6
8
 
7
9
  ## Installation
8
10
 
@@ -15,7 +17,7 @@ brew install cbc
15
17
  And for Ubuntu, use:
16
18
 
17
19
  ```sh
18
- sudo apt-get install coinor-libcbc3
20
+ sudo apt-get install coinor-libcbc3.1 # or coinor-libcbc3
19
21
  ```
20
22
 
21
23
  Then add this line to your application’s Gemfile:
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.2.0"
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,11 +16,16 @@ 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
26
+ # coinor-libcbc3.1 has libCbcSolver.so.3.1
22
27
  # coinor-libcbc3 has libCbcSolver.so.3
23
- ["libCbcSolver.so", "libCbcSolver.so.3"]
28
+ ["libCbcSolver.so", "libCbcSolver.so.3.1", "libCbcSolver.so.3"]
24
29
  end
25
30
  self.ffi_lib = lib_name
26
31
 
metadata CHANGED
@@ -1,15 +1,29 @@
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.2.0
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
12
- dependencies: []
11
+ date: 2024-10-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: fiddle
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  description:
14
28
  email: andrew@ankane.org
15
29
  executables: []
@@ -35,14 +49,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
35
49
  requirements:
36
50
  - - ">="
37
51
  - !ruby/object:Gem::Version
38
- version: '2.7'
52
+ version: '3.1'
39
53
  required_rubygems_version: !ruby/object:Gem::Requirement
40
54
  requirements:
41
55
  - - ">="
42
56
  - !ruby/object:Gem::Version
43
57
  version: '0'
44
58
  requirements: []
45
- rubygems_version: 3.3.7
59
+ rubygems_version: 3.5.16
46
60
  signing_key:
47
61
  specification_version: 4
48
62
  summary: Mixed-integer programming for Ruby