Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d71f5f
commit f6184c5
Showing
5 changed files
with
70 additions
and
97 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 |
---|---|---|
|
@@ -9,6 +9,7 @@ ext/thin_parser/vc60.pdb | |
ext/thin_parser/*.so | ||
*.bundle | ||
*.so | ||
*.gem | ||
log | ||
spec/rails_app/log | ||
doc/rdoc/* | ||
|
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,44 +1,21 @@ | ||
RUBY_1_9 = RUBY_VERSION =~ /^1\.9/ | ||
WIN = (RUBY_PLATFORM =~ /mswin|cygwin/) | ||
SUDO = (WIN ? "" : "sudo") | ||
|
||
require 'rake' | ||
require 'rake/clean' | ||
require 'rake/extensiontask' # from rake-compiler gem | ||
|
||
$: << File.join(File.dirname(__FILE__), 'lib') | ||
require 'thin/version' | ||
load 'thin.gemspec' | ||
|
||
# Load tasks in tasks/ | ||
Dir['tasks/**/*.rake'].each { |rake| load rake } | ||
|
||
task :default => :spec | ||
|
||
Rake::ExtensionTask.new('thin_parser', Thin::GemSpec) do |ext| | ||
# enable cross compilation (requires cross compile toolchain) | ||
ext.cross_compile = true | ||
|
||
# forces the Windows platform instead of the default one | ||
# configure options only for cross compile | ||
ext.cross_platform = %w( i386-mswin32 x86-mingw32 ) | ||
end | ||
|
||
CLEAN.include %w(**/*.{o,bundle,jar,so,obj,pdb,lib,def,exp,log} ext/*/Makefile ext/*/conftest.dSYM lib/1.{8,9}}) | ||
|
||
desc "Compile the Ragel state machines" | ||
task :ragel do | ||
Dir.chdir 'ext/thin_parser' do | ||
target = "parser.c" | ||
File.unlink target if File.exist? target | ||
sh "ragel parser.rl -G2 -o #{target}" | ||
raise "Failed to compile Ragel state machine" unless File.exist? target | ||
end | ||
desc "Build gem packages" | ||
task :build do | ||
sh "gem build thin.gemspec" | ||
end | ||
|
||
desc "Build gem packages" | ||
task :gems do | ||
sh "rake clean gem && rake cross native gem RUBY_CC_VERSION=1.8.6:1.9.1" | ||
desc "Push gem packages" | ||
task :push => :build do | ||
sh "gem push thin-*.gem" | ||
end | ||
|
||
desc "Release version #{Thin::VERSION::STRING} gems to rubyforge" | ||
task :release => [:tag, "gem:push"] | ||
desc "Release version #{Thin::VERSION::STRING}" | ||
task :release => [:tag, :push] |
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,22 @@ | ||
require 'rake/extensiontask' # from rake-compiler gem | ||
|
||
Rake::ExtensionTask.new('thin_parser', Thin::GemSpec) do |ext| | ||
# enable cross compilation (requires cross compile toolchain) | ||
ext.cross_compile = true | ||
|
||
# forces the Windows platform instead of the default one | ||
# configure options only for cross compile | ||
ext.cross_platform = %w( i386-mswin32 x86-mingw32 ) | ||
end | ||
|
||
CLEAN.include %w(**/*.{o,bundle,jar,so,obj,pdb,lib,def,exp,log} ext/*/Makefile ext/*/conftest.dSYM lib/1.{8,9}}) | ||
|
||
desc "Compile the Ragel state machines" | ||
task :ragel do | ||
Dir.chdir 'ext/thin_parser' do | ||
target = "parser.c" | ||
File.unlink target if File.exist? target | ||
sh "ragel parser.rl -G2 -o #{target}" | ||
raise "Failed to compile Ragel state machine" unless File.exist? target | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
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,38 @@ | ||
$:.push File.expand_path("../lib", __FILE__) | ||
|
||
# Maintain your gem's version: | ||
require "thin/version" | ||
|
||
# Describe your gem and declare its dependencies: | ||
Thin::GemSpec = Gem::Specification.new do |s| | ||
s.name = Thin::NAME | ||
s.version = Thin::VERSION::STRING | ||
s.platform = Thin.win? ? Gem::Platform::CURRENT : Gem::Platform::RUBY | ||
s.summary = | ||
s.description = "A thin and fast web server" | ||
s.author = "Marc-Andre Cournoyer" | ||
s.email = 'macournoyer@gmail.com' | ||
s.homepage = 'http://code.macournoyer.com/thin/' | ||
s.rubyforge_project = 'thin' | ||
s.license = 'Ruby' | ||
s.executables = %w( thin ) | ||
|
||
s.required_ruby_version = '>= 1.8.5' | ||
|
||
s.add_dependency 'rack', '>= 1.0.0' | ||
s.add_dependency 'eventmachine', '>= 0.12.6' | ||
s.add_dependency 'daemons', '>= 1.0.9' unless Thin.win? | ||
|
||
s.files = %w(CHANGELOG README.md Rakefile) + | ||
Dir["{bin,doc,example,lib}/**/*"] - Dir["lib/thin_parser.*"] + | ||
Dir["ext/**/*.{h,c,rb,rl}"] | ||
|
||
if Thin.win? | ||
s.files += Dir["lib/*/thin_parser.*"] | ||
else | ||
s.extensions = Dir["ext/**/extconf.rb"] | ||
end | ||
|
||
s.require_path = "lib" | ||
s.bindir = "bin" | ||
end |