From e2c048355fa0146bb8c40055c21082b6bf4b9c90 Mon Sep 17 00:00:00 2001 From: "yuuji.yaginuma" Date: Mon, 24 Jun 2019 09:57:25 +0900 Subject: [PATCH] Revert "Merge pull request #385 from takakuda/feature/conditions_change" This reverts commit 00e14aa186917b557a6ccb2c08ea89e56f3faad1, reversing changes made to f796d366444d454e12a65cf1db81781dc0ce2c7b. Reason: The pure Ruby doesn't have `Array#present?`. So this cause `NoMethodError` when using dotenv without Rails. ``` $ dotenv -t .env Traceback (most recent call last): 3: from /bin/dotenv:23:in `
' 2: from /bin/dotenv:23:in `load' 1: from /lib/ruby/gems/2.5.0/gems/dotenv-2.7.3/bin/dotenv:4:in `' /lib/ruby/gems/2.5.0/gems/dotenv-2.7.3/lib/dotenv/cli.rb:25:in `run': undefined method `present?' for []:Array (NoMethodError) Did you mean? prepend ``` --- lib/dotenv/cli.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dotenv/cli.rb b/lib/dotenv/cli.rb index 65480809..da5c9645 100644 --- a/lib/dotenv/cli.rb +++ b/lib/dotenv/cli.rb @@ -22,7 +22,7 @@ def run rescue Errno::ENOENT => e abort e.message else - exec(*@argv) if @argv.present? + exec(*@argv) unless @argv.empty? end end