Skip to content

Commit 49c130e

Browse files
committed
Refactor format-all--ruby-gem-bundled-p
1 parent d94248c commit 49c130e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

format-all.el

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -525,12 +525,13 @@ need to be shell-quoted."
525525
526526
Returns t if GEM-NAME is listed in the current project's
527527
Gemfile.lock, nil otherwise."
528-
(let* ((lockfile "Gemfile.lock")
529-
(file (buffer-file-name))
530-
(dir (and file (locate-dominating-file file lockfile))))
531-
(and dir
528+
(let* ((file (buffer-file-name))
529+
(lockfile "Gemfile.lock")
530+
(lockdir (and file (locate-dominating-file file lockfile)))
531+
(lockfile (and lockdir (expand-file-name lockfile lockdir))))
532+
(and lockfile
532533
(with-temp-buffer
533-
(insert-file-contents (expand-file-name lockfile dir))
534+
(insert-file-contents lockfile)
534535
(re-search-forward (format "^ %s " (regexp-quote gem-name))
535536
nil t))
536537
t)))

0 commit comments

Comments
 (0)