memdash-mongo_mapper 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1 @@
1
+ require 'memdash/adapters/mongo_mapper'
@@ -0,0 +1,4 @@
1
+ require 'memdash'
2
+ require 'memdash/adapters/mongo_mapper/client'
3
+
4
+ Memdash.backend = Memdash::Adapters::MongoMapper::Report
@@ -0,0 +1,15 @@
1
+ require 'memdash/adapters/mongo_mapper/report'
2
+
3
+ module Memdash
4
+ module Adapters
5
+ module MongoMapper
6
+ module Client
7
+ def generate_stats
8
+ Memdash::Adapters::MongoMapper::Report.create(:stats => stats)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
14
+
15
+ Dalli::Client.send(:include, Memdash::Adapters::MongoMapper::Client)
@@ -0,0 +1,19 @@
1
+ require 'mongo_mapper'
2
+
3
+ module Memdash
4
+ module Adapters
5
+ module MongoMapper
6
+ class Report
7
+ include ::MongoMapper::Document
8
+ set_collection_name "memdash_reports"
9
+
10
+ key :stats, Hash
11
+ timestamps!
12
+
13
+ def self.past_day
14
+ where(:created_at.gte => Time.current - 1.day)
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: memdash-mongo_mapper
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Brian Ryckbost
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-05-04 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: memdash
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - '='
20
+ - !ruby/object:Gem::Version
21
+ version: 0.1.0
22
+ prerelease:
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - '='
29
+ - !ruby/object:Gem::Version
30
+ version: 0.1.0
31
+ prerelease:
32
+ - !ruby/object:Gem::Dependency
33
+ name: mongo_mapper
34
+ requirement: !ruby/object:Gem::Requirement
35
+ none: false
36
+ requirements:
37
+ - - ~>
38
+ - !ruby/object:Gem::Version
39
+ version: '0.11'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ none: false
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '0.11'
48
+ description: A dashboard for your memcached, storing data in MongoMapper.
49
+ email: bryckbost@gmail.com
50
+ executables: []
51
+ extensions: []
52
+ extra_rdoc_files: []
53
+ files:
54
+ - lib/memdash-mongo_mapper.rb
55
+ - lib/memdash/adapters/mongo_mapper.rb
56
+ - lib/memdash/adapters/mongo_mapper/client.rb
57
+ - lib/memdash/adapters/mongo_mapper/report.rb
58
+ homepage: https://github.com/bryckbost/memdash
59
+ licenses: []
60
+ post_install_message:
61
+ rdoc_options: []
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ none: false
72
+ requirements:
73
+ - - ! '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ requirements: []
77
+ rubyforge_project:
78
+ rubygems_version: 1.8.21
79
+ signing_key:
80
+ specification_version: 3
81
+ summary: A dashboard for your memcached, storing data in MongoMapper.
82
+ test_files: []