or-tools 0.6.0 → 0.6.1

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
  SHA256:
3
- metadata.gz: 1775ae46a18be137ae64fce870d29c17c3ae385c61f295f79d7ded40ed0be0bd
4
- data.tar.gz: 28262f8b77a8dd0dc085e16a261005a47e1352d8f9f5c148ed524c348daec8db
3
+ metadata.gz: '018061d137668676a2aca20c0ea0b1bbf01cfb19e02e0f7a532e9e4d800fb735'
4
+ data.tar.gz: 05e1f19947935d6ccf13c551cbf24cccd4fe3aa989d9bbbb31612c15837eb837
5
5
  SHA512:
6
- metadata.gz: 771d9a78ace00ce16d8f5e71f595a4523fd8613c81b8e09691d231cb1e7881ce94e8cdd0e21dd60168a58d40e0135891988cfc47fac33d511b551cf932819bae
7
- data.tar.gz: 5231109d9afb080481f608bd784b3e86cdfc0b336f828d9fad714b5fa37eda0c4f02495e3718eeb9b0c05135b5b344a7084df55c7f26674ef2e73653ad7d8a3d
6
+ metadata.gz: 4c32d4c6171f9c67011c4be7ec730583b1ea81cff00ab4ef865185b42fc5b0b7f843305e8bad31bcf22ad054fc0f7813e4d2ef84d0416bf42612c91800df699d
7
+ data.tar.gz: e13cb7b42a02d010f733e7f1b12d36fc79abf1718c3a8064b5d2d97d63b93f6e80c73f54743d6a290856d014c5f6a1141328e671c78fc9679a543fcc178ee2d5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.6.1 (2022-01-22)
2
+
3
+ - Added installation instructions for Mac ARM
4
+ - Removed dependency on `lsb_release` for binary installation on Linux
5
+
1
6
  ## 0.6.0 (2021-12-16)
2
7
 
3
8
  - Updated OR-Tools to 9.2
data/README.md CHANGED
@@ -12,7 +12,7 @@ Add this line to your application’s Gemfile:
12
12
  gem 'or-tools'
13
13
  ```
14
14
 
15
- Installation can take a few minutes as OR-Tools downloads and builds.
15
+ Installation can take a few minutes as OR-Tools downloads and builds. For Mac ARM, also follow [these instructions](#additional-instructions).
16
16
 
17
17
  ## Higher Level Interfaces
18
18
 
@@ -2201,6 +2201,17 @@ possible_tables.each do |table|
2201
2201
  end
2202
2202
  ```
2203
2203
 
2204
+ ## Additional Instructions
2205
+
2206
+ ### Mac ARM
2207
+
2208
+ ARM binaries are not available for Mac yet, so use Homebrew to install OR-Tools before installing the gem.
2209
+
2210
+ ```sh
2211
+ brew install or-tools
2212
+ bundle config build.or-tools --with-or-tools-dir=/opt/homebrew
2213
+ ```
2214
+
2204
2215
  ## History
2205
2216
 
2206
2217
  View the [changelog](https://github.com/ankane/or-tools-ruby/blob/master/CHANGELOG.md)
@@ -1,3 +1,4 @@
1
+ require "csv"
1
2
  require "digest"
2
3
  require "fileutils"
3
4
  require "net/http"
@@ -6,27 +7,46 @@ require "tmpdir"
6
7
  version = "9.2.9972"
7
8
 
8
9
  if RbConfig::CONFIG["host_os"] =~ /darwin/i
9
- filename = "or-tools_MacOsX-12.0.1_v#{version}.tar.gz"
10
- checksum = "796791a8ef84507d62e193e647cccb1c7725dae4f1474476e1777fe4a44ee3e0"
10
+ if RbConfig::CONFIG["host_cpu"] =~ /arm|aarch64/i
11
+ raise <<~MSG
12
+ Binary installation not available for this platform: Mac ARM
13
+
14
+ Run:
15
+ brew install or-tools
16
+ bundle config build.or-tools --with-or-tools-dir=/opt/homebrew
17
+
18
+ MSG
19
+ else
20
+ filename = "or-tools_MacOsX-12.0.1_v#{version}.tar.gz"
21
+ checksum = "796791a8ef84507d62e193e647cccb1c7725dae4f1474476e1777fe4a44ee3e0"
22
+ end
11
23
  else
12
- os = %x[lsb_release -is].chomp rescue nil
13
- os_version = %x[lsb_release -rs].chomp rescue nil
14
- if os == "Ubuntu" && os_version == "20.04"
24
+ # try /etc/os-release with fallback to /usr/lib/os-release
25
+ # https://www.freedesktop.org/software/systemd/man/os-release.html
26
+ os_filename = File.exist?("/etc/os-release") ? "/etc/os-release" : "/usr/lib/os-release"
27
+
28
+ # for safety, parse rather than source
29
+ os_info = CSV.read(os_filename, col_sep: "=").to_h rescue {}
30
+
31
+ os = os_info["ID"]
32
+ os_version = os_info["VERSION_ID"]
33
+
34
+ if os == "ubuntu" && os_version == "20.04"
15
35
  filename = "or-tools_amd64_ubuntu-20.04_v#{version}.tar.gz"
16
36
  checksum = "985e3036eaecacfc8a0258ec2ebef429240491577d4e0896d68fc076e65451ec"
17
- elsif os == "Ubuntu" && os_version == "18.04"
37
+ elsif os == "ubuntu" && os_version == "18.04"
18
38
  filename = "or-tools_amd64_ubuntu-18.04_v#{version}.tar.gz"
19
39
  checksum = "e36406c4fe8c111e1ace0ede9d0787ff0e98f11afd7db9cc074adfd0f55628a6"
20
- elsif os == "Debian" && os_version == "11"
40
+ elsif os == "debian" && os_version == "11"
21
41
  filename = "or-tools_amd64_debian-11_v#{version}.tar.gz"
22
42
  checksum = "bd49ee916213b2140ab255414d35a28f19dff7caf87632309753d3fc553f85dd"
23
- elsif os == "Debian" && os_version == "10"
43
+ elsif os == "debian" && os_version == "10"
24
44
  filename = "or-tools_amd64_debian-10_v#{version}.tar.gz"
25
45
  checksum = "b152fee584f0c8228fe2ff21b74c789870ff9b7064e42ca26305c6b5653f0064"
26
- elsif os == "CentOS" && os_version == "8"
46
+ elsif os == "centos" && os_version == "8"
27
47
  filename = "or-tools_amd64_centos-8_v#{version}.tar.gz"
28
48
  checksum = "66ed4bb800acf92c672f7e68acdf4ea27bbfdb17bbddc02f8326cd55a97305f6"
29
- elsif os == "CentOS" && os_version == "7"
49
+ elsif os == "centos" && os_version == "7"
30
50
  filename = "or-tools_amd64_centos-7_v#{version}.tar.gz"
31
51
  checksum = "4a5c1b1639a2828cd7e1ba82a574ef37876557b59e8aab8b81811bb750d53035"
32
52
  else
@@ -1,3 +1,3 @@
1
1
  module ORTools
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: or-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-17 00:00:00.000000000 Z
11
+ date: 2022-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rice
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  requirements: []
90
- rubygems_version: 3.2.32
90
+ rubygems_version: 3.3.3
91
91
  signing_key:
92
92
  specification_version: 4
93
93
  summary: Operations research tools for Ruby