Permalink
Browse files

Refactor gem build script

  • Loading branch information...
1 parent a44c28c commit a517514f69f9ba664168754b896e3f047254a8d3 Peter Kieltyka committed Dec 11, 2009
View
@@ -1,4 +1,2 @@
-website/index.html
+.DS_Store
pkg
-email.txt
-doc
View
@@ -1,57 +0,0 @@
-== 1.0.2 2008-06-18
-
-* Support reserve-with-timeout on pools. (Dustin Sallings)
-
-== 1.0.1 (never released)
-
-* Fix bug preventing jobs from being deleted.
-* Remove an extraneous message. (Dustin Sallings)
-* Fix the github gemspec so beanstalk-client builds. (Isaac Feliu)
-* Support the new reserve-with-timeout command in dev beanstalkd.
- (Dustin Sallings)
-
-== 1.0.0 2008-05-29
-
-* Preserve the watch list when a Pool instance reconnects.
-* Allow user to get the cached list of tubes watched for a Pool.
-* Allow user to specify a default tube for all connections. (Dustin Sallings)
-* Added a gemspec for github. (Dustin Sallings)
-* More exception classes, including one for each server error response.
-
-== 0.11.0 2008-04-17
-
-* Fix an infinite loop bug when the server goes away.
-
-== 0.10.0 2008-04-11
-
-* Some optimizations to avoid sending unnecessary use and watch commands.
-* Use newer protocol features to open only one connection per server address.
-* More consistent and complete peek methods.
-* Various bug fixes.
-
-== 0.9.0 2008-02-27
-
-* Skipping 0.8.x; beanstalkd 0.8 was a botched release.
-* Protocol updates, support for all new commands and changes to existing
- commands.
-* Bugfix: don't add stats values that aren't aggregations already.
-
-== 0.7.0 2008-02-01
-
-* Add a close method to connections and pools.
-* Add a last_server method to identify the last connection used.
-
-== 0.6.1 2008-01-22
-
-* More useful behavior when we lose the connection or the server is in drain
- mode.
-
-== 0.6.0 2008-01-04
-
-* Protocol updates. Works with beanstalkd 0.6.
-* Some bugfixes and better robustness.
-* Convenience methods for accessing YAML job hash elements.
-
-== 0.1 2007-12-12
-
-* Initial release
File renamed without changes.
View
@@ -1,27 +0,0 @@
-History.txt
-License.txt
-Manifest.txt
-README.txt
-Rakefile
-config/hoe.rb
-config/requirements.rb
-lib/beanstalk-client.rb
-lib/beanstalk-client/connection.rb
-lib/beanstalk-client/errors.rb
-lib/beanstalk-client/job.rb
-lib/beanstalk-client/version.rb
-log/debug.log
-script/destroy
-script/generate
-script/txt2html
-setup.rb
-tasks/deployment.rake
-tasks/environment.rake
-tasks/website.rake
-test/test_beanstalk-client.rb
-test/test_helper.rb
-website/index.html
-website/index.txt
-website/javascripts/rounded_corners_lite.inc.js
-website/stylesheets/screen.css
-website/template.rhtml
View
@@ -0,0 +1,17 @@
+Beanstalk Ruby Client
+=====================
+By: Keith Rarick
+
+Beanstalk is a simple, fast workqueue service. Its interface is generic, but was originally designed for reducing the latency of page views in high-volume web applications by running time-consuming tasks asynchronously.
+
+For more information see:
+- http://kr.github.com/beanstalkd/
+- http://github.com/kr/beanstalkd/blob/master/doc/protocol.txt?raw=true
+
+
+Contributors
+============
+- Isaac Feliu
+- Peter Kieltyka
+- Martyn Loughran
+- Dustin Sallings
View
@@ -1,7 +0,0 @@
-= README
-
-For more detail on what many of the commands do, see the beanstalkd protocol documentation:
-
-http://github.com/kr/beanstalkd/blob/master/doc/protocol.txt?raw=true
-
-
View
@@ -1,4 +1,19 @@
-require 'config/requirements'
-require 'config/hoe' # setup Hoe + all gem configuration
-
-Dir['tasks/**/*.rake'].each { |rake| load rake }
+require 'rubygems'
+require 'rake'
+
+begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |gem|
+ gem.name = "beanstalk-client"
+ gem.summary = "Ruby client for beanstalkd"
+ gem.description = "Ruby client for beanstalkd"
+ gem.email = "kr@xph.us"
+ gem.homepage = "http://github.com/kr/beanstalk-client-ruby"
+ gem.authors = ["Keith Rarick"]
+ end
+ Jeweler::GemcutterTasks.new
+rescue LoadError
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
+end
+
+task :default => :test
View
@@ -0,0 +1 @@
+1.0.3
@@ -1,22 +0,0 @@
-Gem::Specification.new do |s|
- s.name = %q{beanstalk-client}
- s.version = "1.0.2.1"
-
- s.specification_version = 2 if s.respond_to? :specification_version=
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Keith Rarick"]
- s.date = %q{2008-05-01}
- s.description = %q{Ruby client library for the Beanstalk protocol}
- s.email = %q{kr@causes.com}
- s.extra_rdoc_files = ["History.txt", "License.txt", "Manifest.txt", "README.txt", "website/index.txt"]
- s.files = ["History.txt", "License.txt", "Manifest.txt", "README.txt", "Rakefile", "config/hoe.rb", "config/requirements.rb", "lib/beanstalk-client.rb", "lib/beanstalk-client/connection.rb", "lib/beanstalk-client/errors.rb", "lib/beanstalk-client/job.rb", "lib/beanstalk-client/version.rb", "log/debug.log", "script/destroy", "script/generate", "script/txt2html", "setup.rb", "tasks/deployment.rake", "tasks/environment.rake", "test/test_beanstalk-client.rb", "test/test_helper.rb"]
- s.has_rdoc = true
- s.homepage = %q{http://beanstalk.rubyforge.org}
- s.rdoc_options = ["--main", "README.txt"]
- s.require_paths = ["lib"]
- s.rubyforge_project = %q{beanstalk}
- s.rubygems_version = %q{1.0.1}
- s.summary = %q{Ruby client library for the Beanstalk protocol}
- s.test_files = ["test/test_beanstalk-client.rb", "test/test_helper.rb"]
-end
View
@@ -1,72 +0,0 @@
-require 'beanstalk-client/version'
-
-AUTHOR = 'Keith Rarick' # can also be an array of Authors
-EMAIL = 'kr@causes.com'
-DESCRIPTION = 'Ruby client library for the Beanstalk protocol'
-GEM_NAME = 'beanstalk-client' # what ppl will type to install your gem
-RUBYFORGE_PROJECT = 'beanstalk' # The unix name for your project
-HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
-DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
-
-@config_file = "~/.rubyforge/user-config.yml"
-@config = nil
-RUBYFORGE_USERNAME = "unknown"
-def rubyforge_username
- unless @config
- begin
- @config = YAML.load(File.read(File.expand_path(@config_file)))
- rescue
- puts <<-EOS
-ERROR: No rubyforge config file found: #{@config_file}
-Run 'rubyforge setup' to prepare your env for access to Rubyforge
- - See http://newgem.rubyforge.org/rubyforge.html for more details
- EOS
- exit
- end
- end
- RUBYFORGE_USERNAME.replace @config["username"]
-end
-
-
-REV = nil
-# UNCOMMENT IF REQUIRED:
-# REV = `svn info`.each {|line| if line =~ /^Revision:/ then k,v = line.split(': '); break v.chomp; else next; end} rescue nil
-VERS = Beanstalk::VERSION::STRING + (REV ? ".#{REV}" : "")
-RDOC_OPTS = ['--quiet', '--title', 'beanstalk-client documentation',
- "--opname", "index.html",
- "--line-numbers",
- "--main", "README",
- "--inline-source"]
-
-class Hoe
- def extra_deps
- @extra_deps.reject! { |x| Array(x).first == 'hoe' }
- @extra_deps
- end
-end
-
-# Generate all the Rake tasks
-# Run 'rake -T' to see list of generated tasks (from gem root directory)
-hoe = Hoe.new(GEM_NAME, VERS) do |p|
- p.author = AUTHOR
- p.description = DESCRIPTION
- p.email = EMAIL
- p.summary = DESCRIPTION
- p.url = HOMEPATH
- p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
- p.test_globs = ["test/**/test_*.rb"]
- p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
-
- # == Optional
- p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
- #p.extra_deps = [] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
-
- #p.spec_extras = {} # A hash of extra values to set in the gemspec.
-
-end
-
-CHANGES = hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
-#PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
-PATH = RUBYFORGE_PROJECT
-hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
-hoe.rsync_args = '-av --delete --ignore-errors'
@@ -1,17 +0,0 @@
-require 'fileutils'
-include FileUtils
-
-require 'rubygems'
-%w[rake hoe newgem rubigen].each do |req_gem|
- begin
- require req_gem
- rescue LoadError
- puts "This Rakefile requires the '#{req_gem}' RubyGem."
- puts "Installation: gem install #{req_gem} -y"
- exit
- end
-end
-
-$:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
-
-require 'beanstalk-client'
@@ -24,3 +24,5 @@ module Beanstalk
end
require 'beanstalk-client/connection'
+require 'beanstalk-client/errors'
+require 'beanstalk-client/job'
@@ -20,8 +20,6 @@
require 'yaml'
require 'set'
require 'thread'
-require 'beanstalk-client/errors'
-require 'beanstalk-client/job'
module Beanstalk
class Connection
@@ -1,5 +1,3 @@
module Beanstalk #:nodoc:
- module VERSION #:nodoc:
- STRING = '1.0.2'
- end
+ VERSION = '1.0.3'
end
View
No changes.
View
@@ -1,14 +0,0 @@
-#!/usr/bin/env ruby
-APP_ROOT = File.join(File.dirname(__FILE__), '..')
-
-begin
- require 'rubigen'
-rescue LoadError
- require 'rubygems'
- require 'rubigen'
-end
-require 'rubigen/scripts/destroy'
-
-ARGV.shift if ['--help', '-h'].include?(ARGV[0])
-RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
-RubiGen::Scripts::Destroy.new.run(ARGV)
View
@@ -1,14 +0,0 @@
-#!/usr/bin/env ruby
-APP_ROOT = File.join(File.dirname(__FILE__), '..')
-
-begin
- require 'rubigen'
-rescue LoadError
- require 'rubygems'
- require 'rubigen'
-end
-require 'rubigen/scripts/generate'
-
-ARGV.shift if ['--help', '-h'].include?(ARGV[0])
-RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
-RubiGen::Scripts::Generate.new.run(ARGV)
View
@@ -1,74 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'rubygems'
-begin
- require 'newgem'
-rescue LoadError
- puts "\n\nGenerating the website requires the newgem RubyGem"
- puts "Install: gem install newgem\n\n"
- exit(1)
-end
-require 'redcloth'
-require 'syntax/convertors/html'
-require 'erb'
-require File.dirname(__FILE__) + '/../lib/beanstalk-client/version.rb'
-
-version = Beanstalk::VERSION::STRING
-download = 'http://rubyforge.org/projects/beanstalk'
-
-class Fixnum
- def ordinal
- # teens
- return 'th' if (10..19).include?(self % 100)
- # others
- case self % 10
- when 1: return 'st'
- when 2: return 'nd'
- when 3: return 'rd'
- else return 'th'
- end
- end
-end
-
-class Time
- def pretty
- return "#{mday}#{mday.ordinal} #{strftime('%B')} #{year}"
- end
-end
-
-def convert_syntax(syntax, source)
- return Syntax::Convertors::HTML.for_syntax(syntax).convert(source).gsub(%r!^<pre>|</pre>$!,'')
-end
-
-if ARGV.length >= 1
- src, template = ARGV
- template ||= File.join(File.dirname(__FILE__), '/../website/template.rhtml')
-
-else
- puts("Usage: #{File.split($0).last} source.txt [template.rhtml] > output.html")
- exit!
-end
-
-template = ERB.new(File.open(template).read)
-
-title = nil
-body = nil
-File.open(src) do |fsrc|
- title_text = fsrc.readline
- body_text = fsrc.read
- syntax_items = []
- body_text.gsub!(%r!<(pre|code)[^>]*?syntax=['"]([^'"]+)[^>]*>(.*?)</\1>!m){
- ident = syntax_items.length
- element, syntax, source = $1, $2, $3
- syntax_items << "<#{element} class='syntax'>#{convert_syntax(syntax, source)}</#{element}>"
- "syntax-temp-#{ident}"
- }
- title = RedCloth.new(title_text).to_html.gsub(%r!<.*?>!,'').strip
- body = RedCloth.new(body_text).to_html
- body.gsub!(%r!(?:<pre><code>)?syntax-temp-(\d+)(?:</code></pre>)?!){ syntax_items[$1.to_i] }
-end
-stat = File.stat(src)
-created = stat.ctime
-modified = stat.mtime
-
-$stdout << template.result(binding)
Oops, something went wrong.

0 comments on commit a517514

Please sign in to comment.