Gem 的 Rake 任务使用当前位置
在 gem 中,我使用 评估 来测试不同的 gem 依赖项。
我面临的问题是 评估 尝试运行命令:
BUNDLE_GEMFILE=gemfiles/3.0.gemfile bundle exec /Users/seb/.rvm/gems/ruby-1.8.7-p334/bin/rake spec cucumber
这会导致问题黄瓜测试,因为 aruba 的文件位于子目录 tmp/aruba
解决方案是获取 评估使用绝对路径来定位gem文件,因此运行如下所示的内容:
BUNDLE_GEMFILE=/Users/seb/Work/GitHub/rspec-subject-extensions/gemfiles/3.0.gemfile 捆绑执行 /Users/seb/.rvm/gems/ruby-1.8.7-p334/bin/rake 规格黄瓜
问题是,如何获取评估rake任务以了解当前位置?
In a gem I use Appraisal to test against different gem dependencies.
The problem I face is that Appraisal try to run the command :
BUNDLE_GEMFILE=gemfiles/3.0.gemfile bundle exec /Users/seb/.rvm/gems/ruby-1.8.7-p334/bin/rake spec cucumber
This cause an issue with the cucumber test as aruba's file are located in a subdirectory tmp/aruba
A solution would be to get Appraisal to use absolute path to locate the gemfiles and therefore run something like follow instead:
BUNDLE_GEMFILE=/Users/seb/Work/GitHub/rspec-subject-extensions/gemfiles/3.0.gemfile bundle exec /Users/seb/.rvm/gems/ruby-1.8.7-p334/bin/rake spec cucumber
Question is, how to get Appraisal rake tasks to know the current location ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Dir.pwd
似乎就是这样做的。感谢 croaky 的提示。Dir.pwd
seems to do just that. Thanks to croaky for the tip.