From cc9c01d6d4e7948056966000f5aa1d21c2a1c4ea Mon Sep 17 00:00:00 2001 From: Stefano Salvador Date: Wed, 27 Nov 2019 13:51:30 +0100 Subject: [PATCH 1/2] updating to new gem versions --- VERSION | 2 +- couchrest_model.gemspec | 10 +++++----- lib/couchrest/model/designs/view.rb | 2 ++ lib/couchrest/model/dirty.rb | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/VERSION b/VERSION index 4637f7ff..6875de75 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.2.0.beta2 +2.2.0.beta4 diff --git a/couchrest_model.gemspec b/couchrest_model.gemspec index cc5960f9..e8bf507b 100644 --- a/couchrest_model.gemspec +++ b/couchrest_model.gemspec @@ -22,15 +22,15 @@ Gem::Specification.new do |s| s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] - s.add_dependency("couchrest", "2.0.1") - s.add_dependency("activemodel", ">= 4.0.2") - s.add_dependency("tzinfo", ">= 0.3.22") - s.add_dependency("hashdiff", "~> 0.3") + s.add_runtime_dependency("couchrest", "2.0.1") + s.add_runtime_dependency("activemodel", ">= 4.0.2") + s.add_runtime_dependency("tzinfo", ">= 0.3.22") + s.add_runtime_dependency("hashdiff", ">= 1.0.0") s.add_development_dependency("rspec", "~> 3.5.0") s.add_development_dependency("rack-test", ">= 0.5.7") s.add_development_dependency("rake", ">= 0.8.0", "< 11.0") s.add_development_dependency("test-unit") s.add_development_dependency("minitest", "> 4.1") #, "< 5.0") # For Kaminari and activesupport, pending removal - s.add_development_dependency("kaminari", ">= 0.14.1", "< 0.16.0") + s.add_development_dependency("kaminari", ">= 1.1") s.add_development_dependency("mime-types", "< 3.0") # Mime-types > 3.0 don't bundle properly on JRuby end diff --git a/lib/couchrest/model/designs/view.rb b/lib/couchrest/model/designs/view.rb index 67e78893..ceeb0fe1 100644 --- a/lib/couchrest/model/designs/view.rb +++ b/lib/couchrest/model/designs/view.rb @@ -141,6 +141,8 @@ def count limit(0).total_rows end end + + alias :size :count # Check to see if the array of documents is empty. This *will* # perform the query and return all documents ready to use, if you don't diff --git a/lib/couchrest/model/dirty.rb b/lib/couchrest/model/dirty.rb index 642f2892..48b5391a 100644 --- a/lib/couchrest/model/dirty.rb +++ b/lib/couchrest/model/dirty.rb @@ -22,7 +22,7 @@ def changes if original_change_data.nil? nil else - HashDiff.diff(original_change_data, current_change_data) + Hashdiff.diff(original_change_data, current_change_data) end end From dd10c259c3022eb8c6a0757cbde64ff68337f155 Mon Sep 17 00:00:00 2001 From: Stefano Salvador Date: Thu, 9 May 2024 14:24:14 +0200 Subject: [PATCH 2/2] fixes for ruby 3.2 --- VERSION | 2 +- lib/couchrest/model/connection_config.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 6875de75..a4a8bef4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.2.0.beta4 +2.2.0.beta5 diff --git a/lib/couchrest/model/connection_config.rb b/lib/couchrest/model/connection_config.rb index f1b20d92..b64fd79b 100644 --- a/lib/couchrest/model/connection_config.rb +++ b/lib/couchrest/model/connection_config.rb @@ -19,8 +19,8 @@ def [](file) private def load_config(file) - if File.exists?(file) - YAML::load(ERB.new(IO.read(file)).result).symbolize_keys + if File.exist?(file) + YAML::load(ERB.new(IO.read(file)).result, aliases: true).symbolize_keys rescue YAML::load(ERB.new(IO.read(file)).result).symbolize_keys else { } end