From dad417013859b57077a7d66bc9ed2da4bfc2dc37 Mon Sep 17 00:00:00 2001 From: elliottcable Date: Mon, 13 Oct 2008 22:45:49 -0800 Subject: [PATCH] * Added support for `rakefile_name`, so you can have a semantically-named Rakefile ('Rakefile.rb' instead of 'Rakefile') * Added support for `retain_gemspec`, mostly for GitHub-hosted projects --- .gitignore | 2 +- Manifest | 1 + Rakefile | 1 + echoe.gemspec | 14 ++++++++------ lib/echoe.rb | 12 +++++++----- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 5fff1d9..b2bcbe8 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -pkg +pkg/ \ No newline at end of file diff --git a/Manifest b/Manifest index f932f70..d87aaa4 100644 --- a/Manifest +++ b/Manifest @@ -1,4 +1,5 @@ CHANGELOG +echoe.gemspec lib/echoe/client.rb lib/echoe/extensions.rb lib/echoe/platform.rb diff --git a/Rakefile b/Rakefile index 51c5480..37118a6 100644 --- a/Rakefile +++ b/Rakefile @@ -10,5 +10,6 @@ Echoe.new('echoe') do |p| p.runtime_dependencies = ['rake', 'rubyforge >=1.0.0', 'highline'] p.development_dependencies = [] p.require_signed = false + p.retain_gemspec = true end diff --git a/echoe.gemspec b/echoe.gemspec index 6ebe6e4..7fb0be4 100644 --- a/echoe.gemspec +++ b/echoe.gemspec @@ -1,27 +1,29 @@ +# -*- encoding: utf-8 -*- + Gem::Specification.new do |s| s.name = %q{echoe} - s.version = "3" + s.version = "3.0.1" - s.required_rubygems_version = Gem::Requirement.new("= 1.2") if s.respond_to? :required_rubygems_version= + s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version= s.authors = ["Evan Weaver"] - s.date = %q{2008-07-04} + s.date = %q{2008-10-13} s.description = %q{A Rubygems packaging tool that provides Rake tasks for documentation, extension compiling, testing, and deployment.} s.email = %q{} s.extra_rdoc_files = ["CHANGELOG", "lib/echoe/client.rb", "lib/echoe/extensions.rb", "lib/echoe/platform.rb", "lib/echoe.rb", "LICENSE", "README", "TODO"] - s.files = ["CHANGELOG", "lib/echoe/client.rb", "lib/echoe/extensions.rb", "lib/echoe/platform.rb", "lib/echoe.rb", "LICENSE", "Manifest", "MIT-LICENSE", "Rakefile", "README", "TODO", "echoe.gemspec"] + s.files = ["CHANGELOG", "echoe.gemspec", "lib/echoe/client.rb", "lib/echoe/extensions.rb", "lib/echoe/platform.rb", "lib/echoe.rb", "LICENSE", "Manifest", "MIT-LICENSE", "Rakefile", "README", "TODO"] s.has_rdoc = true s.homepage = %q{http://blog.evanweaver.com/files/doc/fauna/echoe/} s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Echoe", "--main", "README"] s.require_paths = ["lib"] s.rubyforge_project = %q{fauna} - s.rubygems_version = %q{1.2.0} + s.rubygems_version = %q{1.3.0} s.summary = %q{A Rubygems packaging tool that provides Rake tasks for documentation, extension compiling, testing, and deployment.} if s.respond_to? :specification_version then current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION s.specification_version = 2 - if current_version >= 3 then + if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then s.add_runtime_dependency(%q, [">= 0"]) s.add_runtime_dependency(%q, [">= 1.0.0"]) s.add_runtime_dependency(%q, [">= 0"]) diff --git a/lib/echoe.rb b/lib/echoe.rb index e936204..9b2ea36 100644 --- a/lib/echoe.rb +++ b/lib/echoe.rb @@ -151,7 +151,7 @@ class Echoe attr_accessor :author, :changes, :clean_pattern, :description, :email, :runtime_dependencies, :development_dependencies, :need_tgz, :need_tar_gz, :need_gem, :need_zip, :rdoc_pattern, :project, :summary, :test_pattern, :url, :version, :docs_host, :rdoc_template, :manifest_name, :install_message, :extension_pattern, :private_key, :certificate_chain, :require_signed, :ruby_version, :platform, :ignore_pattern, :executable_pattern, :changelog, :rcov_options, :gemspec_format # best left alone - attr_accessor :name, :lib_files, :test_files, :bin_files, :spec, :rdoc_options, :rubyforge_name, :has_rdoc, :include_gemspec, :include_rakefile, :gemspec_name, :eval, :files, :changelog_patterns, :rubygems_version, :use_sudo + attr_accessor :name, :lib_files, :test_files, :bin_files, :spec, :rdoc_options, :rubyforge_name, :has_rdoc, :include_gemspec, :include_rakefile, :gemspec_name, :retain_gemspec, :rakefile_name, :eval, :files, :changelog_patterns, :rubygems_version, :use_sudo # legacy attr_accessor :extra_deps, :rdoc_files, :extensions, :dependencies @@ -214,6 +214,8 @@ def initialize(name, _version = nil) self.include_rakefile = true self.include_gemspec = true self.gemspec_name = "#{name}.gemspec" + self.retain_gemspec = false + self.rakefile_name = "Rakefile" self.rubygems_version = ">= 1.2" yield self if block_given? @@ -229,7 +231,7 @@ def initialize(name, _version = nil) begin self.files = File.read(manifest_name).split + [(gemspec_name if include_gemspec)] + - [("Rakefile" if include_rakefile)] + [(rakefile_name if include_rakefile)] self.files = files.compact.uniq rescue Errno::ENOENT unless ARGV.include? "manifest" @@ -410,7 +412,7 @@ def define_tasks system "rm pkg/*.gem" end # Remove the generated gemspec once the packaging is done, to discourage people from modifying it by hand. - if include_gemspec and File.exist? gemspec_name + if include_gemspec and File.exist? gemspec_name and not retain_gemspec File.delete gemspec_name end @@ -629,11 +631,11 @@ def pub.upload next unless file next if ignore_pattern.include?(file) next if File.directory?(file) - next if !include_rakefile and file == "Rakefile" + next if !include_rakefile and file == rakefile_name files << file end - files << "Rakefile" if include_rakefile + files << rakefile_name if include_rakefile files << manifest_name files.uniq!