rapidmango-events 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -0
- data/app/models/RPM/event.rb +36 -0
- metadata +63 -0
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.1
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module RPM
|
2
|
+
class Event
|
3
|
+
|
4
|
+
@@unsent_data = []
|
5
|
+
|
6
|
+
# Creates the event log but doesn't yet commit to the database. Example:
|
7
|
+
#
|
8
|
+
# RPM::Event.log("signup")
|
9
|
+
# or
|
10
|
+
# RPM::Event.log("signup", 199)
|
11
|
+
#
|
12
|
+
def self.log(key, value = nil, created_date = Date.today, created_hour = Time.now.hour)
|
13
|
+
@@unsent_data << [key, value, created_date, created_hour]
|
14
|
+
# this could potentially contain logic to bump counts in order to send less data over the wire?
|
15
|
+
true
|
16
|
+
end
|
17
|
+
|
18
|
+
# Commits created event logs to the database. Example:
|
19
|
+
#
|
20
|
+
# RPM::Event.commit => true
|
21
|
+
#
|
22
|
+
def self.commit
|
23
|
+
# TODO: Send this data over the wire eg. using a beanstalk or something
|
24
|
+
::Event.process_events(@@unsent_data)
|
25
|
+
@@unsent_data = []
|
26
|
+
true
|
27
|
+
end
|
28
|
+
|
29
|
+
# Returns a simple array data structure of results
|
30
|
+
def self.query(*params)
|
31
|
+
::Event.all.collect(&:to_hash)
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
metadata
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rapidmango-events
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
version: 0.0.1
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Rapid Mango
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2010-04-01 00:00:00 +11:00
|
18
|
+
default_executable:
|
19
|
+
dependencies: []
|
20
|
+
|
21
|
+
description: Client API for events web service
|
22
|
+
email: operations@rapidmango.com.au
|
23
|
+
executables: []
|
24
|
+
|
25
|
+
extensions: []
|
26
|
+
|
27
|
+
extra_rdoc_files: []
|
28
|
+
|
29
|
+
files:
|
30
|
+
- VERSION
|
31
|
+
- app/models/RPM/event.rb
|
32
|
+
has_rdoc: true
|
33
|
+
homepage: http://www.rapidmango.com.au
|
34
|
+
licenses: []
|
35
|
+
|
36
|
+
post_install_message:
|
37
|
+
rdoc_options:
|
38
|
+
- --charset=UTF-8
|
39
|
+
require_paths:
|
40
|
+
- lib
|
41
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
segments:
|
46
|
+
- 0
|
47
|
+
version: "0"
|
48
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
segments:
|
53
|
+
- 0
|
54
|
+
version: "0"
|
55
|
+
requirements: []
|
56
|
+
|
57
|
+
rubyforge_project:
|
58
|
+
rubygems_version: 1.3.6
|
59
|
+
signing_key:
|
60
|
+
specification_version: 3
|
61
|
+
summary: Client for events service
|
62
|
+
test_files: []
|
63
|
+
|