Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sync with main repo, tweak rakefile(s) again for better win32 gem, ne…
…ed to handle not forking in win32 from the executable script (daemons doesn't work on win32)
- Loading branch information
Showing
10 changed files
with
77 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,3 @@ log/*.log | |
doc/rdoc/* | ||
tmp/* | ||
pkg/* | ||
Manifest | ||
nbproject/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,38 @@ | ||
v0.5.3. Purple Yogurt release | ||
== 0.5.3 Purple Yogurt release | ||
* Add prefix option to thin script to mount app under a given path. | ||
|
||
v0.5.2. Cheezburger release | ||
== 0.5.2 Cheezburger release | ||
* Add cluster support through the -s option in the thin script, start 3 thins like this: | ||
thin start -s3 -p3000 | ||
3 thin servers will be started on port 3000, 3001, 3002, also the port number will be | ||
injected in the pid and log filenames. | ||
* Fix IOError when writing to logger when starting server as a daemon. | ||
* Really change directory when the -c option is specified. | ||
* Add restart command to thin script. | ||
* Fix typos in thin script usage message and expand chdir path. | ||
* Rename thin script options to be the same as mongrel_rails script [thronedrk]: | ||
-o --host => -a --address | ||
--log-file => --log | ||
--pid-file => --pid | ||
--env => --environment | ||
|
||
== 0.5.1 LOLCAT release | ||
* Add URL rewriting to Rails adapter so that page caching works and / fetches index.html if present. | ||
* Fix bug in multiline response header parsing. | ||
* Add specs for the Rails adapter. | ||
* Fix Set-Cookie headers in Rails adapter to handle multiple values correctly. | ||
* Fix Ruby 1.9 incompatibility in Response#headers= and Rakefile. | ||
* Fix parser to be Ruby 1.9 compatible [Aman Gupta] | ||
* Set gemspec to use EventMachine version 0.8.1 as it's the latest one having precompiled windows binaries. | ||
[Francis Cianfrocca]. | ||
* Add -D option to thin script to set debugging on. | ||
* Output incoming data and response when debugging is on. | ||
|
||
v0.5.1. LOLCAT release | ||
|
||
v0.5.0. full rewrite to use EventMachine, Rack, and Mongrel parser | ||
|
||
v0.4.1. Fix Rails environment option not being used in thin script. | ||
|
||
v0.4.0. First alphaish release as a gem. | ||
== 0.5.0 | ||
* Full rewrite to use EventMachine, Rack and Mongrel parser | ||
|
||
== 0.4.1 | ||
* Fix Rails environment option not being used in thin script. | ||
|
||
== 0.4.0 | ||
* First alphaish release as a gem. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Marc-Andre Cournoyer <macournoyer@gmail.com> | ||
Kevin Williams <kevwil@gmail.com> | ||
James Golick |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,168 +1,11 @@ | ||
require 'lib/thin' | ||
require 'echoe' | ||
|
||
# sudo flag | ||
windows = (PLATFORM =~ /mswin|cygwin/) | ||
SUDO = windows ? "" : "sudo" | ||
|
||
# ruby version | ||
RUBY_1_9 = RUBY_VERSION =~ /^1\.9/ | ||
def gem | ||
RUBY_1_9 ? 'gem19' : 'gem' | ||
end | ||
|
||
# ragel | ||
RAGEL_BASE = 'parser' | ||
RAGEL_TARGET = "#{RAGEL_BASE}.c" | ||
RAGEL_FILE = "#{RAGEL_BASE}.rl" | ||
|
||
# ext | ||
EXT_BASE = 'thin_parser' | ||
EXT_DIR = "ext/#{EXT_BASE}" | ||
EXT_BUNDLE = "#{EXT_DIR}/#{EXT_BASE}.#{Config::CONFIG['DLEXT']}" | ||
SO_FILE = "#{EXT_BASE}.so" | ||
|
||
Echoe.new(Thin::NAME) do |p| | ||
p.author = "Marc-Andre Cournoyer" | ||
p.email = "macournoyer@gmail.com" | ||
p.description = "Thin takes the http parser from Mongrel, the | ||
connection engine from EventMachine and the web server interface | ||
from Rack, creating a highly flexible, small, fast, and sexy | ||
web app server for Ruby." | ||
p.summary = "A thin and fast web server" | ||
p.url = "http://code.macournoyer.com/thin/" | ||
p.docs_host = "macournoyer.com:~/code.macournoyer.com/thin/doc/" | ||
p.clean_pattern = ['ext/thin_parser/*.{bundle,so,o,obj,pdb,lib,def,exp}', 'lib/*.{bundle,so,o,obj,pdb,lib,def,exp}', 'ext/thin_parser/Makefile', 'pkg', 'lib/*.bundle', '*.gem', '*.gemspec', '.config', 'coverage'] | ||
p.ignore_pattern = /^(.git|benchmark|site|tasks)|.gitignore/ | ||
p.rdoc_pattern = ['README', 'LICENSE', 'changes.txt', 'lib/**/*.rb', 'doc/**/*.rdoc'] | ||
p.ruby_version = '>= 1.8.6' | ||
p.dependencies = ['rack >= 0.2.0'] | ||
p.extension_pattern = nil | ||
p.need_tar_gz = false | ||
|
||
if RUBY_PLATFORM !~ /mswin/ | ||
p.extension_pattern = ["ext/**/extconf.rb"] | ||
end | ||
|
||
p.eval = proc do | ||
case RUBY_PLATFORM | ||
when /mswin/ | ||
self.files += ['lib/thin_parser.so'] | ||
add_dependency('eventmachine', '>= 0.8.1') | ||
else | ||
add_dependency('daemons', '>= 1.0.9') | ||
add_dependency('eventmachine') | ||
end | ||
end | ||
end | ||
|
||
task :clean => :clobber_package | ||
|
||
task :tag_warn do | ||
puts "*" * 40 | ||
puts "Don't forget to tag the release:" | ||
puts " git tag -a v#{Thin::VERSION::STRING}" | ||
puts "*" * 40 | ||
end | ||
|
||
task :gem => [:compile,:tag_warn] | ||
RUBY_1_9 = RUBY_VERSION =~ /^1\.9/ | ||
WIN = (PLATFORM =~ /mswin|cygwin/) | ||
SUDO = (WIN ? "" : "sudo") | ||
|
||
desc "Compile the Ragel state machines" | ||
task :ragel do | ||
Dir.chdir EXT_DIR do | ||
File.unlink RAGEL_TARGET if File.exist? RAGEL_TARGET | ||
sh "ragel #{RAGEL_FILE} | rlgen-cd -G2 -o #{RAGEL_TARGET}" | ||
raise "Failed to compile Ragel state machine" unless File.exist? RAGEL_TARGET | ||
end | ||
end | ||
|
||
case RUBY_PLATFORM | ||
when /mswin/ | ||
FILENAME = "lib/#{SO_FILE}" | ||
file FILENAME do | ||
Dir.chdir EXT_DIR do | ||
ruby "extconf.rb" | ||
system('nmake') | ||
end | ||
cp EXT_BUNDLE, 'lib/' | ||
end | ||
desc "compile mswin32 extension" | ||
task :compile => [FILENAME] | ||
else | ||
# task :compile defined by echoe due to defined extension_pattern | ||
end | ||
|
||
namespace :deploy do | ||
task :site => %w(site:upload rdoc:upload) | ||
|
||
desc 'Deploy on code.macournoyer.com' | ||
task :alpha => %w(gem:upload deploy:site) | ||
|
||
desc 'Deploy on rubyforge' | ||
task :public => %w(gem:upload_rubyforge deploy:site) | ||
end | ||
desc 'Deploy on all servers' | ||
task :deploy => %w(deploy:alpha deploy:public) | ||
|
||
def upload(file, to, options={}) | ||
sh %{ssh macournoyer@macournoyer.com "rm -rf code.macournoyer.com/#{to}"} if options[:replace] | ||
sh %{scp -rq #{file} macournoyer@macournoyer.com:code.macournoyer.com/#{to}} | ||
end | ||
|
||
namespace :site do | ||
task :build do | ||
mkdir_p 'tmp/site/images' | ||
cd 'tmp/site' do | ||
sh "SITE_ROOT='/thin' ruby ../../site/thin.rb --dump" | ||
end | ||
cp 'site/style.css', 'tmp/site' | ||
cp_r Dir['site/images/*'], 'tmp/site/images' | ||
end | ||
|
||
desc 'Upload website to code.macournoyer.com' | ||
task :upload => 'site:build' do | ||
upload 'tmp/site/*', 'thin' | ||
end | ||
end | ||
require 'rake' | ||
require 'rake/clean' | ||
require 'lib/thin' | ||
|
||
if RUBY_1_9 | ||
task :spec do | ||
warn 'RSpec not yet supporting Ruby 1.9, so cannot run the specs :(' | ||
end | ||
else | ||
# RSpec not yet working w/ Ruby 1.9 | ||
require 'spec/rake/spectask' | ||
|
||
desc "Run all examples" | ||
Spec::Rake::SpecTask.new('spec') do |t| | ||
t.spec_files = FileList['spec/**/*_spec.rb'] | ||
end | ||
end | ||
Dir['tasks/**/*.rake'].each { |rake| load rake } | ||
|
||
task :default => [:compile, :spec] | ||
|
||
desc 'Show some stats about the code' | ||
task :stats do | ||
line_count = proc do |path| | ||
Dir[path].collect { |f| File.open(f).readlines.reject { |l| l =~ /(^\s*(\#|\/\*))|^\s*$/ }.size }.inject(0){ |sum,n| sum += n } | ||
end | ||
lib = line_count['lib/**/*.rb'] | ||
ext = line_count['ext/**/*.{c,h}'] | ||
spec = line_count['spec/**/*.rb'] | ||
ratio = '%1.2f' % (spec.to_f / lib.to_f) | ||
|
||
puts "#{lib.to_s.rjust(6)} LOC of lib" | ||
puts "#{ext.to_s.rjust(6)} LOC of ext" | ||
puts "#{spec.to_s.rjust(6)} LOC of spec" | ||
puts "#{ratio.to_s.rjust(6)} ratio lib/spec" | ||
end | ||
|
||
desc "install the gem" | ||
task :thin_install => [:clean,:package] do | ||
sh %{#{SUDO} #{gem} install pkg/#{Thin::NAME}-#{Thin::VERSION::STRING}*.gem --no-update-sources} | ||
end | ||
|
||
desc "uninstall the gem" | ||
task :thin_uninstall => :clean do | ||
sh %{#{SUDO} #{gem} uninstall #{Thin::NAME}} | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
== BUGS | ||
* Carl Mercier is experiencing weird stuff, response headers seems to be happened | ||
to the top of every HTML page in the browser ?wtf? | ||
* Thin uses more memory then Mongrel on some apps, investigate why | ||
|
||
== FEATURES | ||
* Add --prefix option to thin script | ||
* IPv6 support (bind to ::1) | ||
* IPv6 support (should be able to bind to ::1) | ||
|
||
== TASKS | ||
* Add a better god sample file in example, maybe generate one !? | ||
* Change benchmarking test to use | ||
http://blog.evanweaver.com/files/doc/fauna/benchmark_unit/ | ||
* Provide precompiled win32 binaries in Gem | ||
* Load options from a config file | ||
* Create a Stats adapter to show server stats in the browser | ||
* Check for memory usage/leaks using dike or other. | ||
* Change benchmarking tests to use | ||
http://blog.evanweaver.com/files/doc/fauna/benchmark_unit/ | ||
* Add a better god sample file in example/, | ||
maybe generate one w/ thin config and use this in replacement | ||
of mongrel_cluster to launch cluster at startup and all. | ||
* Port response writing to a C extension | ||
* Benchmark CGI and FastCGI too [Carlos Junior] | ||
* Investigate http://rev.rubyforge.org/ (only Ruby 1.9) | ||
* Check for memory usage/leaks using dike or other. | ||
* Benchmark CGI and FastCGI too [Carlos Junior] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,4 @@ else | |
Spec::Rake::SpecTask.new('spec') do |t| | ||
t.spec_files = FileList['spec/**/*_spec.rb'] | ||
end | ||
end | ||
end |