Permalink
Browse files

Replace project template files with newer templates for doc publishing

  • Loading branch information...
1 parent 7787ca1 commit 8bf557ac25fb447b878e47c34ce9df03c2dba9f7 @raggi committed Jan 16, 2009
Showing with 73 additions and 127 deletions.
  1. +0 −1 Manifest.txt
  2. +1 −1 lib/rubyw_helper.rb
  3. +44 −0 rubyw_helper.gemspec
  4. +0 −81 tasks/ann.rake
  5. +2 −0 tasks/bacon.rake
  6. +12 −0 tasks/gem.rake
  7. +4 −4 tasks/post_load.rake
  8. +1 −1 tasks/rubyforge.rake
  9. +9 −39 tasks/setup.rb
View
@@ -7,7 +7,6 @@ spec/.bacon
spec/helper.rb
spec/runner
spec/spec_rubyw_helper.rb
-tasks/ann.rake
tasks/autospec.rake
tasks/bacon.rake
tasks/bones.rake
View
@@ -3,7 +3,7 @@
class RubywHelper
- Version = VERSION = '0.1.3'
+ Version = VERSION = '0.1.4'
def self.version; Version; end
app_name = File.basename($0)
View
@@ -0,0 +1,44 @@
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{rubyw_helper}
+ s.version = "0.1.3"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["James Tucker"]
+ s.date = %q{2009-01-16}
+ s.description = %q{A simple redirector for use when you just want to safely redirect stdio. Simply encapsulates a few different safety mechanisms when redirecting stdio, with the primary goal of making it easier to write apps that run under rubyw.exe, where ruby loads with stdio closed. Whilst the primary intention for use is under win32, and was actually developed as an external helper for specifically win32-service usage, this gem may be useful to some other folks on other platforms. It is not win32 specific.}
+ s.email = %q{raggi@rubyforge.org}
+ s.extra_rdoc_files = ["History.txt", "README.rdoc"]
+ s.files = ["History.txt", "Manifest.txt", "README.rdoc", "Rakefile", "lib/rubyw_helper.rb", "spec/.bacon", "spec/helper.rb", "spec/runner", "spec/spec_rubyw_helper.rb", "tasks/autospec.rake", "tasks/bacon.rake", "tasks/bones.rake", "tasks/gem.rake", "tasks/git.rake", "tasks/manifest.rake", "tasks/notes.rake", "tasks/post_load.rake", "tasks/rdoc.rake", "tasks/rubyforge.rake", "tasks/setup.rb"]
+ s.has_rdoc = true
+ s.homepage = %q{http://github.com/raggi/rubyw_helper}
+ s.rdoc_options = ["--main", "README.rdoc"]
+ s.require_paths = ["lib"]
+ s.rubyforge_project = %q{libraggi}
+ s.rubygems_version = %q{1.3.1}
+ s.summary = %q{A simple redirector for use when you just want to safely redirect stdio}
+ s.test_files = ["spec/spec_rubyw_helper.rb"]
+
+ 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<exception_string>, [">= 0"])
+ s.add_development_dependency(%q<rake>, [">= 0"])
+ s.add_development_dependency(%q<bones>, [">= 0"])
+ s.add_development_dependency(%q<bacon>, [">= 0"])
+ else
+ s.add_dependency(%q<exception_string>, [">= 0"])
+ s.add_dependency(%q<rake>, [">= 0"])
+ s.add_dependency(%q<bones>, [">= 0"])
+ s.add_dependency(%q<bacon>, [">= 0"])
+ end
+ else
+ s.add_dependency(%q<exception_string>, [">= 0"])
+ s.add_dependency(%q<rake>, [">= 0"])
+ s.add_dependency(%q<bones>, [">= 0"])
+ s.add_dependency(%q<bacon>, [">= 0"])
+ end
+end
View
@@ -1,81 +0,0 @@
-# $Id$
-
-begin
- require 'bones/smtp_tls'
-rescue LoadError
- require 'net/smtp'
-end
-require 'time'
-
-namespace :ann do
-
- # A prerequisites task that all other tasks depend upon
- task :prereqs
-
- file PROJ.ann.file do
- ann = PROJ.ann
- puts "Generating #{ann.file}"
- File.open(ann.file,'w') do |fd|
- fd.puts("#{PROJ.name} version #{PROJ.version}")
- fd.puts(" by #{Array(PROJ.authors).first}") if PROJ.authors
- fd.puts(" #{PROJ.url}") if PROJ.url.valid?
- fd.puts(" (the \"#{PROJ.release_name}\" release)") if PROJ.release_name
- fd.puts
- fd.puts("== DESCRIPTION")
- fd.puts
- fd.puts(PROJ.description)
- fd.puts
- fd.puts(PROJ.changes.sub(%r/^.*$/, '== CHANGES'))
- fd.puts
- ann.paragraphs.each do |p|
- fd.puts "== #{p.upcase}"
- fd.puts
- fd.puts paragraphs_of(PROJ.readme_file, p).join("\n\n")
- fd.puts
- end
- fd.puts ann.text if ann.text
- end
- end
-
- desc "Create an announcement file"
- task :announcement => ['ann:prereqs', PROJ.ann.file]
-
- desc "Send an email announcement"
- task :email => ['ann:prereqs', PROJ.ann.file] do
- ann = PROJ.ann
- from = ann.email[:from] || PROJ.email
- to = Array(ann.email[:to])
-
- ### build a mail header for RFC 822
- rfc822msg = "From: #{from}\n"
- rfc822msg << "To: #{to.join(',')}\n"
- rfc822msg << "Subject: [ANN] #{PROJ.name} #{PROJ.version}"
- rfc822msg << " (#{PROJ.release_name})" if PROJ.release_name
- rfc822msg << "\n"
- rfc822msg << "Date: #{Time.new.rfc822}\n"
- rfc822msg << "Message-Id: "
- rfc822msg << "<#{"%.8f" % Time.now.to_f}@#{ann.email[:domain]}>\n\n"
- rfc822msg << File.read(ann.file)
-
- params = [:server, :port, :domain, :acct, :passwd, :authtype].map do |key|
- ann.email[key]
- end
-
- params[3] = PROJ.email if params[3].nil?
-
- if params[4].nil?
- STDOUT.write "Please enter your e-mail password (#{params[3]}): "
- params[4] = STDIN.gets.chomp
- end
-
- ### send email
- Net::SMTP.start(*params) {|smtp| smtp.sendmail(rfc822msg, from, to)}
- end
-end # namespace :ann
-
-desc 'Alias to ann:announcement'
-task :ann => 'ann:announcement'
-
-CLOBBER << PROJ.ann.file
-
-# EOF
View
@@ -1,5 +1,7 @@
+desc "Run the executable test specifications"
task :spec do
ruby 'spec/runner'
end
+desc "Run the executable test specifications"
task :test => :spec
View
@@ -18,6 +18,9 @@ namespace :gem do
PROJ.gem.dependencies.each do |dep|
s.add_dependency(*dep)
end
+ PROJ.gem.development_dependencies.each do |dep|
+ s.add_development_dependency(*dep)
+ end
s.files = PROJ.gem.files
s.executables = PROJ.gem.executables.map {|fn| File.basename(fn)}
@@ -114,6 +117,15 @@ namespace :gem do
sh "#{SUDO} #{GEM} cleanup #{PROJ.gem._spec.name}"
end
+ file "#{PROJ.name}.gemspec" => PROJ.gem._spec.files do |t|
+ open(t.name, 'w') { |f| f.write PROJ.gem._spec.to_ruby }
+ end
+ CLOBBER.include("#{PROJ.name}.gemspec")
+
+ desc 'Generate gemspec'
+ task :spec => "#{PROJ.name}.gemspec"
+ task :release => :spec
+
end # namespace :gem
desc 'Alias to gem:package'
View
@@ -3,9 +3,11 @@
# This file does not define any rake tasks. It is used to load some project
# settings if they are not defined by the user.
+PROJ.rdoc.main ||= PROJ.readme_file
+PROJ.rdoc.dir ||= File.join('doc', PROJ.name)
+
PROJ.rdoc.exclude << "^#{Regexp.escape(PROJ.manifest_file)}$"
-PROJ.exclude << ["^#{Regexp.escape(PROJ.ann.file)}$",
- "^#{Regexp.escape(PROJ.rdoc.dir)}/",
+PROJ.exclude << ["^#{Regexp.escape(PROJ.rdoc.dir)}/",
"^#{Regexp.escape(PROJ.rcov.dir)}/"]
flatten_arrays = lambda do |this,os|
@@ -34,6 +36,4 @@ PROJ.gem.files ||=
PROJ.gem.executables ||= PROJ.gem.files.find_all {|fn| fn =~ %r/^bin/}
-PROJ.rdoc.main ||= PROJ.readme_file
-
# EOF
View
@@ -46,7 +46,7 @@ namespace :doc do
host = "#{config['username']}@rubyforge.org"
remote_dir = "/var/www/gforge-projects/#{PROJ.rubyforge.name}/"
remote_dir << PROJ.rdoc.remote_dir if PROJ.rdoc.remote_dir
- local_dir = PROJ.rdoc.dir
+ local_dir = File.dirname(PROJ.rdoc.dir)
Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
end
View
@@ -18,7 +18,8 @@ class OpenStruct; undef :gem; end
:email => nil,
:url => "\000",
:version => ENV['VERSION'] || '0.0.0',
- :exclude => %w(tmp$ bak$ ~$ CVS \.svn/ \.git/ ^pkg/),
+ :exclude => %w(tmp$ bak$ ~$ CVS \.git/ \.hg/ \.svn/ ^pkg/ ^doc/ \.DS_Store
+ \.hgignore \.gitignore \.dotest \.swp$ .*\.gemspec$),
:release_name => ENV['RELEASE'],
# System Defaults
@@ -28,26 +29,10 @@ class OpenStruct; undef :gem; end
:manifest_file => 'Manifest.txt',
:readme_file => 'README.rdoc',
- # Announce
- :ann => OpenStruct.new(
- :file => 'announcement.txt',
- :text => nil,
- :paragraphs => [],
- :email => {
- :from => nil,
- :to => %w(ruby-talk@ruby-lang.org),
- :server => 'localhost',
- :port => 25,
- :domain => ENV['HOSTNAME'],
- :acct => nil,
- :passwd => nil,
- :authtype => :plain
- }
- ),
-
# Gem Packaging
:gem => OpenStruct.new(
:dependencies => [],
+ :development_dependencies => ['rake', 'bones', 'bacon'],
:executables => nil,
:extensions => FileList['ext/**/extconf.rb'],
:files => nil,
@@ -59,7 +44,7 @@ class OpenStruct; undef :gem; end
# File Annotations
:notes => OpenStruct.new(
:exclude => %w(^tasks/setup\.rb$),
- :extensions => %w(.txt .rb .erb) << '',
+ :extensions => %w(.txt .rb .erb .rdoc) << '',
:tags => %w(FIXME OPTIMIZE TODO)
),
@@ -77,7 +62,7 @@ class OpenStruct; undef :gem; end
:include => %w(^lib/ ^bin/ ^ext/ \.txt$ \.rdoc$),
:exclude => %w(extconf\.rb$),
:main => nil,
- :dir => 'doc',
+ :dir => nil,
:remote_dir => nil
),
@@ -86,25 +71,10 @@ class OpenStruct; undef :gem; end
:name => "\000"
),
- # Rspec
- :spec => OpenStruct.new(
- :files => FileList['spec/**/*_spec.rb'],
- :opts => []
- ),
-
- # Subversion Repository
- :svn => OpenStruct.new(
- :root => nil,
- :path => '',
- :trunk => 'trunk',
- :tags => 'tags',
- :branches => 'branches'
- ),
-
- # Test::Unit
+ # Tests
:test => OpenStruct.new(
- :files => FileList['test/**/test_*.rb'],
- :file => 'test/all.rb',
+ :files => FileList['{test,spec}/{{test,spec}_*.rb,*_spec.rb}'],
+ :file => '',
:opts => []
)
)
@@ -166,7 +136,7 @@ def quiet( &block )
# specified.
#
# changes = paragraphs_of('History.txt', 0..1).join("\n\n")
-# summary, *description = paragraphs_of('README.txt', 3, 3..8)
+# summary, *description = paragraphs_of('README.rdoc', 3, 3..8)
#
def paragraphs_of( path, *paragraphs )
title = String === paragraphs.first ? paragraphs.shift : nil

0 comments on commit 8bf557a

Please sign in to comment.