Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

get rid of jeweler as dependency

  • Loading branch information...
commit 9055bdf67e9b9475e47584df69cbe4cdbd357640 1 parent ab202c3
David Calavera calavera authored
1  .gitignore
View
@@ -7,4 +7,3 @@ nbproject
.idea
META-INF
ssl
-*.gemspec
125 Rakefile
View
@@ -1,64 +1,36 @@
require 'rubygems'
require 'rake'
+require 'date'
-namespace :trinidad do
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |gem|
- gem.name = "trinidad"
- gem.summary = %Q{Simple library to run rails applications into an embedded Tomcat}
- gem.email = "calavera@apache.org"
- gem.homepage = "http://calavera.github.com/trinidad"
- gem.authors = ["David Calavera"]
- gem.rubyforge_project = 'trinidad'
-
- lib_files = Dir.glob('lib/trinidad/*').select {|d| !(d =~ /jars.rb$/)}
-
- gem.files = FileList['bin/*',
- 'lib/rack/handler/trinidad.rb',
- 'lib/trinidad.rb',
- 'History.txt',
- 'LICENSE',
- 'README.rdoc',
- 'VERSION',
- *lib_files]
-
- gem.add_dependency 'rack', '>=1.0'
- gem.add_dependency 'jruby-rack', '>=1.0.2'
- gem.add_dependency 'trinidad_jars', '>=0.3.0'
-
- gem.add_development_dependency 'rspec'
- gem.add_development_dependency 'mocha'
- gem.add_development_dependency 'fakefs'
- gem.has_rdoc = false
- end
+def date
+ Date.today.to_s
+end
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
+def replace_header(head, header_name, method_name = header_name)
+ head.sub!(/(\.#{header_name}\s*= ').*'/) { "#{$1}#{send(method_name)}'"}
end
+
+def version(file, constant)
+ line = File.read(file)[/^\s*#{constant}\s*=\s*.*/]
+ line.match(/.*#{constant}\s*=\s*['"](.*)['"]/)[1]
end
-namespace :trinidad_jars do
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |gem|
- gem.name = "trinidad_jars"
- gem.summary = %Q{Common jars for Trinidad}
- gem.email = "calavera@apache.org"
- gem.homepage = "http://calavera.github.com/trinidad"
- gem.authors = ["David Calavera"]
- gem.rubyforge_project = 'trinidad_jars'
+def build(gemspec_file, gem_file)
+ sh "mkdir -p pkg"
+ sh "gem build #{gemspec_file}"
+ sh "mv #{gem_file} pkg"
+end
- gem.files = FileList['lib/trinidad/jars.rb', 'trinidad-libs/*.jar']
- gem.has_rdoc = false
- gem.version = '0.3.2'
+def release(name, gem_file, version)
+ unless `git branch` =~ /^\* master$/
+ puts "You must be on the master branch to release!"
+ exit!
end
-
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
-end
+ sh "git commit --allow-empty -a -m 'Release #{name} #{version}'"
+ sh "git tag v#{version}"
+ sh "git push origin master"
+ sh "git push --tags"
+ sh "gem push pkg/#{gem_file}.gem"
end
{
@@ -69,7 +41,12 @@ end
task t => ["trinidad_jars:#{t}", "trinidad:#{t}"]
end
-require 'spec/rake/spectask'
+begin
+ require 'spec/rake/spectask'
+rescue LoadError
+ gem 'rspec'
+ require 'spec/rake/spectask'
+end
Spec::Rake::SpecTask.new(:spec) do |spec|
spec.libs << 'lib' << 'spec'
spec.spec_opts = ['--options', "spec/spec.opts"]
@@ -84,45 +61,3 @@ Spec::Rake::SpecTask.new(:rcov) do |spec|
end
task :default => :spec
-
-require 'rake/rdoctask'
-Rake::RDocTask.new do |rdoc|
- if File.exist?('VERSION.yml')
- config = YAML.load(File.read('VERSION.yml'))
- version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
- else
- version = ""
- end
-
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = "trinidad #{version}"
- rdoc.rdoc_files.include('README*')
- rdoc.rdoc_files.include('lib/**/*.rb')
-end
-
-begin
- require 'rake/contrib/sshpublisher'
- namespace :rubyforge do
-
- desc "Release gem and RDoc documentation to RubyForge"
- task :release => ["rubyforge:release:gem"]
-
- namespace :release do
- desc "Publish RDoc to RubyForge."
- task :docs => [:rdoc] do
- config = YAML.load(
- File.read(File.expand_path('~/.rubyforge/user-config.yml'))
- )
-
- host = "#{config['username']}@rubyforge.org"
- remote_dir = "/var/www/gforge-projects/trinidad/"
- local_dir = 'rdoc'
-
- Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
- end
- end
- end
-rescue LoadError
- puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
-end
-
1  VERSION
View
@@ -1 +0,0 @@
-0.9.6
2  lib/trinidad.rb
View
@@ -22,5 +22,5 @@
module Trinidad
- VERSION = File.read(File.expand_path('../../VERSION', __FILE__)).chomp
+ VERSION = '0.9.6'
end
1  lib/trinidad/jars.rb
View
@@ -4,6 +4,7 @@
module Trinidad
require 'tomcat-core'
+ TRINIDAD_JARS_VERSION = '0.3.2'
TOMCAT_VERSION = '7.0.2' unless defined?(Trinidad::TOMCAT_VERSION)
module Tomcat
47 rakelib/trinidad.rake
View
@@ -0,0 +1,47 @@
+namespace :trinidad do
+ GEMSPEC = 'trinidad.gemspec'
+
+ def trinidad_version
+ version("lib/trinidad.rb", 'VERSION')
+ end
+
+ def trinidad_gem_file
+ "trinidad-#{trinidad_version}.gem"
+ end
+
+ desc "Release trinidad gem"
+ task :release => :build do
+ release('trinidad', trinidad_gem_file, trinidad_version)
+ end
+
+ desc "Build trinidad gem"
+ task :build => :gemspec do
+ build(GEMSPEC, trinidad_gem_file)
+ end
+
+ desc "Update trinidad gemspec"
+ task :gemspec do
+ # read spec file and split out manifest section
+ spec = File.read(GEMSPEC)
+ head, manifest, tail = spec.split(" # = MANIFEST =\n")
+
+ replace_header(head, :version, :trinidad_version)
+ replace_header(head, :date)
+
+ lib_files = Dir.glob('lib/trinidad/*').select {|d| !(d =~ /jars.rb$/)}
+
+ files = FileList['bin/*',
+ 'lib/trinidad.rb',
+ 'History.txt',
+ 'LICENSE',
+ 'README.rdoc',
+ 'VERSION',
+ *lib_files].join("\n")
+
+ # piece file back together and write
+ manifest = " s.files = %w[\n#{files}\n ]\n"
+ spec = [head, manifest, tail].join(" # = MANIFEST =\n")
+ File.open(GEMSPEC, 'w') { |io| io.write(spec) }
+ puts "Updated #{GEMSPEC}"
+ end
+end
39 rakelib/trinidad_jars.rake
View
@@ -0,0 +1,39 @@
+namespace :trinidad_jars do
+ JARS_GEMSPEC = 'trinidad_jars.gemspec'
+
+ def trinidad_jars_version
+ version("lib/trinidad/jars.rb", 'TRINIDAD_JARS_VERSION')
+ end
+
+ def trinidad_jars_gem_file
+ "trinidad_jars-#{trinidad_jars_version}.gem"
+ end
+
+ desc "Release trinidad_jars gem"
+ task :release => :build do
+ release('trinidad_jars', trinidad_jars_gem_file, trinidad_jars_version)
+ end
+
+ desc "Build trinidad_jars gem"
+ task :build => :JARS_GEMSPEC do
+ build(JARS_GEMSPEC, trinidad_jars_gem_file)
+ end
+
+ desc "Update trinidad_jars gemspec"
+ task :gemspec do
+ # read spec file and split out manifest section
+ spec = File.read(JARS_GEMSPEC)
+ head, manifest, tail = spec.split(" # = MANIFEST =\n")
+
+ replace_header(head, :version, :trinidad_jars_version)
+ replace_header(head, :date)
+
+ files = FileList['lib/trinidad/jars.rb', 'trinidad-libs/*.jar'].join("\n")
+
+ # piece file back together and write
+ manifest = " s.files = %w[\n#{files}\n ]\n"
+ spec = [head, manifest, tail].join(" # = MANIFEST =\n")
+ File.open(JARS_GEMSPEC, 'w') { |io| io.write(spec) }
+ puts "Updated #{JARS_GEMSPEC}"
+ end
+end
81 trinidad.gemspec
View
@@ -0,0 +1,81 @@
+## This is the rakegem gemspec template. Make sure you read and understand
+## all of the comments. Some sections require modification, and others can
+## be deleted if you don't need them. Once you understand the contents of
+## this file, feel free to delete any comments that begin with two hash marks.
+## You can find comprehensive Gem::Specification documentation, at
+## http://docs.rubygems.org/read/chapter/20
+Gem::Specification.new do |s|
+ 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.rubygems_version = '1.3.5'
+
+ ## Leave these as is they will be modified for you by the rake gemspec task.
+ ## If your rubyforge_project name is different, then edit it and comment out
+ ## the sub! line in the Rakefile
+ s.name = 'trinidad'
+ s.version = '0.9.7'
+ s.date = '2010-09-26'
+ s.rubyforge_project = 'trinidad'
+
+ ## Make sure your summary is short. The description may be as long
+ ## as you like.
+ s.summary = "Simple library to run rails applications into an embedded Tomcat"
+ s.description = "Trinidad allows you to run a rails or rackup applications within an embedded Apache Tomcat container"
+
+ ## List the primary authors. If there are a bunch of authors, it's probably
+ ## better to set the email to an email list or something. If you don't have
+ ## a custom homepage, consider using your GitHub URL or the like.
+ s.authors = ["David Calavera"]
+ s.email = 'calavera@apache.org'
+ s.homepage = 'http://github.com/calavera/trinidad'
+
+ ## This gets added to the $LOAD_PATH so that 'lib/NAME.rb' can be required as
+ ## require 'NAME.rb' or'/lib/NAME/file.rb' can be as require 'NAME/file.rb'
+ s.require_paths = %w[lib]
+
+ ## If your gem includes any executables, list them here.
+ s.executables = ["trinidad"]
+ s.default_executable = 'trinidad'
+
+ ## Specify any RDoc options here. You'll want to add your README and
+ ## LICENSE files to the extra_rdoc_files list.
+ s.rdoc_options = ["--charset=UTF-8"]
+ s.extra_rdoc_files = %w[README.rdoc LICENSE]
+
+ ## List your runtime dependencies here. Runtime dependencies are those
+ ## that are needed for an end user to actually USE your code.
+ s.add_dependency('trinidad_jars', ">= 0.3.0")
+ s.add_dependency('jruby-rack', ">= 1.0.2")
+
+ ## List your development dependencies here. Development dependencies are
+ ## those that are only needed during development
+ s.add_development_dependency('rspec')
+ s.add_development_dependency('mocha')
+ s.add_development_dependency('fakefs')
+
+ ## Leave this section as-is. It will be automatically generated from the
+ ## contents of your Git repository via the gemspec task. DO NOT REMOVE
+ ## THE MANIFEST COMMENTS, they are used as delimiters by the task.
+ # = MANIFEST =
+ s.files = %w[
+bin/trinidad
+lib/trinidad.rb
+History.txt
+LICENSE
+README.rdoc
+VERSION
+lib/trinidad/command_line_parser.rb
+lib/trinidad/core_ext.rb
+lib/trinidad/extensions.rb
+lib/trinidad/rackup_web_app.rb
+lib/trinidad/rails_web_app.rb
+lib/trinidad/server.rb
+lib/trinidad/web_app.rb
+lib/trinidad/web_app_lifecycle_listener.rb
+ ]
+ # = MANIFEST =
+
+ ## Test files will be grabbed from the file list. Make sure the path glob
+ ## matches what you actually use.
+ ## s.test_files = s.files.select { |path| path =~ %r{^spec/trinidad/.*_spec\.rb} }
+end
45 trinidad_jars.gemspec
View
@@ -0,0 +1,45 @@
+## This is the rakegem gemspec template. Make sure you read and understand
+## all of the comments. Some sections require modification, and others can
+## be deleted if you don't need them. Once you understand the contents of
+## this file, feel free to delete any comments that begin with two hash marks.
+## You can find comprehensive Gem::Specification documentation, at
+## http://docs.rubygems.org/read/chapter/20
+Gem::Specification.new do |s|
+ 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.rubygems_version = '1.3.5'
+
+ ## Leave these as is they will be modified for you by the rake gemspec task.
+ ## If your rubyforge_project name is different, then edit it and comment out
+ ## the sub! line in the Rakefile
+ s.name = 'trinidad_jars'
+ s.version = '0.3.2'
+ s.date = '2010-09-26'
+ s.rubyforge_project = 'trinidad_jars'
+
+ ## Make sure your summary is short. The description may be as long
+ ## as you like.
+ s.summary = "Tomcat's jars packed for Trinidad"
+ s.description = "Bundled version of Tomcat packed for Trinidad"
+
+ ## List the primary authors. If there are a bunch of authors, it's probably
+ ## better to set the email to an email list or something. If you don't have
+ ## a custom homepage, consider using your GitHub URL or the like.
+ s.authors = ["David Calavera"]
+ s.email = 'calavera@apache.org'
+ s.homepage = 'http://github.com/calavera/trinidad'
+
+ ## This gets added to the $LOAD_PATH so that 'lib/NAME.rb' can be required as
+ ## require 'NAME.rb' or'/lib/NAME/file.rb' can be as require 'NAME/file.rb'
+ s.require_paths = %w[lib]
+
+ ## Leave this section as-is. It will be automatically generated from the
+ ## contents of your Git repository via the gemspec task. DO NOT REMOVE
+ ## THE MANIFEST COMMENTS, they are used as delimiters by the task.
+ # = MANIFEST =
+ s.files = %w[
+lib/trinidad/jars.rb
+trinidad-libs/tomcat-core.jar
+ ]
+ # = MANIFEST =
+end
Please sign in to comment.
Something went wrong with that request. Please try again.