trackoid 0.1.10 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +5 -7
- data/VERSION +1 -1
- data/lib/trackoid/tracker.rb +8 -0
- data/lib/trackoid/tracking.rb +1 -1
- data/spec/aggregates_spec.rb +1 -1
- data/spec/spec_helper.rb +4 -4
- data/trackoid.gemspec +24 -26
- metadata +8 -13
- data/.gitignore +0 -21
data/Rakefile
CHANGED
@@ -10,7 +10,7 @@ begin
|
|
10
10
|
gem.email = "josemiguel@perezruiz.com"
|
11
11
|
gem.homepage = "http://github.com/twoixter/trackoid"
|
12
12
|
gem.authors = ["Jose Miguel Perez"]
|
13
|
-
gem.add_development_dependency "rspec", ">=
|
13
|
+
gem.add_development_dependency "rspec", ">= 2.2.0"
|
14
14
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
15
15
|
end
|
16
16
|
Jeweler::GemcutterTasks.new
|
@@ -18,14 +18,12 @@ rescue LoadError
|
|
18
18
|
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
19
19
|
end
|
20
20
|
|
21
|
-
require '
|
22
|
-
|
23
|
-
spec.
|
24
|
-
spec.spec_files = FileList['spec/**/*_spec.rb']
|
21
|
+
require 'rspec/core/rake_task'
|
22
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
23
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
25
24
|
end
|
26
25
|
|
27
|
-
|
28
|
-
spec.libs << 'lib' << 'spec'
|
26
|
+
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
29
27
|
spec.pattern = 'spec/**/*_spec.rb'
|
30
28
|
spec.rcov = true
|
31
29
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.11
|
data/lib/trackoid/tracker.rb
CHANGED
@@ -34,6 +34,14 @@ module Mongoid #:nodoc:
|
|
34
34
|
# Update methods
|
35
35
|
def add(how_much = 1, date = Date.today)
|
36
36
|
raise Errors::ModelNotSaved, "Can't update a new record. Save first!" if @owner.new_record?
|
37
|
+
return if how_much == 0
|
38
|
+
|
39
|
+
# Note that the following #update_data method updates our local data
|
40
|
+
# and the current value might differ from the actual value on the
|
41
|
+
# database. Basically, what we do is update our own copy as a cache
|
42
|
+
# but send the command to atomically update the database: we don't
|
43
|
+
# read the actual value in return so that we save round trip delays.
|
44
|
+
#
|
37
45
|
update_data(data_for(date) + how_much, date)
|
38
46
|
@owner.collection.update(
|
39
47
|
@owner._selector,
|
data/lib/trackoid/tracking.rb
CHANGED
data/spec/aggregates_spec.rb
CHANGED
@@ -25,7 +25,7 @@ class SecondTestModel
|
|
25
25
|
|
26
26
|
aggregate :aggregate_one do 1 end
|
27
27
|
aggregate :aggregate_two do "p" end
|
28
|
-
aggregate :aggregate_three do BSON::
|
28
|
+
aggregate :aggregate_three do BSON::ObjectId("4c4121857bc3cd0d78cb65b2") end
|
29
29
|
aggregate :aggregate_four do Time.now end
|
30
30
|
end
|
31
31
|
|
data/spec/spec_helper.rb
CHANGED
@@ -7,8 +7,9 @@ gem 'mocha', '>= 0.9.8'
|
|
7
7
|
require 'mocha'
|
8
8
|
require 'mongoid'
|
9
9
|
require 'trackoid'
|
10
|
-
require '
|
11
|
-
require '
|
10
|
+
require 'bson'
|
11
|
+
require 'rspec'
|
12
|
+
require 'rspec/autorun'
|
12
13
|
|
13
14
|
Mongoid.configure do |config|
|
14
15
|
name = "trackoid_test"
|
@@ -16,10 +17,9 @@ Mongoid.configure do |config|
|
|
16
17
|
port = "27017"
|
17
18
|
# config.master = Mongo::Connection.new(host, port, :logger => Logger.new(STDOUT)).db(name)
|
18
19
|
config.master = Mongo::Connection.new.db(name)
|
19
|
-
config.use_object_ids = true
|
20
20
|
end
|
21
21
|
|
22
|
-
|
22
|
+
RSpec.configure do |config|
|
23
23
|
config.mock_with :mocha
|
24
24
|
config.before :suite do
|
25
25
|
Mongoid.master.collections.reject { |c| c.name =~ /^system\./ }.each(&:drop)
|
data/trackoid.gemspec
CHANGED
@@ -1,49 +1,47 @@
|
|
1
1
|
# Generated by jeweler
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{trackoid}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.11"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Jose Miguel Perez"]
|
12
|
-
s.date = %q{
|
12
|
+
s.date = %q{2011-03-11}
|
13
13
|
s.description = %q{Trackoid uses an embeddable approach to track analytics data using the poweful features of MongoDB for scalability}
|
14
14
|
s.email = %q{josemiguel@perezruiz.com}
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE",
|
17
|
-
|
17
|
+
"README.rdoc"
|
18
18
|
]
|
19
19
|
s.files = [
|
20
20
|
".document",
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
"trackoid.gemspec"
|
21
|
+
"LICENSE",
|
22
|
+
"README.rdoc",
|
23
|
+
"Rakefile",
|
24
|
+
"VERSION",
|
25
|
+
"lib/trackoid.rb",
|
26
|
+
"lib/trackoid/aggregates.rb",
|
27
|
+
"lib/trackoid/errors.rb",
|
28
|
+
"lib/trackoid/tracker.rb",
|
29
|
+
"lib/trackoid/tracker_aggregates.rb",
|
30
|
+
"lib/trackoid/tracking.rb",
|
31
|
+
"spec/aggregates_spec.rb",
|
32
|
+
"spec/spec.opts",
|
33
|
+
"spec/spec_helper.rb",
|
34
|
+
"spec/trackoid_spec.rb",
|
35
|
+
"trackoid.gemspec"
|
37
36
|
]
|
38
37
|
s.homepage = %q{http://github.com/twoixter/trackoid}
|
39
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
40
38
|
s.require_paths = ["lib"]
|
41
39
|
s.rubygems_version = %q{1.3.7}
|
42
40
|
s.summary = %q{Trackoid is an easy scalable analytics tracker using MongoDB and Mongoid}
|
43
41
|
s.test_files = [
|
44
42
|
"spec/aggregates_spec.rb",
|
45
|
-
|
46
|
-
|
43
|
+
"spec/spec_helper.rb",
|
44
|
+
"spec/trackoid_spec.rb"
|
47
45
|
]
|
48
46
|
|
49
47
|
if s.respond_to? :specification_version then
|
@@ -51,12 +49,12 @@ Gem::Specification.new do |s|
|
|
51
49
|
s.specification_version = 3
|
52
50
|
|
53
51
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
54
|
-
s.add_development_dependency(%q<rspec>, [">=
|
52
|
+
s.add_development_dependency(%q<rspec>, [">= 2.2.0"])
|
55
53
|
else
|
56
|
-
s.add_dependency(%q<rspec>, [">=
|
54
|
+
s.add_dependency(%q<rspec>, [">= 2.2.0"])
|
57
55
|
end
|
58
56
|
else
|
59
|
-
s.add_dependency(%q<rspec>, [">=
|
57
|
+
s.add_dependency(%q<rspec>, [">= 2.2.0"])
|
60
58
|
end
|
61
59
|
end
|
62
60
|
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trackoid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 15
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
7
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
8
|
+
- 11
|
9
|
+
version: 0.1.11
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Jose Miguel Perez
|
@@ -15,7 +14,7 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date:
|
17
|
+
date: 2011-03-11 00:00:00 +01:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
@@ -26,12 +25,11 @@ dependencies:
|
|
26
25
|
requirements:
|
27
26
|
- - ">="
|
28
27
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 13
|
30
28
|
segments:
|
31
|
-
- 1
|
32
29
|
- 2
|
33
|
-
-
|
34
|
-
|
30
|
+
- 2
|
31
|
+
- 0
|
32
|
+
version: 2.2.0
|
35
33
|
type: :development
|
36
34
|
version_requirements: *id001
|
37
35
|
description: Trackoid uses an embeddable approach to track analytics data using the poweful features of MongoDB for scalability
|
@@ -45,7 +43,6 @@ extra_rdoc_files:
|
|
45
43
|
- README.rdoc
|
46
44
|
files:
|
47
45
|
- .document
|
48
|
-
- .gitignore
|
49
46
|
- LICENSE
|
50
47
|
- README.rdoc
|
51
48
|
- Rakefile
|
@@ -66,8 +63,8 @@ homepage: http://github.com/twoixter/trackoid
|
|
66
63
|
licenses: []
|
67
64
|
|
68
65
|
post_install_message:
|
69
|
-
rdoc_options:
|
70
|
-
|
66
|
+
rdoc_options: []
|
67
|
+
|
71
68
|
require_paths:
|
72
69
|
- lib
|
73
70
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -75,7 +72,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
75
72
|
requirements:
|
76
73
|
- - ">="
|
77
74
|
- !ruby/object:Gem::Version
|
78
|
-
hash: 3
|
79
75
|
segments:
|
80
76
|
- 0
|
81
77
|
version: "0"
|
@@ -84,7 +80,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
80
|
requirements:
|
85
81
|
- - ">="
|
86
82
|
- !ruby/object:Gem::Version
|
87
|
-
hash: 3
|
88
83
|
segments:
|
89
84
|
- 0
|
90
85
|
version: "0"
|