From f3794fe3e9564deaa08fc977287bb0fa65da110d Mon Sep 17 00:00:00 2001 From: "Luis M. Rodriguez-R" Date: Wed, 24 Jan 2024 14:30:50 +0100 Subject: [PATCH] Minor adjustments for large NCBI lists --- lib/miga/cli/action/download/ncbi.rb | 2 +- lib/miga/json.rb | 7 +++++++ lib/miga/project/dataset.rb | 2 +- lib/miga/version.rb | 4 ++-- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/miga/cli/action/download/ncbi.rb b/lib/miga/cli/action/download/ncbi.rb index 60c2de7..0e08e30 100644 --- a/lib/miga/cli/action/download/ncbi.rb +++ b/lib/miga/cli/action/download/ncbi.rb @@ -79,7 +79,7 @@ def remote_list if cli[:ncbi_list_json] cli.say "Saving remote list: #{cli[:ncbi_list_json]}" - MiGA::Json.generate_plain(list, cli[:ncbi_list_json]) + MiGA::Json.generate_fast(list, cli[:ncbi_list_json]) end list diff --git a/lib/miga/json.rb b/lib/miga/json.rb index a4fe9db..ee3f0e9 100644 --- a/lib/miga/json.rb +++ b/lib/miga/json.rb @@ -75,6 +75,13 @@ def generate_plain(obj, path = nil) generate_generic(:generate, obj, path) end + ## + # Generates and returns plain JSON to represent +obj+ without checking for + # circular references. If +path+ is passed, it saves the JSON in that file. + def generate_fast(obj, path = nil) + generate_generic(:fast_generate, obj, path) + end + private def generate_generic(method, obj, path) diff --git a/lib/miga/project/dataset.rb b/lib/miga/project/dataset.rb index 7465ba5..eb42e7f 100644 --- a/lib/miga/project/dataset.rb +++ b/lib/miga/project/dataset.rb @@ -26,7 +26,7 @@ def dataset_names_hash ## # Returns MiGA::Dataset def dataset(name) - name = name.miga_name + name = name.to_s.miga_name return nil unless MiGA::Dataset.exist?(self, name) @datasets ||= {} diff --git a/lib/miga/version.rb b/lib/miga/version.rb index 6cf8cd8..d842648 100644 --- a/lib/miga/version.rb +++ b/lib/miga/version.rb @@ -12,7 +12,7 @@ module MiGA # - String indicating release status: # - rc* release candidate, not released as gem # - [0-9]+ stable release, released as gem - VERSION = [1.3, 9, 5].freeze + VERSION = [1.3, 9, 6].freeze ## # Nickname for the current major.minor version. @@ -20,7 +20,7 @@ module MiGA ## # Date of the current gem relese. - VERSION_DATE = Date.new(2024, 1, 23) + VERSION_DATE = Date.new(2024, 1, 24) ## # References of MiGA