require 'rake'
spec.files = FileList['lib/**/*.rb',
'bin/*',
'[A-Z]*',
'test/**/*'].to_a
spec.files = Dir['lib/**/*.rb'] + Dir['bin/*']
spec.files += Dir['[A-Z]*'] + Dir['test/**/*']
spec.files.reject! { |fn| fn.include? "CVS" }
比如我的 gem
# -*- encoding: utf-8 -*-
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'mdpreview/version'
require 'rake'
Gem::Specification.new do |gem|
gem.name = "mdpreview"
gem.version = Mdpreview::VERSION
gem.authors = ["i5ting"]
gem.email = ["[email protected]"]
gem.description = %q{dsdfn}
gem.summary = %q{dsfsdf}
gem.homepage = ""
gem.files = FileList['lib/**/*.rb',
'bin/*',
'vendor/**/**/**',
'test/**/*'].to_a
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.require_paths = ["lib"]
end
这里我的资源 vendor///,有 4 级的目录,所以要用这样的写法