Skip to content
This repository
Browse code

Reorganized project; updated Jeweler

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

0 notes on commit 7e3cef6

Please sign in to comment.
Something went wrong with that request. Please try again.