Skip to content
Browse files

Double gemspecs!

  • Loading branch information...
1 parent a4fbb92 commit 5817ce42f461e53249edb706b3a19716d8055642 @brianhempel committed Mar 1, 2014
View
2 Gemfile
@@ -15,7 +15,7 @@ RAILS_VERS = case ENV['RAILS_VERS']
raise "Invalid RAILS_VERS. Available versions are 3.2 and 4.0."
end
-gemspec
+gemspec :name => 'mongo_session_store-rails4'
group :development, :test do
gem 'rake'
View
2 Rakefile
@@ -1,7 +1,7 @@
require 'rubygems'
require 'rake'
require 'bundler'
-Bundler::GemHelper.install_tasks
+Bundler::GemHelper.install_tasks :name => 'mongo_session_store-rails4'
def run_with_output(command)
puts "Running: #{command}"
View
51 lib/mongo_session_store-rails3.rb
@@ -1,50 +1 @@
-require 'securerandom'
-
-$:.unshift File.dirname(__FILE__)
-
-module MongoSessionStore
- autoload :VERSION, 'mongo_session_store/version'
-
- def self.collection_name=(name)
- @collection_name = name
-
- if defined?(MongoStore::Session)
- MongoStore::Session.reset_collection
- end
-
- if defined?(MongoMapperStore::Session)
- MongoMapperStore::Session.set_collection_name(name)
- end
-
- if defined?(MongoidStore::Session)
-
- MongoidStore::Session.store_in :collection => MongoSessionStore.collection_name
- end
-
- @collection_name
- end
-
- def self.collection_name
- @collection_name
- end
-
- # default collection name for all the stores
- self.collection_name = "sessions"
-end
-
-# we don't use autoloading because of thread concerns
-# hence, this mess
-load_errors = []
-
-%w(mongo_mapper_store mongoid_store mongo_store).each do |store_name|
- begin
- require "mongo_session_store/#{store_name}"
- rescue LoadError => e
- load_errors << e
- end
-end
-
-if load_errors.count == 3
- message = "Could not load any session store!\n" + load_errors.map(&:message).join("\n")
- raise LoadError, message
-end
+require 'mongo_session_store'
View
1 lib/mongo_session_store-rails4.rb
@@ -0,0 +1 @@
+require 'mongo_session_store'
View
49 lib/mongo_session_store.rb
@@ -0,0 +1,49 @@
+require 'securerandom'
+
+$:.unshift File.dirname(__FILE__)
+
+module MongoSessionStore
+ autoload :VERSION, 'mongo_session_store/version'
+
+ def self.collection_name=(name)
+ @collection_name = name
+
+ if defined?(MongoStore::Session)
+ MongoStore::Session.reset_collection
+ end
+
+ if defined?(MongoMapperStore::Session)
+ MongoMapperStore::Session.set_collection_name(name)
+ end
+
+ if defined?(MongoidStore::Session)
+ MongoidStore::Session.store_in :collection => MongoSessionStore.collection_name
+ end
+
+ @collection_name
+ end
+
+ def self.collection_name
+ @collection_name
+ end
+
+ # default collection name for all the stores
+ self.collection_name = "sessions"
+end
+
+# we don't use autoloading because of thread concerns
+# hence, this mess
+load_errors = []
+
+%w(mongo_mapper_store mongoid_store mongo_store).each do |store_name|
+ begin
+ require "mongo_session_store/#{store_name}"
+ rescue LoadError => e
+ load_errors << e
+ end
+end
+
+if load_errors.count == 3
+ message = "Could not load any session store!\n" + load_errors.map(&:message).join("\n")
+ raise LoadError, message
+end
View
4 mongo_session_store-rails3.gemspec
@@ -1,7 +1,7 @@
require File.expand_path('../lib/mongo_session_store/version', __FILE__)
Gem::Specification.new do |s|
- s.name = "mongo_session_store-rails3"
+ s.name = File.basename(__FILE__).gsub(".gemspec", "")
s.version = MongoSessionStore::VERSION
s.authors = ["Brian Hempel", "Nicolas M\303\251rouze", "Tony Pitale", "Chris Brickley"]
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
s.homepage = "http://github.com/brianhempel/mongo_session_store"
s.require_paths = ["lib"]
s.rubygems_version = "1.3.7"
- s.summary = "Rails session stores for MongoMapper, Mongoid, or any other ODM. Rails 3.1 and 3.2 compatible."
+ s.summary = "Rails session stores for MongoMapper, Mongoid, or any other ODM. Rails 3.1, 3.2, 4.0, and 4.1 compatible."
s.add_dependency "actionpack", ">= 3.1"
end
View
17 mongo_session_store-rails4.gemspec
@@ -0,0 +1,17 @@
+require File.expand_path('../lib/mongo_session_store/version', __FILE__)
+
+Gem::Specification.new do |s|
+ s.name = File.basename(__FILE__).gsub(".gemspec", "")
+ s.version = MongoSessionStore::VERSION
+
+ s.authors = ["Brian Hempel", "Nicolas M\303\251rouze", "Tony Pitale", "Chris Brickley"]
+ s.email = ["plasticchicken@gmail.com"]
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {test,spec,features,perf}/*`.split("\n")
+ s.homepage = "http://github.com/brianhempel/mongo_session_store"
+ s.require_paths = ["lib"]
+ s.rubygems_version = "1.3.7"
+ s.summary = "Rails session stores for MongoMapper, Mongoid, or any other ODM. Rails 3.1, 3.2, 4.0, and 4.1 compatible."
+
+ s.add_dependency "actionpack", ">= 3.1"
+end

0 comments on commit 5817ce4

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