ruby:gem build ...我如何在gem中包含供应商目录?

时间:2015-06-17 12:55:22

标签: ruby

我运行gem build mygem.gemspec并且不包含供应商目录。我如何将它包含在我的宝石中?我假设我需要包含供应商目录,如果我想用我的gem打包所有依赖项。

我认为这与Dir['vendor/**']有关......我知道这是错的。

我的gemspec文件:

lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'fpa/fix_filename/version'

Gem::Specification.new do |spec|
  spec.name          = "fpa-fix_filename"
  spec.version       = Fpa::FixFilename::VERSION
  spec.authors       = ["na"]
  spec.email         = ["na"]

  spec.summary       = %q{A Class to fix bad file names -- includes a binary for command line use.}
  spec.description   = %q{}
  spec.license       = "MIT"

  spec.files = Dir['lib/fpa/**/*'] + Dir['bin/*'] + Dir['vendor/**']

  spec.bindir        = "bin"
  spec.executables   = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }

  spec.require_paths = ["lib"]

  spec.add_runtime_dependency "micro-optparse", "~> 1.2.0"

  spec.add_development_dependency "bundler", "~> 1.8"
  spec.add_development_dependency "rake", "~> 10.0"
end

1 个答案:

答案 0 :(得分:0)

你尝试过这样的吗?

Dir['vendor/**/*']