Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のコードが空の配列を返す理由を誰かが知っていますか?ありがとう。
groovyc_deps = Buildr::Groovy::Groovyc.dependencies groovy_jar = groovyc_deps.grep /.*groovy.*\.jar/ p groovy_jar # => []
Groovyc.dependencies文字列ではなく、の配列を返すためArtifactです。
Groovyc.dependencies
Artifact
次のことを試してください、
groovyc_deps = Buildr::Groovy::Groovyc.dependencies groovy_jar = groovyc_deps.select { |a| a.to_s =~ /.*groovy.*\.jar/ }
これは、正規表現と照合する前にアーティファクトを文字列に変換します。