Permalink
Browse files

Reorganized project; updated Jeweler

Wasn't using jeweler right and generating a bad gemspec
  • Loading branch information...
1 parent 0322a89 commit 7e3cef6b53838798e1191bfb720cc1b16a4e20b6 @cyu committed Apr 26, 2012
View
10 Gemfile
@@ -1,7 +1,11 @@
source :rubygems
-gemspec
+gem "rack"
-group :test do
- gem 'shoulda'
+group :development do
+ gem "rake"
+ gem "shoulda"
+ gem "rack-test"
+ gem "bundler", "~> 1.1.0"
+ gem "jeweler", "~> 1.8.3"
end
View
20 LICENSE.txt
@@ -0,0 +1,20 @@
+Copyright (c) 2012 Calvin Yu
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
64 Rakefile
@@ -1,34 +1,46 @@
+ # encoding: utf-8
+
+ require 'rubygems'
+ require 'bundler'
+ begin
+ Bundler.setup(:default, :development)
+ rescue Bundler::BundlerError => e
+ $stderr.puts e.message
+ $stderr.puts "Run `bundle install` to install missing gems"
+ exit e.status_code
+end
require 'rake'
-require 'rake/testtask'
-desc 'Run tests'
-Rake::TestTask.new(:test) do |t|
- t.pattern = 'test/*_test.rb'
- t.verbose = true
- t.warning = true
+require 'jeweler'
+Jeweler::Tasks.new do |gem|
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
+ gem.name = "rack-cors"
+ gem.homepage = "http://github.com/cyu/rack-cors"
+ gem.license = "MIT"
+ gem.summary = "Middleware for enabling Cross-Origin Resource Sharing in Rack apps"
+ gem.description = "Middleware that will make Rack-based apps CORS compatible. Read more here: http://blog.sourcebender.com/2010/06/09/introducin-rack-cors.html. Fork the project here: http://github.com/cyu/rack-cors"
+ gem.email = "me@sourcebender.com"
+ gem.authors = ["Calvin Yu"]
+ # dependencies defined in Gemfile
+end
+Jeweler::RubygemsDotOrgTasks.new
+
+require 'rake/testtask'
+Rake::TestTask.new(:test) do |test|
+ test.libs << 'lib' << 'test'
+ test.pattern = 'test/**/*_test.rb'
+ test.verbose = true
end
task :default => :test
-# ==================================================
-# JEWELER TASKS
-# ==================================================
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |gemspec|
- gemspec.name = "rack-cors"
- gemspec.summary = "Middleware for enabling Cross-Origin Resource Sharing in Rack apps"
- gemspec.description = "Middleware that will make Rack-based apps CORS compatible. Read more here: http://blog.sourcebender.com/2010/06/09/introducin-rack-cors.html. Fork the project here: http://github.com/cyu/rack-cors"
- gemspec.email = "csyu77@gmail.com"
- gemspec.homepage = "http://github.com/cyu/rack-cors"
- gemspec.authors = ["Calvin Yu"]
- gemspec.add_dependency 'rack'
- gemspec.add_development_dependency 'rake'
- gemspec.add_development_dependency 'rack-test'
- gemspec.files.exclude 'Gemfile'
- end
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts "Jeweler not available. Install it with: gem install jeweler"
+require 'rdoc/task'
+Rake::RDocTask.new do |rdoc|
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
+
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = "rack-cors2 #{version}"
+ rdoc.rdoc_files.include('README*')
+ rdoc.rdoc_files.include('lib/**/*.rb')
end
View
25 rack-cors.gemspec
@@ -11,21 +11,21 @@ Gem::Specification.new do |s|
s.authors = ["Calvin Yu"]
s.date = "2012-04-26"
s.description = "Middleware that will make Rack-based apps CORS compatible. Read more here: http://blog.sourcebender.com/2010/06/09/introducin-rack-cors.html. Fork the project here: http://github.com/cyu/rack-cors"
- s.email = "csyu77@gmail.com"
+ s.email = "me@sourcebender.com"
s.extra_rdoc_files = [
+ "LICENSE.txt",
"README.rdoc"
]
s.files = [
+ "Gemfile",
"README.rdoc",
"Rakefile",
"VERSION",
"lib/rack/cors.rb",
- "rack-cors.gemspec",
- "test/cors_test.rb",
- "test/dsl_test.rb",
- "test/test.ru"
+ "rack-cors.gemspec"
]
s.homepage = "http://github.com/cyu/rack-cors"
+ s.licenses = ["MIT"]
s.require_paths = ["lib"]
s.rubygems_version = "1.8.23"
s.summary = "Middleware for enabling Cross-Origin Resource Sharing in Rack apps"
@@ -34,24 +34,27 @@ Gem::Specification.new do |s|
s.specification_version = 3
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<rack-cors>, [">= 0"])
- s.add_development_dependency(%q<rake>, [">= 0"])
s.add_runtime_dependency(%q<rack>, [">= 0"])
s.add_development_dependency(%q<rake>, [">= 0"])
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
s.add_development_dependency(%q<rack-test>, [">= 0"])
+ s.add_development_dependency(%q<bundler>, ["~> 1.1.0"])
+ s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
else
- s.add_dependency(%q<rack-cors>, [">= 0"])
- s.add_dependency(%q<rake>, [">= 0"])
s.add_dependency(%q<rack>, [">= 0"])
s.add_dependency(%q<rake>, [">= 0"])
+ s.add_dependency(%q<shoulda>, [">= 0"])
s.add_dependency(%q<rack-test>, [">= 0"])
+ s.add_dependency(%q<bundler>, ["~> 1.1.0"])
+ s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
end
else
- s.add_dependency(%q<rack-cors>, [">= 0"])
- s.add_dependency(%q<rake>, [">= 0"])
s.add_dependency(%q<rack>, [">= 0"])
s.add_dependency(%q<rake>, [">= 0"])
+ s.add_dependency(%q<shoulda>, [">= 0"])
s.add_dependency(%q<rack-test>, [">= 0"])
+ s.add_dependency(%q<bundler>, ["~> 1.1.0"])
+ s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
end
end
View
0 test/cors_test.rb → test/unit/cors_test.rb
File renamed without changes.
View
0 test/dsl_test.rb → test/unit/dsl_test.rb
File renamed without changes.
View
0 test/test.ru → test/unit/test.ru
File renamed without changes.

0 comments on commit 7e3cef6

Please sign in to comment.