mongo_session_store-rails3 3.0.3 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
data/Gemfile CHANGED
@@ -20,7 +20,28 @@ gemspec
20
20
  group :development, :test do
21
21
  gem 'rake'
22
22
  gem 'mongo_mapper', '>= 0.10.1'
23
- gem 'mongoid', '>= 2.2.5'
23
+
24
+ # this is hack-tastic :{
25
+ # ENV['RAILS_VERS'] is only provided when we run
26
+ # bundle update, but not when running the specs proper
27
+ # we need an older version of mongoid for Rails 3.0
28
+ # and bundler won't cherry-pick a matching gem version
29
+ # out of a git repo like it will out of the rubygems repo
30
+ if ENV['RAILS_VERS'] == '3.0' || RUBY_VERSION[0..2] == "1.8"
31
+ # bundle updating for Rails 3.0
32
+ # OR we're still on Ruby 1.8
33
+ gem 'mongoid', '>= 2.2.5'
34
+ elsif ENV['RAILS_VERS']
35
+ # bundle updating for Rails 3.1 or 3.2 on Ruby 1.9
36
+ gem 'mongoid', '>= 2.2.5', :git => 'git://github.com/mongoid/mongoid.git'
37
+ elsif File.read('Gemfile.lock') =~ /^ rails \(3.0.\d+\)/
38
+ # we're running tests on Rails 3.0 on Ruby 1.9
39
+ gem 'mongoid', '>= 2.2.5'
40
+ else
41
+ # we're running tests on Rails 3.1 or 3.2 on Ruby 1.9
42
+ gem 'mongoid', '>= 2.2.5', :git => 'git://github.com/mongoid/mongoid.git'
43
+ end
44
+
24
45
  gem 'mongo', MONGO_VERS
25
46
  gem 'bson_ext', MONGO_VERS
26
47
 
data/Rakefile CHANGED
@@ -5,6 +5,8 @@ def run_with_output(command)
5
5
  puts "Running: #{command}"
6
6
 
7
7
  Process.wait( fork { exec command } )
8
+
9
+ $?.success?
8
10
  end
9
11
 
10
12
  def set_rails_version(rails_vers)
@@ -27,14 +29,28 @@ task :test_all do
27
29
 
28
30
  orms = ['mongo_mapper', 'mongoid', 'mongo']
29
31
 
32
+ @failed_suites = []
33
+
30
34
  @rails_versions.each do |rails_version|
31
35
 
32
36
  set_rails_version(rails_version)
33
37
 
34
38
  orms.each do |orm|
35
- run_with_output "export MONGO_SESSION_STORE_ORM=#{orm}; bundle exec rspec spec"
39
+ unless run_with_output "export MONGO_SESSION_STORE_ORM=#{orm}; bundle exec rspec spec"
40
+ @failed_suites << "Rails #{rails_version} / #{orm}"
41
+ end
36
42
  end
43
+ end
37
44
 
45
+ if @failed_suites.any?
46
+ puts "\033[0;31mFailed:"
47
+ puts @failed_suites.join("\n")
48
+ print "\033[0m"
49
+ exit(1)
50
+ else
51
+ print "\033[0;32mAll passed! Success! "
52
+ "Yahoooo!!!".chars.each { |c| sleep 0.4; print c; STDOUT.flush }
53
+ puts "\033[0m"
38
54
  end
39
55
  end
40
56
 
@@ -3,6 +3,8 @@ require 'securerandom'
3
3
  $:.unshift File.dirname(__FILE__)
4
4
 
5
5
  module MongoSessionStore
6
+ autoload :VERSION, 'mongo_session_store/version'
7
+
6
8
  def self.collection_name=(name)
7
9
  @collection_name = name
8
10
 
@@ -27,6 +29,6 @@ module MongoSessionStore
27
29
  self.collection_name = "sessions"
28
30
  end
29
31
 
30
- autoload :MongoMapperStore,'mongo_session_store/mongo_mapper_store'
31
- autoload :MongoidStore, 'mongo_session_store/mongoid_store'
32
- autoload :MongoStore, 'mongo_session_store/mongo_store'
32
+ autoload :MongoMapperStore, 'mongo_session_store/mongo_mapper_store'
33
+ autoload :MongoidStore, 'mongo_session_store/mongoid_store'
34
+ autoload :MongoStore, 'mongo_session_store/mongo_store'
@@ -10,7 +10,12 @@ module ActionDispatch
10
10
  include Mongoid::Timestamps
11
11
  self.collection_name = MongoSessionStore.collection_name
12
12
 
13
- identity :type => String
13
+ if respond_to?(:identity)
14
+ # pre-Mongoid 3
15
+ identity :type => String
16
+ else
17
+ field :_id, :type => String
18
+ end
14
19
 
15
20
  field :data, :type => BSON::Binary, :default => BSON::Binary.new(Marshal.dump({}))
16
21
  end
@@ -0,0 +1,3 @@
1
+ module MongoSessionStore
2
+ VERSION = "3.0.4"
3
+ end
@@ -1,6 +1,8 @@
1
+ require File.expand_path('../lib/mongo_session_store/version', __FILE__)
2
+
1
3
  Gem::Specification.new do |s|
2
4
  s.name = "mongo_session_store-rails3"
3
- s.version = `cat VERSION`.strip
5
+ s.version = MongoSessionStore::VERSION
4
6
 
5
7
  s.authors = ["Brian Hempel", "Nicolas M\303\251rouze", "Tony Pitale", "Chris Brickley"]
6
8
  s.email = ["plasticchicken@gmail.com"]
@@ -5,4 +5,40 @@ class User
5
5
  devise :database_authenticatable, :registerable, :validatable
6
6
  #:recoverable, :rememberable, :trackable, :validatable
7
7
 
8
+ # see https://github.com/plataformatec/devise/wiki/How-To:-Upgrade-to-Devise-2.0-migration-schema-style
9
+
10
+ ## Database authenticatable
11
+ field :email, :type => String, :null => false
12
+ field :encrypted_password, :type => String, :null => false
13
+
14
+ ## Recoverable
15
+ # field :reset_password_token, :type => String
16
+ # field :reset_password_sent_at, :type => Time
17
+
18
+ ## Rememberable
19
+ # field :remember_created_at, :type => Time
20
+
21
+ ## Trackable
22
+ # field :sign_in_count, :type => Integer
23
+ # field :current_sign_in_at, :type => Time
24
+ # field :last_sign_in_at, :type => Time
25
+ # field :current_sign_in_ip, :type => String
26
+ # field :last_sign_in_ip, :type => String
27
+
28
+ ## Encryptable
29
+ # field :password_salt, :type => String
30
+
31
+ ## Confirmable
32
+ # field :confirmation_token, :type => String
33
+ # field :confirmed_at, :type => Time
34
+ # field :confirmation_sent_at, :type => Time
35
+ # field :unconfirmed_email, :type => String # Only if using reconfirmable
36
+
37
+ ## Lockable
38
+ # field :failed_attempts, :type => Integer # Only if lock strategy is :failed_attempts
39
+ # field :unlock_token, :type => String # Only if unlock strategy is :email or :both
40
+ # field :locked_at, :type => Time
41
+
42
+ # Token authenticatable
43
+ # field :authentication_token, :type => String
8
44
  end
@@ -1,6 +1,9 @@
1
1
  # Use this hook to configure devise mailer, warden hooks and so forth. The first
2
2
  # four configuration values can also be set straight in your models.
3
3
  Devise.setup do |config|
4
+
5
+ Devise.apply_schema = false
6
+
4
7
  # ==> Mailer Configuration
5
8
  # Configure the e-mail address which will be shown in DeviseMailer.
6
9
  config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"
@@ -34,7 +34,9 @@ en:
34
34
  confirmed: 'Your account was successfully confirmed. You are now signed in.'
35
35
  registrations:
36
36
  signed_up: 'Welcome! You have signed up successfully.'
37
- inactive_signed_up: 'You have signed up successfully. However, we could not sign you in because your account is %{reason}.'
37
+ signed_up_but_unconfirmed: 'A message with a confirmation link has been sent to your email address. Please open the link to activate your account.'
38
+ signed_up_but_inactive: 'You have signed up successfully. However, we could not sign you in because your account is not yet activated.'
39
+ signed_up_but_locked: 'You have signed up successfully. However, we could not sign you in because your account is locked.'
38
40
  updated: 'You updated your account successfully.'
39
41
  destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
40
42
  unlocks:
@@ -5,4 +5,40 @@ class User
5
5
  devise :database_authenticatable, :registerable, :validatable
6
6
  #:recoverable, :rememberable, :trackable, :validatable
7
7
 
8
+ # see https://github.com/plataformatec/devise/wiki/How-To:-Upgrade-to-Devise-2.0-migration-schema-style
9
+
10
+ ## Database authenticatable
11
+ field :email, :type => String, :null => false
12
+ field :encrypted_password, :type => String, :null => false
13
+
14
+ ## Recoverable
15
+ # field :reset_password_token, :type => String
16
+ # field :reset_password_sent_at, :type => Time
17
+
18
+ ## Rememberable
19
+ # field :remember_created_at, :type => Time
20
+
21
+ ## Trackable
22
+ # field :sign_in_count, :type => Integer
23
+ # field :current_sign_in_at, :type => Time
24
+ # field :last_sign_in_at, :type => Time
25
+ # field :current_sign_in_ip, :type => String
26
+ # field :last_sign_in_ip, :type => String
27
+
28
+ ## Encryptable
29
+ # field :password_salt, :type => String
30
+
31
+ ## Confirmable
32
+ # field :confirmation_token, :type => String
33
+ # field :confirmed_at, :type => Time
34
+ # field :confirmation_sent_at, :type => Time
35
+ # field :unconfirmed_email, :type => String # Only if using reconfirmable
36
+
37
+ ## Lockable
38
+ # field :failed_attempts, :type => Integer # Only if lock strategy is :failed_attempts
39
+ # field :unlock_token, :type => String # Only if unlock strategy is :email or :both
40
+ # field :locked_at, :type => Time
41
+
42
+ # Token authenticatable
43
+ # field :authentication_token, :type => String
8
44
  end
@@ -1,6 +1,9 @@
1
1
  # Use this hook to configure devise mailer, warden hooks and so forth. The first
2
2
  # four configuration values can also be set straight in your models.
3
3
  Devise.setup do |config|
4
+
5
+ Devise.apply_schema = false
6
+
4
7
  # ==> Mailer Configuration
5
8
  # Configure the e-mail address which will be shown in DeviseMailer.
6
9
  config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"
@@ -34,7 +34,9 @@ en:
34
34
  confirmed: 'Your account was successfully confirmed. You are now signed in.'
35
35
  registrations:
36
36
  signed_up: 'Welcome! You have signed up successfully.'
37
- inactive_signed_up: 'You have signed up successfully. However, we could not sign you in because your account is %{reason}.'
37
+ signed_up_but_unconfirmed: 'A message with a confirmation link has been sent to your email address. Please open the link to activate your account.'
38
+ signed_up_but_inactive: 'You have signed up successfully. However, we could not sign you in because your account is not yet activated.'
39
+ signed_up_but_locked: 'You have signed up successfully. However, we could not sign you in because your account is locked.'
38
40
  updated: 'You updated your account successfully.'
39
41
  destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
40
42
  unlocks:
data/spec/spec_helper.rb CHANGED
@@ -30,4 +30,11 @@ RSpec.configure do |config|
30
30
  end
31
31
  end
32
32
 
33
- puts "Testing #{ENV["MONGO_SESSION_STORE_ORM"]}_store on Rails #{Rails.version}..."
33
+ puts "Testing #{ENV["MONGO_SESSION_STORE_ORM"]}_store on Rails #{Rails.version}..."
34
+
35
+ case ENV["MONGO_SESSION_STORE_ORM"]
36
+ when "mongo_mapper"
37
+ puts "MongoMapper version: #{MongoMapper::Version}"
38
+ when "mongoid"
39
+ puts "Mongoid version: #{Mongoid::VERSION}"
40
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongo_session_store-rails3
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 0
9
- - 3
10
- version: 3.0.3
9
+ - 4
10
+ version: 3.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Brian Hempel
@@ -18,7 +18,7 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2012-01-31 00:00:00 Z
21
+ date: 2012-02-04 00:00:00 Z
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
24
24
  name: mongo
@@ -60,15 +60,16 @@ extra_rdoc_files: []
60
60
 
61
61
  files:
62
62
  - .gitignore
63
+ - .rspec
63
64
  - Gemfile
64
65
  - README.md
65
66
  - Rakefile
66
- - VERSION
67
67
  - lib/mongo_session_store-rails3.rb
68
68
  - lib/mongo_session_store/mongo_mapper_store.rb
69
69
  - lib/mongo_session_store/mongo_store.rb
70
70
  - lib/mongo_session_store/mongo_store_base.rb
71
71
  - lib/mongo_session_store/mongoid_store.rb
72
+ - lib/mongo_session_store/version.rb
72
73
  - mongo_session_store-rails3.gemspec
73
74
  - perf/benchmark.rb
74
75
  - spec/integration_with_devise_spec.rb
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 3.0.3