clp 0.1.2 → 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: 185f03fde8ab409746c146c6193e34b8beb1317991c52b869d0a9a1714227259
4
- data.tar.gz: b785a19d316b0ff5dea8647ef63d762b42a8891c9a4c5615ee7cfd252018be7a
3
+ metadata.gz: f567ce5095dfeaf41e03f7f387673e09717997dbe60753e71c9983de46bba3e2
4
+ data.tar.gz: 76fda4c37e5769a83eaf507071bd4c8138936418ea007852ee0ed51e754213ed
5
5
  SHA512:
6
- metadata.gz: 798dfc96c75bece7fcfb5581b036d78a0f82a4f7b6a904f0253b5c3d765398c5b69bb7b58d70ce9bd7d9a38d692eb24ae41c44eb71f9fabc2597703f38b7b23d
7
- data.tar.gz: 8e95103aecb6162e352cfc12be4048cca63e94cc44e463f04afdd699e8ddccaf55aecb96a2156376965369e4cdb782abdef4ff61123d41c9123c4a5140850402
6
+ metadata.gz: 16fa412cb48441e03ceb6fd0ac57acc43601256402c70d6fe2ab6137c62f018e8ac0a2c7f5cc9b61d25438fc1b8cd1e1f7ca0a2ecf6e90f3938b23f4473a6391
7
+ data.tar.gz: bf2eb8a1f45eae70542035240619347b3fa13d9c02a6839aef6e0597b4990b4ba7a6deff7132a09e4f41c44d961910afef93f8b0a1af1888d1a9bfb90923d4d8
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 0.2.0 (2024-10-22)
2
+
3
+ - Dropped support for Ruby < 3.1
4
+
5
+ ## 0.1.3 (2023-06-07)
6
+
7
+ - Improved support for Mac ARM
8
+ - Fixed error with `dup` and `clone`
9
+
1
10
  ## 0.1.2 (2022-04-14)
2
11
 
3
12
  - Added `log_level` and `time_limit` options to `solve` method
data/README.md CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
  [Clp](https://github.com/coin-or/Clp) - linear programming solver - for Ruby
4
4
 
5
- [![Build Status](https://github.com/ankane/clp-ruby/workflows/build/badge.svg?branch=master)](https://github.com/ankane/clp-ruby/actions)
5
+ Check out [Opt](https://github.com/ankane/opt) for a high-level interface
6
+
7
+ [![Build Status](https://github.com/ankane/clp-ruby/actions/workflows/build.yml/badge.svg)](https://github.com/ankane/clp-ruby/actions)
6
8
 
7
9
  ## Installation
8
10
 
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.2.0"
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,15 +1,29 @@
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.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-04-14 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: Linear programming solver for Ruby