Skip to content

Commit

Permalink
* Added support for rakefile_name, so you can have a semantically-n…
Browse files Browse the repository at this point in the history
…amed Rakefile ('Rakefile.rb' instead of 'Rakefile')

* Added support for `retain_gemspec`, mostly for GitHub-hosted projects
  • Loading branch information
ELLIOTTCABLE committed Oct 14, 2008
1 parent f6e0e74 commit dad4170
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .gitignore
@@ -1 +1 @@
pkg
pkg/
1 change: 1 addition & 0 deletions Manifest
@@ -1,4 +1,5 @@
CHANGELOG
echoe.gemspec
lib/echoe/client.rb
lib/echoe/extensions.rb
lib/echoe/platform.rb
Expand Down
1 change: 1 addition & 0 deletions Rakefile
Expand Up @@ -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

14 changes: 8 additions & 6 deletions 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<rake>, [">= 0"])
s.add_runtime_dependency(%q<rubyforge>, [">= 1.0.0"])
s.add_runtime_dependency(%q<highline>, [">= 0"])
Expand Down
12 changes: 7 additions & 5 deletions lib/echoe.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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?
Expand All @@ -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"
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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!

Expand Down

0 comments on commit dad4170

Please sign in to comment.