Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove sugar-high dep in favor of Rails::Generators builtin `gsub_file`

  • Loading branch information...
commit 71836a4ca708f6813b3723c33c29951eb68c1779 1 parent f599771
@bmarini bmarini authored
View
2  Gemfile
@@ -11,9 +11,7 @@ group :default do
gem "webrat", "~> 0.7.2"
gem 'mongo_mapper', '~> 0.9.0'
- gem 'sugar-high', '~> 0.4.3'
gem 'devise', '>= 1.2.0'
- # gem 'rails3-generators', '>= 0.14.0'
gem 'bson_ext', '>= 1.2.0'
gem 'rake', '>= 0.8.7'
View
9 lib/generators/mongo_mapper/devise_generator.rb
@@ -1,6 +1,4 @@
require 'generators/devise/orm_helpers'
-require 'sugar-high/file'
-require 'sugar-high/file_mutate'
module MongoMapper
module Generators
@@ -11,13 +9,12 @@ def generate_model
invoke "mongo_mapper:model", [name] unless model_exists?
end
- def inject_devise_content
+ def inject_devise_content
inject_into_file model_path, model_contents, :after => "include MongoMapper::Document\n"
end
- def replace_default_devise_orm
- devise_init_file = File.join(Rails.root, 'config', 'initializers', 'devise.rb')
- File.replace_content_from devise_init_file, :where => 'orm/active_record', :with => 'orm/mongo_mapper'
+ def replace_default_devise_orm
+ gsub_file Rails.root.join("config/initializers/devise.rb"), 'orm/active_record', 'orm/mongo_mapper'
end
end
end
View
3  mm-devise.gemspec
@@ -16,8 +16,5 @@ Gem::Specification.new do |s|
s.add_dependency 'mongo_mapper', '>= 0.9.0'
s.add_dependency 'devise', '>= 1.2'
- # s.add_dependency 'rails3-generators', '>= 0.14.0'
- s.add_dependency 'sugar-high', '~> 0.4.3'
s.add_dependency "SystemTimer", "~> 1.2" if RUBY_VERSION < "1.9"
-
end
Please sign in to comment.
Something went wrong with that request. Please try again.