Sha256: 535285569200b739d05d693dc01566eb3f0758d530244c1f24806cc053d15dc4

Contents?: true

Size: 1.83 KB

Versions: 1

Compression:

Stored size: 1.83 KB

Contents

# -*- encoding: utf-8 -*-
module DirExt
	# 根据指定的目录获取该目录下所有的文件路径(不包含隐藏文件)
	# 例如:
	# 	files_path_to_s('/home/Aaron/sample')     => 会列出sample目录下所有文件的路径
	#
	def files_path_to_s(dirname)
		path_array = files_path(dirname)
		path_array.flatten!
	end

	protected
		def files_path(dirname,path_array=[])
			files = Dir.entries(dirname)
			files.delete('.')
			files.delete('..')
			files.delete_if{|file| file =~ /^\./}
			files.each do |f|
				if File.directory?(File.join(dirname,f))
					path_array << files_path(File.join(dirname,f))
				else
					path_array << File.join(dirname,f)
				end
			end
			path_array
		end
end

Gem::Specification::Class.send :include,DirExt

Gem::Specification.new do |s|
	s.name = %{ant-mapper}
	s.version = '0.0.2'
	s.description = 'Ant是用来访问LightCloud/TokyoCabinet/TokyoTyrant的工具,实现了持久化数据与对象的映射。 它类似于ActiveRecord,提供一组访问LightCloud/TokyoCabinet/TokyoTyrant的方法以及验证规则、回调函数和观察器。'
	s.homepage = "http://www.tokyocabinet.com"
	s.rubyforge_project = %q{ant-mapper}
	s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
	s.summary = 'Ant是用来访问LightCloud/TokyoCabinet/TokyoTyrant的工具,实现了持久化数据与对象的映射。 它类似于ActiveRecord,提供一组访问LightCloud/TokyoCabinet/TokyoTyrant的方法以及验证规则、回调函数和观察器。'

	s.email = ["yalong1976@gmail.com"]
  s.authors = ["yalong zhang"]
	s.files = files_path_to_s(File.dirname(__FILE__))
  s.require_paths = ["lib"]
  s.required_ruby_version = Gem::Requirement.new(">= 1.8.6")
  s.rubygems_version = %q{1.3.4}
  s.add_dependency(%q<mitchellh-lightcloud>)
  s.add_dependency(%q<rufus-tokyo>)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ant-mapper-0.0.2 ./ant.gemspec