From 4f8c8e0eb4953dabdf15cea41a63330eae27a387 Mon Sep 17 00:00:00 2001 From: Danny Ben Shitrit Date: Thu, 26 Jan 2023 05:40:10 +0000 Subject: [PATCH] - Allow import_gem to have no path and import all --- lib/runfile/concerns/dsl.rb | 1 + spec/integration/{import-gem-error => import-gem-all}/runfile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) rename spec/integration/{import-gem-error => import-gem-all}/runfile (68%) diff --git a/lib/runfile/concerns/dsl.rb b/lib/runfile/concerns/dsl.rb index e0eda09..1add96e 100644 --- a/lib/runfile/concerns/dsl.rb +++ b/lib/runfile/concerns/dsl.rb @@ -33,6 +33,7 @@ def import(pathspec, context = nil) def import_gem(pathspec, context = nil) gem_name, glob = pathspec.split('/', 2) + glob ||= '*' path = GemFinder.find gem_name, glob imports[path] = context end diff --git a/spec/integration/import-gem-error/runfile b/spec/integration/import-gem-all/runfile similarity index 68% rename from spec/integration/import-gem-error/runfile rename to spec/integration/import-gem-all/runfile index 211ffd9..e3be115 100644 --- a/spec/integration/import-gem-error/runfile +++ b/spec/integration/import-gem-all/runfile @@ -1,7 +1,7 @@ title 'The New Runfile' summary 'Testing the new Runfile' -import_gem 'sample_import_gem', 'docker', "error here, must be a hash" +import_gem 'sample_import_gem', image_name: 'my/image' usage "say MESSAGE" action 'say' do |args|