Browse files

Works in your Rails 3 Gemfile now. No longer works as a plugin, but I…

…'d rather have it this way.

Adding this to your Gemfile should work:
gem 'subdomain-fu', :git => "git://github.com/nhowell/subdomain-fu.git"
  • Loading branch information...
1 parent 9be252a commit 763410bdc16931cbe193e8776dbe248276b1eda3 @nhowell nhowell committed with Michael Bleigh May 1, 2010
Showing with 52 additions and 51 deletions.
  1. +36 −36 Rakefile
  2. +0 −6 init.rb
  3. +2 −0 lib/subdomain-fu.rb
  4. +7 −0 lib/subdomain_fu/rails.rb
  5. +7 −9 subdomain-fu.gemspec
View
72 Rakefile
@@ -1,14 +1,14 @@
require 'rake'
-require 'spec/rake/spectask'
-
-desc 'Default: run specs.'
-task :default => :spec
-
-desc 'Run the specs'
-Spec::Rake::SpecTask.new(:spec) do |t|
- t.spec_opts = ['--colour --format progress --loadby mtime --reverse']
- t.spec_files = FileList['spec/**/*_spec.rb']
-end
+# require 'spec/rake/spectask'
+#
+# desc 'Default: run specs.'
+# task :default => :spec
+#
+# desc 'Run the specs'
+# Spec::Rake::SpecTask.new(:spec) do |t|
+# t.spec_opts = ['--colour --format progress --loadby mtime --reverse']
+# t.spec_files = FileList['spec/**/*_spec.rb']
+# end
begin
require 'jeweler'
@@ -18,7 +18,7 @@ begin
gemspec.summary = "SubdomainFu is a Rails plugin that provides subdomain routing and URL writing helpers."
gemspec.email = "michael@intridea.com"
gemspec.homepage = "http://github.com/mbleigh/subdomain-fu"
- gemspec.files = FileList["[A-Z]*", "{lib,spec,rails}/**/*"] - FileList["**/*.log"]
+ gemspec.files = FileList["[A-Z]*", "{lib}/**/*"] - FileList["**/*.log"]
gemspec.description = "SubdomainFu is a Rails plugin to provide all of the basic functionality necessary to handle multiple subdomain applications (such as Basecamp-esque subdomain accounts and more)."
gemspec.authors = ["Michael Bleigh"]
end
@@ -29,28 +29,28 @@ end
# These are new tasks
-begin
- require 'rake/contrib/sshpublisher'
- namespace :rubyforge do
-
- desc "Release gem and RDoc documentation to RubyForge"
- task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
-
- 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/the-perfect-gem/"
- 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
+# begin
+# require 'rake/contrib/sshpublisher'
+# namespace :rubyforge do
+#
+# desc "Release gem and RDoc documentation to RubyForge"
+# task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
+#
+# 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/the-perfect-gem/"
+# 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
View
6 init.rb
@@ -1,6 +0,0 @@
-require 'action_controller/base'
-
-# Allow whatever Ruby Package tool is being used to manage load paths. gem auto adds the gem's lib dir to load path.
-require 'subdomain-fu' unless defined?(SubdomainFu)
-
-ActionController::Base.send :include, SubdomainFu::Controller
View
2 lib/subdomain-fu.rb
@@ -179,3 +179,5 @@ def current_domain
end
end
end
+
+require 'subdomain_fu/rails'
View
7 lib/subdomain_fu/rails.rb
@@ -0,0 +1,7 @@
+module SubdomainFU
+ class Engine < ::Rails::Engine
+ initializer "setup for rails" do
+ ActionController::Base.send :include, SubdomainFu::Controller
+ end
+ end
+end
View
16 subdomain-fu.gemspec
@@ -1,6 +1,6 @@
# Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
-# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
+# Instead, edit Jeweler::Tasks in rakefile, and run the gemspec command
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
@@ -9,11 +9,12 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
s.authors = ["Michael Bleigh"]
- s.date = %q{2010-02-09}
+ s.date = %q{2010-04-30}
s.description = %q{SubdomainFu is a Rails plugin to provide all of the basic functionality necessary to handle multiple subdomain applications (such as Basecamp-esque subdomain accounts and more).}
s.email = %q{michael@intridea.com}
s.extra_rdoc_files = [
- "README.rdoc"
+ "CHANGELOG",
+ "README.rdoc"
]
s.files = [
"CHANGELOG",
@@ -22,18 +23,15 @@ Gem::Specification.new do |s|
"Rakefile",
"VERSION.yml",
"lib/subdomain-fu.rb",
+ "lib/subdomain_fu/rails.rb",
"lib/subdomain_fu/url_rewriter.rb",
- "rails/init.rb",
- "spec/spec.opts",
- "spec/spec_helper.rb",
- "spec/subdomain_fu_spec.rb",
- "spec/url_rewriter_spec.rb"
+ "subdomain-fu.gemspec"
]
s.homepage = %q{http://github.com/mbleigh/subdomain-fu}
s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"]
s.rubyforge_project = %q{subdomain-fu}
- s.rubygems_version = %q{1.3.5}
+ s.rubygems_version = %q{1.3.6}
s.summary = %q{SubdomainFu is a Rails plugin that provides subdomain routing and URL writing helpers.}
s.test_files = [
"spec/spec_helper.rb",

0 comments on commit 763410b

Please sign in to comment.