Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add plugin

  • Loading branch information...
commit c65b6b8b098ed0d27fdde73b53d843b34220683a 1 parent 55287e3
@onemanstartup onemanstartup authored
Showing with 28 additions and 3 deletions.
  1. +2 −3 Rakefile
  2. +26 −0 lib/blank_plugin.rb
View
5 Rakefile
@@ -5,12 +5,11 @@ begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "blank_plugin"
- gem.summary = %Q{TODO: one-line summary of your gem}
- gem.description = %Q{TODO: longer description of your gem}
+ gem.summary = %Q{Blank Plugin for mongomapper}
+ gem.description = %Q{Blank Plugin for mongomapper}
gem.email = "onemanstartup@gmail.com"
gem.homepage = "http://github.com/BadMinus/blank_plugin"
gem.authors = ["Plehanov Dmitriy"]
- gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
end
Jeweler::GemcutterTasks.new
View
26 lib/blank_plugin.rb
@@ -0,0 +1,26 @@
+require "mongo_mapper"
+
+module MongoMapper
+ module Plugins
+ module BlankPlugin
+ def self.included(model)
+ model.plugin BlankPlugin
+ end
+
+
+ module ClassMethods
+ def foo_method
+ MongoMapper.foo_method
+ end
+ end
+
+ module InstanceMethods
+ def foo_method
+ self.class.foo_method
+ end
+ end
+ end
+ end
+end
+
+MongoMapper::Document.append_inclusions(BlankPlugin)
Please sign in to comment.
Something went wrong with that request. Please try again.