Bug: within(directory){ execute(string) } should either 'just work' or 'boom'
まだ誰も着手していません。
評価
調査の方向性
まず、既存の within と execute のエントリポイントと、それらに関するドキュメントを読み、ここで説明されている、ディレクトリが黙って無視される挙動と、失敗するディレクトリとの対比を再現してください。文字列コマンドを動作させるか、例外を発生させるか、within を削除するかという設計上の選択を解決し、選択した挙動を文書化してテストしてください。
索引モデルが issue の本文から書いたものです。
説明
docs aren't good enough to explain the design choice IMHO - just check
stackoverflow...
one solution is just to fix it - use shellwords to properly escape the command
require 'shellwords'
def execute(*args, &block)
if args.first.is_a?(String)
command = Shellwords.escape(args.first)
end
# ...
end
otherwise raise an exception
def execute(*args, &block)
if args.first.is_a?(String) and inside_within?
raise "don't do that"
end
# ...
end
the current behavior of doing
within directory do # silently ignored
execute command
end
just isn't POLS - the point of a library like cap is to be able to re-use code
but, currently, each and every use must re-invent 'cd into a (properly escaped
directory) and run commands', including handling the fact that
within(does_not_exist) do # raises
end
execute "#{ does_not_exist }; command.sh" # reports a failed exit status that leads to debugging which part failed
a final solution would be to remove the 'within' API since it sometimes works,
and sometimes does not, issuing no exception nor warning
- 主要言語
- Ruby
- スター
- 1.2k
- フォーク
- 257
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
capistrano/sshkit のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
capistrano/sshkit#563 · リアクション 6 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
capistrano/sshkit#562 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
capistrano/sshkit#554 · コメント 3 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
capistrano/sshkit#543 · コメント 2 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
capistrano/sshkit#518 · コメント 1 件 ·
capistrano/sshkit の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
simp/pupmod-simp-simp#395 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
simp/pupmod-simp-rsyslog#219 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
simp/pupmod-simp-pupmod#256 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
simp/pupmod-simp-sudo#150 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100