Module: MongoMapperExt
- Defined in:
- lib/mongomapper_ext.rb,
lib/mongomapper_ext/file.rb,
lib/mongomapper_ext/tags.rb,
lib/mongomapper_ext/filter.rb,
lib/mongomapper_ext/update.rb,
lib/mongomapper_ext/storage.rb,
lib/mongomapper_ext/slugizer.rb,
lib/mongomapper_ext/file_list.rb,
lib/mongomapper_ext/paginator.rb,
lib/mongomapper_ext/file_server.rb
Defined Under Namespace
Modules: Filter, Slugizer, Storage, Tags, Update
Classes: File, FileList, FileServer, Paginator
Class Method Summary
collapse
Class Method Details
.init ⇒ Object
43
44
45
|
# File 'lib/mongomapper_ext.rb', line 43
def self.init
load_jsfiles(::File.dirname(__FILE__)+"/mongomapper_ext/js")
end
|
.load_jsfiles(path) ⇒ Object
47
48
49
50
51
52
53
54
55
|
# File 'lib/mongomapper_ext.rb', line 47
def self.load_jsfiles(path)
Dir.glob(::File.join(path, "*.js")) do |js_path|
code = ::File.read(js_path)
name = ::File.basename(js_path, ".js")
MongoMapper.database.eval("db.system.js.save({_id: '#{name}', value: #{code}})")
end
end
|