diff --git a/.ruby-version b/.ruby-version index 5859406..197c4d5 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.2.3 +2.4.0 diff --git a/Gemfile.lock b/Gemfile.lock index d3e4ec7..4288092 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -4,7 +4,7 @@ GEM mini_portile2 (2.1.0) nokogiri (1.7.0.1) mini_portile2 (~> 2.1.0) - power_assert (0.4.1) + power_assert (1.0.1) rake (12.0.0) test-unit (3.2.3) power_assert @@ -18,4 +18,4 @@ DEPENDENCIES test-unit BUNDLED WITH - 1.13.6 + 1.14.3 diff --git a/circle.yml b/circle.yml index 9b3148a..30cc426 100644 --- a/circle.yml +++ b/circle.yml @@ -1,3 +1,15 @@ +machine: + environment: + LD_LIBRARY_PATH: /usr/local/lib + RAMS_TEST_CBC: true + RAMS_TEST_CLP: true + RAMS_TEST_GLPK: true + RAMS_TEST_SCIP: true + + ruby: + version: + 2.4.0 + dependencies: cache_directories: - glpk-4.60 @@ -16,4 +28,4 @@ dependencies: test: post: - - LD_LIBRARY_PATH=/usr/local/lib bundle exec rake test + - bundle exec rake test diff --git a/lib/rams/numeric.rb b/lib/rams/numeric.rb index c3da023..0d4d2d9 100644 --- a/lib/rams/numeric.rb +++ b/lib/rams/numeric.rb @@ -1,9 +1,9 @@ -# Fixnums can be added to expressions or variables or multiplied +# Integer can be added to expressions or variables or multiplied # by them to create expressions: # # 4 - (3 * x) # y / 2 -class Fixnum +class Integer alias old_add + alias old_sub - alias old_multiply * diff --git a/rams.gemspec b/rams.gemspec index 3bf87dd..14691f0 100644 --- a/rams.gemspec +++ b/rams.gemspec @@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) Gem::Specification.new do |spec| spec.name = 'rams' - spec.version = '0.1.5' + spec.version = '0.1.6' spec.authors = ["Ryan J. O'Neil"] spec.email = ['ryanjoneil@gmail.com'] spec.summary = 'Ruby Algebraic Modeling System' @@ -14,4 +14,6 @@ Gem::Specification.new do |spec| spec.files = Dir['lib/**/*'] spec.require_paths = ['lib'] + + spec.required_ruby_version = '>= 2.4.0' end diff --git a/tests/test_model.rb b/tests/test_model.rb index 3ac4d05..68afc78 100644 --- a/tests/test_model.rb +++ b/tests/test_model.rb @@ -5,48 +5,48 @@ # rubocop:disable ClassLength class TestModel < Test::Unit::TestCase def test_simple - run_test_simple :cbc - run_test_simple :clp + run_test_simple :cbc if ENV['RAMS_TEST_CBC'] + run_test_simple :clp if ENV['RAMS_TEST_CLP'] run_test_simple :cplex if ENV['RAMS_TEST_CPLEX'] - run_test_simple :glpk - run_test_simple(:scip, ['-c', 'set presolving maxrounds 0']) + run_test_simple :glpk if ENV['RAMS_TEST_GLPK'] + run_test_simple(:scip, ['-c', 'set presolving maxrounds 0']) if ENV['RAMS_TEST_SCIP'] end def test_binary - run_test_binary :cbc + run_test_binary :cbc if ENV['RAMS_TEST_CBC'] run_test_binary :cplex if ENV['RAMS_TEST_CPLEX'] - run_test_binary :glpk - run_test_binary :scip + run_test_binary :glpk if ENV['RAMS_TEST_GLPK'] + run_test_binary :scip if ENV['RAMS_TEST_SCIP'] end def test_integer - run_test_integer :cbc + run_test_integer :cbc if ENV['RAMS_TEST_CBC'] run_test_integer :cplex if ENV['RAMS_TEST_CPLEX'] - run_test_integer :glpk - run_test_integer :scip + run_test_integer :glpk if ENV['RAMS_TEST_GLPK'] + run_test_integer :scip if ENV['RAMS_TEST_SCIP'] end def test_infeasible - run_test_infeasible :cbc - run_test_infeasible :clp + run_test_infeasible :cbc if ENV['RAMS_TEST_CBC'] + run_test_infeasible :clp if ENV['RAMS_TEST_CLP'] run_test_infeasible :cplex if ENV['RAMS_TEST_CPLEX'] - run_test_infeasible :glpk - run_test_infeasible :scip + run_test_infeasible :glpk if ENV['RAMS_TEST_GLPK'] + run_test_infeasible :scip if ENV['RAMS_TEST_SCIP'] end def test_unbounded - run_test_unbounded :cbc - run_test_unbounded :clp + run_test_unbounded :cbc if ENV['RAMS_TEST_CBC'] + run_test_unbounded :clp if ENV['RAMS_TEST_CLP'] run_test_unbounded :cplex if ENV['RAMS_TEST_CPLEX'] - run_test_unbounded :glpk - run_test_unbounded :scip + run_test_unbounded :glpk if ENV['RAMS_TEST_GLPK'] + run_test_unbounded :scip if ENV['RAMS_TEST_SCIP'] end def test_implication - run_test_implication :cbc + run_test_implication :cbc if ENV['RAMS_TEST_CBC'] run_test_implication :cplex if ENV['RAMS_TEST_CPLEX'] - run_test_implication :glpk - run_test_implication :scip + run_test_implication :glpk if ENV['RAMS_TEST_GLPK'] + run_test_implication :scip if ENV['RAMS_TEST_SCIP'] end # rubocop:disable MethodLength