Permalink
Browse files

Extracted rails specific code into janus/rails, in order to allow the…

… use of janus into a non-rails app (like rack or sinatra). Rails applications now have to require "janus/rails".
  • Loading branch information...
1 parent 49b63aa commit 2b9aaa3783e2b790fed54e50eb3a7e75a4dc8f79 @ysbaddaden committed Jan 30, 2012
Showing with 101 additions and 86 deletions.
  1. +1 −1 Rakefile
  2. +1 −13 lib/janus.rb
  3. +17 −0 lib/janus/rails.rb
  4. +2 −2 test/rails_app/Gemfile
  5. +80 −70 test/rails_app/Gemfile.lock
View
@@ -51,7 +51,7 @@ begin
gem.authors = ['Julien Portalier']
gem.files = root_files + FileList["{lib}/*"] + FileList["{lib}/**/*"]
gem.extra_rdoc_files = root_files
- gem.add_dependency 'rails', '~> 3.0'
+# gem.add_dependency 'rails', '~> 3.0'
gem.add_dependency 'bcrypt-ruby'
gem.add_dependency 'addressable'
end
View
@@ -1,8 +1,8 @@
+require 'active_support/core_ext/class'
require 'janus/config'
require 'janus/hooks'
require 'janus/strategies'
require 'janus/manager'
-require 'janus/routes'
autoload :JanusHelper, 'janus/helper'
@@ -16,18 +16,6 @@ def initialize(scope)
end
end
- autoload :Mailer, 'janus/mailer'
- autoload :TestHelper, 'janus/test_helper'
-
- autoload :Helpers, 'janus/controllers/helpers'
- autoload :UrlHelpers, 'janus/controllers/url_helpers'
- autoload :InternalHelpers, 'janus/controllers/internal_helpers'
-
- autoload :SessionsController, 'janus/controllers/sessions_controller'
- autoload :RegistrationsController, 'janus/controllers/registrations_controller'
- autoload :ConfirmationsController, 'janus/controllers/confirmations_controller'
- autoload :PasswordsController, 'janus/controllers/passwords_controller'
-
module Models
autoload :Base, 'janus/models/base'
autoload :DatabaseAuthenticatable, 'janus/models/database_authenticatable'
View
@@ -0,0 +1,17 @@
+require 'janus'
+require 'janus/routes'
+
+module Janus
+ autoload :Mailer, 'janus/mailer'
+ autoload :TestHelper, 'janus/test_helper'
+
+ autoload :Helpers, 'janus/controllers/helpers'
+ autoload :UrlHelpers, 'janus/controllers/url_helpers'
+ autoload :InternalHelpers, 'janus/controllers/internal_helpers'
+
+ autoload :SessionsController, 'janus/controllers/sessions_controller'
+ autoload :RegistrationsController, 'janus/controllers/registrations_controller'
+ autoload :ConfirmationsController, 'janus/controllers/confirmations_controller'
+ autoload :PasswordsController, 'janus/controllers/passwords_controller'
+end
+
@@ -1,9 +1,9 @@
source 'http://rubygems.org'
-gem 'rails', '~> 3.0.9'
+gem 'rails', '~> 3.0'
#gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
gem 'capybara'
gem 'addressable'
-gem 'janus', :path => '../..'
+gem 'janus', :path => '../..', :require => "janus/rails"
@@ -1,99 +1,109 @@
PATH
remote: ../..
specs:
- janus (0.4.0)
+ janus (0.5.0)
addressable
bcrypt-ruby
- rails (~> 3.0)
GEM
remote: http://rubygems.org/
specs:
- abstract (1.0.0)
- actionmailer (3.0.9)
- actionpack (= 3.0.9)
- mail (~> 2.2.19)
- actionpack (3.0.9)
- activemodel (= 3.0.9)
- activesupport (= 3.0.9)
- builder (~> 2.1.2)
- erubis (~> 2.6.6)
- i18n (~> 0.5.0)
- rack (~> 1.2.1)
- rack-mount (~> 0.6.14)
- rack-test (~> 0.5.7)
- tzinfo (~> 0.3.23)
- activemodel (3.0.9)
- activesupport (= 3.0.9)
- builder (~> 2.1.2)
- i18n (~> 0.5.0)
- activerecord (3.0.9)
- activemodel (= 3.0.9)
- activesupport (= 3.0.9)
- arel (~> 2.0.10)
- tzinfo (~> 0.3.23)
- activeresource (3.0.9)
- activemodel (= 3.0.9)
- activesupport (= 3.0.9)
- activesupport (3.0.9)
+ actionmailer (3.2.1)
+ actionpack (= 3.2.1)
+ mail (~> 2.4.0)
+ actionpack (3.2.1)
+ activemodel (= 3.2.1)
+ activesupport (= 3.2.1)
+ builder (~> 3.0.0)
+ erubis (~> 2.7.0)
+ journey (~> 1.0.1)
+ rack (~> 1.4.0)
+ rack-cache (~> 1.1)
+ rack-test (~> 0.6.1)
+ sprockets (~> 2.1.2)
+ activemodel (3.2.1)
+ activesupport (= 3.2.1)
+ builder (~> 3.0.0)
+ activerecord (3.2.1)
+ activemodel (= 3.2.1)
+ activesupport (= 3.2.1)
+ arel (~> 3.0.0)
+ tzinfo (~> 0.3.29)
+ activeresource (3.2.1)
+ activemodel (= 3.2.1)
+ activesupport (= 3.2.1)
+ activesupport (3.2.1)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
addressable (2.2.6)
- arel (2.0.10)
- bcrypt-ruby (2.1.4)
- builder (2.1.2)
- capybara (1.0.0)
+ arel (3.0.0)
+ bcrypt-ruby (3.0.1)
+ builder (3.0.0)
+ capybara (1.1.2)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
- selenium-webdriver (~> 0.2.0)
+ selenium-webdriver (~> 2.0)
xpath (~> 0.1.4)
- childprocess (0.1.9)
+ childprocess (0.3.0)
ffi (~> 1.0.6)
- erubis (2.6.6)
- abstract (>= 1.0.0)
- ffi (1.0.9)
- i18n (0.5.0)
- json_pure (1.5.3)
- mail (2.2.19)
- activesupport (>= 2.3.6)
+ erubis (2.7.0)
+ ffi (1.0.11)
+ hike (1.2.1)
+ i18n (0.6.0)
+ journey (1.0.1)
+ json (1.6.5)
+ mail (2.4.1)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
- mime-types (1.16)
+ mime-types (1.17.2)
+ multi_json (1.0.4)
nokogiri (1.5.0)
- polyglot (0.3.1)
- rack (1.2.3)
- rack-mount (0.6.14)
- rack (>= 1.0.0)
- rack-test (0.5.7)
+ polyglot (0.3.3)
+ rack (1.4.1)
+ rack-cache (1.1)
+ rack (>= 0.4)
+ rack-ssl (1.3.2)
+ rack
+ rack-test (0.6.1)
rack (>= 1.0)
- rails (3.0.9)
- actionmailer (= 3.0.9)
- actionpack (= 3.0.9)
- activerecord (= 3.0.9)
- activeresource (= 3.0.9)
- activesupport (= 3.0.9)
+ rails (3.2.1)
+ actionmailer (= 3.2.1)
+ actionpack (= 3.2.1)
+ activerecord (= 3.2.1)
+ activeresource (= 3.2.1)
+ activesupport (= 3.2.1)
bundler (~> 1.0)
- railties (= 3.0.9)
- railties (3.0.9)
- actionpack (= 3.0.9)
- activesupport (= 3.0.9)
+ railties (= 3.2.1)
+ railties (3.2.1)
+ actionpack (= 3.2.1)
+ activesupport (= 3.2.1)
+ rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
- thor (~> 0.14.4)
- rake (0.9.2)
- rdoc (3.8)
- rubyzip (0.9.4)
- selenium-webdriver (0.2.2)
- childprocess (>= 0.1.9)
- ffi (>= 1.0.7)
- json_pure
+ thor (~> 0.14.6)
+ rake (0.9.2.2)
+ rdoc (3.12)
+ json (~> 1.4)
+ rubyzip (0.9.5)
+ selenium-webdriver (2.18.0)
+ childprocess (>= 0.2.5)
+ ffi (~> 1.0.9)
+ multi_json (~> 1.0.4)
rubyzip
- sqlite3 (1.3.3)
+ sprockets (2.1.2)
+ hike (~> 1.2)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
+ sqlite3 (1.3.5)
thor (0.14.6)
- treetop (1.4.9)
+ tilt (1.3.3)
+ treetop (1.4.10)
+ polyglot
polyglot (>= 0.3.1)
- tzinfo (0.3.29)
+ tzinfo (0.3.31)
xpath (0.1.4)
nokogiri (~> 1.3)
@@ -104,5 +114,5 @@ DEPENDENCIES
addressable
capybara
janus!
- rails (~> 3.0.9)
+ rails (~> 3.0)
sqlite3

0 comments on commit 2b9aaa3

Please sign in to comment.