trying to get gemspec building on github

This commit is contained in:
Matt Lyon 2009-01-12 23:46:21 -08:00 committed by Chris Anderson
parent 4c6d12fb6a
commit cceb5814a6
2 changed files with 85 additions and 118 deletions

View file

@ -1,10 +1,19 @@
require 'rake' require 'rake'
require "rake/rdoctask" require "rake/rdoctask"
require 'spec/rake/spectask'
require 'rake/gempackagetask' require 'rake/gempackagetask'
require File.join(File.expand_path(File.dirname(__FILE__)),'lib','couchrest') require File.join(File.expand_path(File.dirname(__FILE__)),'lib','couchrest')
begin
require 'spec/rake/spectask'
rescue LoadError
puts <<-EOS
To use rspec for testing you must install rspec gem:
gem install rspec
EOS
exit(0)
end
spec = Gem::Specification.new do |s| spec = Gem::Specification.new do |s|
s.name = "couchrest" s.name = "couchrest"
s.version = CouchRest::VERSION s.version = CouchRest::VERSION
@ -28,42 +37,49 @@ spec = Gem::Specification.new do |s|
s.add_dependency("extlib", ">= 0.9.6") s.add_dependency("extlib", ">= 0.9.6")
end end
::Rake::GemPackageTask.new(spec) { |p| p.gem_spec = spec }
desc "Update Github Gemspec" desc "create .gemspec file (useful for github)"
task :gemspec do task :gemspec do
skip_fields = %w(new_platform original_platform) filename = "#{spec.name}.gemspec"
integer_fields = %w(specification_version) File.open(filename, "w") do |f|
f.puts spec.to_ruby
result = "Gem::Specification.new do |s|\n"
spec.instance_variables.each do |ivar|
value = spec.instance_variable_get(ivar)
name = ivar.split("@").last
next if skip_fields.include?(name) || value.nil? || value == "" || (value.respond_to?(:empty?) && value.empty?)
if name == "dependencies"
value.each do |d|
dep, *ver = d.to_s.split(" ")
result << " s.add_dependency #{dep.inspect}, [#{ /\(([^\,]*)/ . match(ver.join(" "))[1].inspect}]\n"
end end
else
case value
when Array
value = name != "files" ? value.inspect : value.inspect.split(",").join(",\n")
when Fixnum
# leave as-is
when String
value = value.to_i if integer_fields.include?(name)
value = value.inspect
else
value = value.to_s.inspect
end
result << " s.#{name} = #{value}\n"
end
end
result << "end"
File.open(File.join(File.dirname(__FILE__), "#{spec.name}.gemspec"), "w"){|f| f << result}
end end
# desc "Update Github Gemspec"
# task :gemspec do
# skip_fields = %w(new_platform original_platform)
# integer_fields = %w(specification_version)
#
# result = "Gem::Specification.new do |s|\n"
# spec.instance_variables.each do |ivar|
# value = spec.instance_variable_get(ivar)
# name = ivar.split("@").last
# next if skip_fields.include?(name) || value.nil? || value == "" || (value.respond_to?(:empty?) && value.empty?)
# if name == "dependencies"
# value.each do |d|
# dep, *ver = d.to_s.split(" ")
# result << " s.add_dependency #{dep.inspect}, [#{ /\(([^\,]*)/ . match(ver.join(" "))[1].inspect}]\n"
# end
# else
# case value
# when Array
# value = name != "files" ? value.inspect : value.inspect.split(",").join(",\n")
# when Fixnum
# # leave as-is
# when String
# value = value.to_i if integer_fields.include?(name)
# value = value.inspect
# else
# value = value.to_s.inspect
# end
# result << " s.#{name} = #{value}\n"
# end
# end
# result << "end"
# File.open(File.join(File.dirname(__FILE__), "#{spec.name}.gemspec"), "w"){|f| f << result}
# end
desc "Run all specs" desc "Run all specs"
Spec::Rake::SpecTask.new('spec') do |t| Spec::Rake::SpecTask.new('spec') do |t|
t.spec_files = FileList['spec/**/*_spec.rb'] t.spec_files = FileList['spec/**/*_spec.rb']

View file

@ -1,88 +1,39 @@
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s| Gem::Specification.new do |s|
s.extra_rdoc_files = ["README.md", "LICENSE", "THANKS.md"] s.name = %q{couchrest}
s.date = "Sat Nov 22 00:00:00 -0800 2008" s.version = "0.9.12"
s.executables = ["couchdir"]
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["J. Chris Anderson"] s.authors = ["J. Chris Anderson"]
s.required_rubygems_version = ">= 0" s.date = %q{2008-10-14}
s.version = "0.12.1" s.description = %q{CouchRest provides a simple interface on top of CouchDB's RESTful HTTP API, as well as including some utility scripts for managing views and attachments.}
s.files = ["LICENSE", s.email = %q{jchris@grabb.it}
"README.md", s.executables = ["couchview", "couchdir", "couchapp"]
"Rakefile", s.extra_rdoc_files = ["README.rdoc", "LICENSE", "THANKS"]
"THANKS.md", s.files = ["LICENSE", "README.rdoc", "Rakefile", "THANKS", "bin/couchapp", "bin/couchdir", "bin/couchview", "examples/model", "examples/model/example.rb", "examples/word_count", "examples/word_count/markov", "examples/word_count/views", "examples/word_count/views/books", "examples/word_count/views/books/chunked-map.js", "examples/word_count/views/books/united-map.js", "examples/word_count/views/markov", "examples/word_count/views/markov/chain-map.js", "examples/word_count/views/markov/chain-reduce.js", "examples/word_count/views/word_count", "examples/word_count/views/word_count/count-map.js", "examples/word_count/views/word_count/count-reduce.js", "examples/word_count/word_count.rb", "examples/word_count/word_count_query.rb", "lib/couchrest", "lib/couchrest/commands", "lib/couchrest/commands/generate.rb", "lib/couchrest/commands/push.rb", "lib/couchrest/core", "lib/couchrest/core/database.rb", "lib/couchrest/core/model.rb", "lib/couchrest/core/server.rb", "lib/couchrest/helper", "lib/couchrest/helper/file_manager.rb", "lib/couchrest/helper/pager.rb", "lib/couchrest/helper/streamer.rb", "lib/couchrest/helper/templates", "lib/couchrest/helper/templates/example-map.js", "lib/couchrest/helper/templates/example-reduce.js", "lib/couchrest/helper/templates/index.html", "lib/couchrest/monkeypatches.rb", "lib/couchrest.rb", "spec/couchapp_spec.rb", "spec/couchrest", "spec/couchrest/core", "spec/couchrest/core/couchrest_spec.rb", "spec/couchrest/core/database_spec.rb", "spec/couchrest/core/model_spec.rb", "spec/couchrest/helpers", "spec/couchrest/helpers/file_manager_spec.rb", "spec/couchrest/helpers/pager_spec.rb", "spec/couchrest/helpers/streamer_spec.rb", "spec/fixtures", "spec/fixtures/attachments", "spec/fixtures/attachments/couchdb.png", "spec/fixtures/attachments/test.html", "spec/fixtures/couchapp", "spec/fixtures/couchapp/attachments", "spec/fixtures/couchapp/attachments/index.html", "spec/fixtures/couchapp/views", "spec/fixtures/couchapp/views/example-map.js", "spec/fixtures/couchapp/views/example-reduce.js", "spec/fixtures/couchapp-test", "spec/fixtures/couchapp-test/my-app", "spec/fixtures/couchapp-test/my-app/attachments", "spec/fixtures/couchapp-test/my-app/attachments/index.html", "spec/fixtures/couchapp-test/my-app/views", "spec/fixtures/couchapp-test/my-app/views/example-map.js", "spec/fixtures/couchapp-test/my-app/views/example-reduce.js", "spec/fixtures/views", "spec/fixtures/views/lib.js", "spec/fixtures/views/test_view", "spec/fixtures/views/test_view/lib.js", "spec/fixtures/views/test_view/only-map.js", "spec/fixtures/views/test_view/test-map.js", "spec/fixtures/views/test_view/test-reduce.js", "spec/spec.opts", "spec/spec_helper.rb", "utils/remap.rb", "utils/subset.rb"]
"bin/couchdir", s.has_rdoc = true
"examples/model", s.homepage = %q{http://github.com/jchris/couchrest}
"examples/model/example.rb",
"examples/word_count",
"examples/word_count/markov",
"examples/word_count/views",
"examples/word_count/views/books",
"examples/word_count/views/books/chunked-map.js",
"examples/word_count/views/books/united-map.js",
"examples/word_count/views/markov",
"examples/word_count/views/markov/chain-map.js",
"examples/word_count/views/markov/chain-reduce.js",
"examples/word_count/views/word_count",
"examples/word_count/views/word_count/count-map.js",
"examples/word_count/views/word_count/count-reduce.js",
"examples/word_count/word_count.rb",
"examples/word_count/word_count_query.rb",
"lib/couchrest",
"lib/couchrest/commands",
"lib/couchrest/commands/generate.rb",
"lib/couchrest/commands/push.rb",
"lib/couchrest/core",
"lib/couchrest/core/database.rb",
"lib/couchrest/core/design.rb",
"lib/couchrest/core/document.rb",
"lib/couchrest/core/model.rb",
"lib/couchrest/core/server.rb",
"lib/couchrest/core/view.rb",
"lib/couchrest/helper",
"lib/couchrest/helper/pager.rb",
"lib/couchrest/helper/streamer.rb",
"lib/couchrest/monkeypatches.rb",
"lib/couchrest.rb",
"spec/couchrest",
"spec/couchrest/core",
"spec/couchrest/core/couchrest_spec.rb",
"spec/couchrest/core/database_spec.rb",
"spec/couchrest/core/design_spec.rb",
"spec/couchrest/core/document_spec.rb",
"spec/couchrest/core/model_spec.rb",
"spec/couchrest/helpers",
"spec/couchrest/helpers/pager_spec.rb",
"spec/couchrest/helpers/streamer_spec.rb",
"spec/fixtures",
"spec/fixtures/attachments",
"spec/fixtures/attachments/couchdb.png",
"spec/fixtures/attachments/README",
"spec/fixtures/attachments/test.html",
"spec/fixtures/views",
"spec/fixtures/views/lib.js",
"spec/fixtures/views/test_view",
"spec/fixtures/views/test_view/lib.js",
"spec/fixtures/views/test_view/only-map.js",
"spec/fixtures/views/test_view/test-map.js",
"spec/fixtures/views/test_view/test-reduce.js",
"spec/spec.opts",
"spec/spec_helper.rb",
"utils/remap.rb",
"utils/subset.rb"]
s.has_rdoc = "true"
s.specification_version = 2
s.loaded = "false"
s.email = "jchris@apache.org"
s.name = "couchrest"
s.required_ruby_version = ">= 0"
s.bindir = "bin"
s.rubygems_version = "1.2.0"
s.homepage = "http://github.com/jchris/couchrest"
s.platform = "ruby"
s.summary = "Lean and RESTful interface to CouchDB."
s.description = "CouchRest provides a simple interface on top of CouchDB's RESTful HTTP API, as well as including some utility scripts for managing views and attachments."
s.add_dependency "json", [">= 1.1.2"]
s.add_dependency "rest-client", [">= 0.5"]
s.add_dependency "mime-types", [">= 1.15"]
s.add_dependency "extlib", [">= 0.9.6"]
s.require_paths = ["lib"] s.require_paths = ["lib"]
s.rubygems_version = %q{1.3.1}
s.summary = %q{Lean and RESTful interface to CouchDB.}
if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 2
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<json>, [">= 1.1.2"])
s.add_runtime_dependency(%q<rest-client>, [">= 0.5"])
s.add_runtime_dependency(%q<extlib>, [">= 0.9.6"])
else
s.add_dependency(%q<json>, [">= 1.1.2"])
s.add_dependency(%q<rest-client>, [">= 0.5"])
s.add_dependency(%q<extlib>, [">= 0.9.6"])
end
else
s.add_dependency(%q<json>, [">= 1.1.2"])
s.add_dependency(%q<rest-client>, [">= 0.5"])
s.add_dependency(%q<extlib>, [">= 0.9.6"])
end
end end