Permalink
Browse files

gemspecと、gemspecを生成するタスクを追加

  • Loading branch information...
1 parent 320286c commit 7050dd5f9aa25386134e6d9ecb89887133999857 @nayutaya committed Mar 8, 2010
Showing with 97 additions and 0 deletions.
  1. +20 −0 Rakefile
  2. +44 −0 nayutaya-msgpack-pure.gemspec
  3. +33 −0 nayutaya-msgpack-pure.gemspec.erb
View
20 Rakefile
@@ -2,6 +2,8 @@
require "rake/testtask"
require "lib/msgpack_pure/version"
+NAME = "nayutaya-msgpack-pure"
+
task :default => :test
Rake::TestTask.new do |test|
@@ -25,3 +27,21 @@ task :version do
file.puts(%|end|)
}
end
+
+desc "generate gemspec"
+task :gemspec do
+ require "erb"
+
+ src = File.open("#{NAME}.gemspec.erb", "rb") { |file| file.read }
+ erb = ERB.new(src, nil, "-")
+
+ version = MessagePackPure::VERSION
+ date = Time.now.strftime("%Y-%m-%d")
+
+ files = Dir.glob("**/*").select { |s| File.file?(s) }.reject { |s| /\.gem\z/ =~ s }
+ test_files = Dir.glob("test/**").select { |s| File.file?(s) }
+
+ File.open("#{NAME}.gemspec", "wb") { |file|
+ file.write(erb.result(binding))
+ }
+end
View
44 nayutaya-msgpack-pure.gemspec
@@ -0,0 +1,44 @@
+
+Gem::Specification.new do |s|
+ s.specification_version = 2
+ s.required_rubygems_version = Gem::Requirement.new(">= 0")
+ s.required_ruby_version = Gem::Requirement.new(">= 1.8.6")
+
+ s.name = "nayutaya-msgpack-pure"
+ s.version = "0.0.0"
+ s.date = "2010-03-08"
+
+ s.authors = ["Yuya Kato"]
+ s.email = "yuyakato@gmail.com"
+
+ s.summary = "MessagePack"
+ s.description = "pure ruby implementation of MessagePack"
+ s.homepage = "http://github.com/nayutaya/msgpack-pure/"
+
+ s.rubyforge_project = nil
+ s.has_rdoc = false
+ s.require_paths = ["lib"]
+
+ s.files = [
+ "lib/msgpack_pure/core.rb",
+ "lib/msgpack_pure/packer.rb",
+ "lib/msgpack_pure/unpacker.rb",
+ "lib/msgpack_pure/version.rb",
+ "lib/msgpack_pure.rb",
+ "nayutaya-msgpack-pure.gemspec",
+ "nayutaya-msgpack-pure.gemspec.erb",
+ "Rakefile",
+ "README.md",
+ "test/core_test.rb",
+ "test/packer_test.rb",
+ "test/test_helper.rb",
+ "test/unpacker_test.rb",
+ ]
+ s.test_files = [
+ "test/core_test.rb",
+ "test/packer_test.rb",
+ "test/test_helper.rb",
+ "test/unpacker_test.rb",
+ ]
+ s.extra_rdoc_files = []
+end
View
33 nayutaya-msgpack-pure.gemspec.erb
@@ -0,0 +1,33 @@
+
+Gem::Specification.new do |s|
+ s.specification_version = 2
+ s.required_rubygems_version = Gem::Requirement.new(">= 0")
+ s.required_ruby_version = Gem::Requirement.new(">= 1.8.6")
+
+ s.name = <%= NAME.dump %>
+ s.version = <%= version.dump %>
+ s.date = <%= date.dump %>
+
+ s.authors = ["Yuya Kato"]
+ s.email = "yuyakato@gmail.com"
+
+ s.summary = "MessagePack"
+ s.description = "pure ruby implementation of MessagePack"
+ s.homepage = "http://github.com/nayutaya/msgpack-pure/"
+
+ s.rubyforge_project = nil
+ s.has_rdoc = false
+ s.require_paths = ["lib"]
+
+ s.files = [
+<%- files.each { |path| -%>
+ <%= path.dump %>,
+<%- } -%>
+ ]
+ s.test_files = [
+<%- test_files.each { |path| -%>
+ <%= path.dump %>,
+<%- } -%>
+ ]
+ s.extra_rdoc_files = []
+end

0 comments on commit 7050dd5

Please sign in to comment.