taggregator 0.0.2.dev
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/Gemfile +14 -0
- data/Gemfile.lock +37 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +19 -0
- data/Rakefile +53 -0
- data/VERSION +1 -0
- data/lib/taggregator.rb +231 -0
- data/taggregator.gemspec +62 -0
- data/test/helper.rb +18 -0
- data/test/test_taggregator.rb +7 -0
- metadata +121 -0
data/.document
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
# Add dependencies required to use your gem here.
|
3
|
+
# Example:
|
4
|
+
# gem "activesupport", ">= 2.3.5"
|
5
|
+
|
6
|
+
# Add dependencies to develop your gem here.
|
7
|
+
# Include everything needed to run rake, tests, features, etc.
|
8
|
+
group :development do
|
9
|
+
gem "shoulda", ">= 0"
|
10
|
+
gem "bundler", "~> 1.0.0"
|
11
|
+
gem "jeweler", "~> 1.6.2"
|
12
|
+
gem "rcov", ">= 0"
|
13
|
+
gem 'mongo_mapper', '~> 0.9.0'
|
14
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
activemodel (3.0.9)
|
5
|
+
activesupport (= 3.0.9)
|
6
|
+
builder (~> 2.1.2)
|
7
|
+
i18n (~> 0.5.0)
|
8
|
+
activesupport (3.0.9)
|
9
|
+
bson (1.3.1)
|
10
|
+
builder (2.1.2)
|
11
|
+
git (1.2.5)
|
12
|
+
i18n (0.5.0)
|
13
|
+
jeweler (1.6.4)
|
14
|
+
bundler (~> 1.0)
|
15
|
+
git (>= 1.2.5)
|
16
|
+
rake
|
17
|
+
mongo (1.3.1)
|
18
|
+
bson (>= 1.3.1)
|
19
|
+
mongo_mapper (0.9.1)
|
20
|
+
activemodel (~> 3.0)
|
21
|
+
activesupport (~> 3.0)
|
22
|
+
plucky (~> 0.3.8)
|
23
|
+
plucky (0.3.8)
|
24
|
+
mongo (~> 1.3)
|
25
|
+
rake (0.9.2)
|
26
|
+
rcov (0.9.9)
|
27
|
+
shoulda (2.11.3)
|
28
|
+
|
29
|
+
PLATFORMS
|
30
|
+
ruby
|
31
|
+
|
32
|
+
DEPENDENCIES
|
33
|
+
bundler (~> 1.0.0)
|
34
|
+
jeweler (~> 1.6.2)
|
35
|
+
mongo_mapper (~> 0.9.0)
|
36
|
+
rcov
|
37
|
+
shoulda
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Mark Coates
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
= taggregator
|
2
|
+
|
3
|
+
Description goes here.
|
4
|
+
|
5
|
+
== Contributing to taggregator
|
6
|
+
|
7
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
8
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
9
|
+
* Fork the project
|
10
|
+
* Start a feature/bugfix branch
|
11
|
+
* Commit and push until you are happy with your contribution
|
12
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
13
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
14
|
+
|
15
|
+
== Copyright
|
16
|
+
|
17
|
+
Copyright (c) 2011 Mark Coates. See LICENSE.txt for
|
18
|
+
further details.
|
19
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
+
gem.name = "taggregator"
|
18
|
+
gem.homepage = "http://github.com/oddlyzen/taggregator"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = %Q{Bad-ass tagging intelligence for your document tagging in MongoMapper.}
|
21
|
+
gem.description = %Q{Taggable in context and aggregation of tags for MongoMapper. Adds weight and distribution convenience methods to models in which it is included. Uses MongoDB's increment/decrement ($inc/$dec) to keep real-time counts of individual tags in context with optional type. Based on 'Mongoid Taggable With Context' (https://github.com/aq1018/mongoid_taggable_with_context).}
|
22
|
+
gem.email = "mark.coates@gmail.com"
|
23
|
+
gem.authors = ["Mark Coates"]
|
24
|
+
# dependencies defined in Gemfile
|
25
|
+
end
|
26
|
+
Jeweler::RubygemsDotOrgTasks.new
|
27
|
+
|
28
|
+
require 'rake/testtask'
|
29
|
+
Rake::TestTask.new(:test) do |test|
|
30
|
+
test.libs << 'lib' << 'test'
|
31
|
+
test.pattern = 'test/**/test_*.rb'
|
32
|
+
test.verbose = true
|
33
|
+
end
|
34
|
+
|
35
|
+
require 'rcov/rcovtask'
|
36
|
+
Rcov::RcovTask.new do |test|
|
37
|
+
test.libs << 'test'
|
38
|
+
test.pattern = 'test/**/test_*.rb'
|
39
|
+
test.verbose = true
|
40
|
+
test.rcov_opts << '--exclude "gems/*"'
|
41
|
+
end
|
42
|
+
|
43
|
+
task :default => :test
|
44
|
+
|
45
|
+
require 'rake/rdoctask'
|
46
|
+
Rake::RDocTask.new do |rdoc|
|
47
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
48
|
+
|
49
|
+
rdoc.rdoc_dir = 'rdoc'
|
50
|
+
rdoc.title = "taggregator #{version}"
|
51
|
+
rdoc.rdoc_files.include('README*')
|
52
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
53
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.2.dev
|
data/lib/taggregator.rb
ADDED
@@ -0,0 +1,231 @@
|
|
1
|
+
module MongoMapper
|
2
|
+
module Plugins
|
3
|
+
autoload :Taggregator, 'taggregator'
|
4
|
+
end
|
5
|
+
end
|
6
|
+
|
7
|
+
module Taggregator
|
8
|
+
extend ActiveSupport::Concern
|
9
|
+
|
10
|
+
included do
|
11
|
+
class_inheritable_reader :taggable_with_context_options
|
12
|
+
write_inheritable_attribute(:taggable_with_context_options, {})
|
13
|
+
delegate "convert_string_to_array", :to => 'self.class'
|
14
|
+
delegate "convert_array_to_string", :to => 'self.class'
|
15
|
+
delegate "get_tag_separator_for", :to => 'self.class'
|
16
|
+
delegate "tag_contexts", :to => 'self.class'
|
17
|
+
delegate "tag_options_for", :to => 'self.class'
|
18
|
+
set_callback :create, :after, :increment_tags_agregation
|
19
|
+
set_callback :save, :after, :update_tags_aggregation
|
20
|
+
set_callback :destroy, :after, :decrement_tags_aggregation
|
21
|
+
end
|
22
|
+
|
23
|
+
module ClassMethods
|
24
|
+
# Macro to declare a document class as taggable, specify field name
|
25
|
+
# for tags, and set options for tagging behavior.
|
26
|
+
#
|
27
|
+
# @example Define a taggable document.
|
28
|
+
#
|
29
|
+
# class Article
|
30
|
+
# include Mongoid::Document
|
31
|
+
# include Mongoid::Taggable
|
32
|
+
# taggable :keywords, :separator => ' ', :aggregation => true, :default_type => "seo"
|
33
|
+
# end
|
34
|
+
#
|
35
|
+
# @param [ Symbol ] field The name of the field for tags.
|
36
|
+
# @param [ Hash ] options Options for taggable behavior.
|
37
|
+
#
|
38
|
+
# @option options [ String ] :separator The tag separator to
|
39
|
+
# convert from; defaults to ','
|
40
|
+
# @option options [ true, false ] :aggregation Whether or not to
|
41
|
+
# aggregate counts of tags within the document collection using
|
42
|
+
# map/reduce; defaults to false
|
43
|
+
# @option options [ String ] :default_type The default type of the tag.
|
44
|
+
# Each tag can optionally have a tag type. The default type is nil
|
45
|
+
def taggable(*args)
|
46
|
+
# init variables
|
47
|
+
options = args.extract_options!
|
48
|
+
tags_field = (args.blank? ? :tags : args.shift).to_sym
|
49
|
+
options.reverse_merge!(
|
50
|
+
:separator => ' ',
|
51
|
+
:array_field => "#{tags_field}_array".to_sym
|
52
|
+
)
|
53
|
+
tags_array_field = options[:array_field]
|
54
|
+
|
55
|
+
# register / update settings
|
56
|
+
class_options = taggable_with_context_options || {}
|
57
|
+
class_options[tags_field] = options
|
58
|
+
write_inheritable_attribute(:taggable_with_context_options, class_options)
|
59
|
+
|
60
|
+
# setup fields & indexes
|
61
|
+
field tags_field, :default => ""
|
62
|
+
field tags_array_field, :type => Array, :default => []
|
63
|
+
index tags_array_field
|
64
|
+
|
65
|
+
# singleton methods
|
66
|
+
class_eval <<-END
|
67
|
+
class << self
|
68
|
+
def #{tags_field}
|
69
|
+
tags_for(:"#{tags_field}")
|
70
|
+
end
|
71
|
+
|
72
|
+
def #{tags_field}_with_weight
|
73
|
+
tags_with_weight_for(:"#{tags_field}")
|
74
|
+
end
|
75
|
+
|
76
|
+
def #{tags_field}_separator
|
77
|
+
get_tag_separator_for(:"#{tags_field}")
|
78
|
+
end
|
79
|
+
|
80
|
+
def #{tags_field}_separator=(value)
|
81
|
+
set_tag_separator_for(:"#{tags_field}", value)
|
82
|
+
end
|
83
|
+
|
84
|
+
def #{tags_field}_tagged_with(tags)
|
85
|
+
tagged_with(:"#{tags_field}", tags)
|
86
|
+
end
|
87
|
+
end
|
88
|
+
END
|
89
|
+
|
90
|
+
# instance methods
|
91
|
+
class_eval <<-END
|
92
|
+
def #{tags_field}=(s)
|
93
|
+
super
|
94
|
+
write_attribute(:#{tags_array_field}, convert_string_to_array(s, get_tag_separator_for(:"#{tags_field}")))
|
95
|
+
end
|
96
|
+
|
97
|
+
def #{tags_array_field}=(a)
|
98
|
+
super
|
99
|
+
write_attribute(:#{tags_field}, convert_array_to_string(a, get_tag_separator_for(:"#{tags_field}")))
|
100
|
+
end
|
101
|
+
END
|
102
|
+
end
|
103
|
+
|
104
|
+
def tag_contexts
|
105
|
+
taggable_with_context_options.keys
|
106
|
+
end
|
107
|
+
|
108
|
+
def tag_options_for(context)
|
109
|
+
taggable_with_context_options[context]
|
110
|
+
end
|
111
|
+
|
112
|
+
def tags_for(context, conditions={})
|
113
|
+
raise AggregationStrategyMissing
|
114
|
+
end
|
115
|
+
|
116
|
+
# Collection name for storing results of tag count aggregation
|
117
|
+
def aggregation_collection_for(context)
|
118
|
+
"#{collection_name}_#{context}_aggregation"
|
119
|
+
end
|
120
|
+
|
121
|
+
def tags_for(context, conditions={})
|
122
|
+
conditions = {:sort => '_id'}.merge(conditions)
|
123
|
+
db.collection(aggregation_collection_for(context)).find({:value => {"$gt" => 0 }}, conditions).to_a.map{ |t| t["_id"] }
|
124
|
+
end
|
125
|
+
|
126
|
+
# retrieve the list of tag with weight(count), this is useful for
|
127
|
+
# creating tag clouds
|
128
|
+
def tags_with_weight_for(context, conditions={})
|
129
|
+
conditions = {:sort => '_id'}.merge(conditions)
|
130
|
+
db.collection(aggregation_collection_for(context)).find({:value => {"$gt" => 0 }}, conditions).to_a.map{ |t| [t["_id"], t["value"]] }
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
private
|
135
|
+
def need_update_tags_aggregation?
|
136
|
+
!changed_contexts.empty?
|
137
|
+
end
|
138
|
+
|
139
|
+
def changed_contexts
|
140
|
+
tag_contexts & previous_changes.keys.map(&:to_sym)
|
141
|
+
end
|
142
|
+
|
143
|
+
def increment_tags_agregation
|
144
|
+
# if document is created by using MyDocument.new
|
145
|
+
# and attributes are individually assigned
|
146
|
+
# #previous_changes won't be empty and aggregation
|
147
|
+
# is updated in after_save, so we simply skip it.
|
148
|
+
return unless previous_changes.empty?
|
149
|
+
|
150
|
+
# if the document is created by using MyDocument.create(:tags => "tag1 tag2")
|
151
|
+
# #previous_changes hash is empty and we have to update aggregation here
|
152
|
+
tag_contexts.each do |context|
|
153
|
+
coll = self.class.db.collection(self.class.aggregation_collection_for(context))
|
154
|
+
field_name = self.class.tag_options_for(context)[:array_field]
|
155
|
+
tags = self.send field_name || []
|
156
|
+
tags.each do |t|
|
157
|
+
coll.update({:_id => t}, {'$inc' => {:value => 1}}, :upsert => true)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
def decrement_tags_aggregation
|
163
|
+
tag_contexts.each do |context|
|
164
|
+
coll = self.class.db.collection(self.class.aggregation_collection_for(context))
|
165
|
+
field_name = self.class.tag_options_for(context)[:array_field]
|
166
|
+
tags = self.send field_name || []
|
167
|
+
tags.each do |t|
|
168
|
+
coll.update({:_id => t}, {'$inc' => {:value => -1}}, :upsert => true)
|
169
|
+
end
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
def update_tags_aggregation
|
174
|
+
return unless need_update_tags_aggregation?
|
175
|
+
|
176
|
+
changed_contexts.each do |context|
|
177
|
+
coll = self.class.db.collection(self.class.aggregation_collection_for(context))
|
178
|
+
field_name = self.class.tag_options_for(context)[:array_field]
|
179
|
+
old_tags, new_tags = previous_changes["#{field_name}"]
|
180
|
+
old_tags ||= []
|
181
|
+
new_tags ||= []
|
182
|
+
unchanged_tags = old_tags & new_tags
|
183
|
+
tags_removed = old_tags - unchanged_tags
|
184
|
+
tags_added = new_tags - unchanged_tags
|
185
|
+
|
186
|
+
tags_removed.each do |t|
|
187
|
+
coll.update({:_id => t}, {'$inc' => {:value => -1}}, :upsert => true)
|
188
|
+
end
|
189
|
+
|
190
|
+
tags_added.each do |t|
|
191
|
+
coll.update({:_id => t}, {'$inc' => {:value => 1}}, :upsert => true)
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
def get_tag_separator_for(context)
|
196
|
+
taggable_with_context_options[context][:separator]
|
197
|
+
end
|
198
|
+
|
199
|
+
def set_tag_separator_for(context, value)
|
200
|
+
taggable_with_context_options[context][:separator] = value.nil? ? " " : value.to_s
|
201
|
+
end
|
202
|
+
|
203
|
+
# Find documents tagged with all tags passed as a parameter, given
|
204
|
+
# as an Array or a String using the configured separator.
|
205
|
+
#
|
206
|
+
# @example Find matching all tags in an Array.
|
207
|
+
# Article.tagged_with(['ruby', 'mongodb'])
|
208
|
+
# @example Find matching all tags in a String.
|
209
|
+
# Article.tagged_with('ruby, mongodb')
|
210
|
+
#
|
211
|
+
# @param [ String ] :field The field name of the tag.
|
212
|
+
# @param [ Array<String, Symbol>, String ] :tags Tags to match.
|
213
|
+
# @return [ Criteria ] A new criteria.
|
214
|
+
def tagged_with(context, tags)
|
215
|
+
tags = convert_string_to_array(tags, get_tag_separator_for(context)) if tags.is_a? String
|
216
|
+
array_field = tag_options_for(context)[:array_field]
|
217
|
+
all_in(array_field => tags)
|
218
|
+
end
|
219
|
+
|
220
|
+
# Helper method to convert a String to an Array based on the
|
221
|
+
# configured tag separator.
|
222
|
+
def convert_string_to_array(str = "", seperator = " ")
|
223
|
+
str.split(seperator).map(&:strip).uniq.compact
|
224
|
+
end
|
225
|
+
|
226
|
+
def convert_array_to_string(ary = [], seperator = " ")
|
227
|
+
ary.uniq.compact.join(seperator)
|
228
|
+
end
|
229
|
+
end
|
230
|
+
|
231
|
+
end
|
data/taggregator.gemspec
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{taggregator}
|
8
|
+
s.version = "0.0.2.dev"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Mark Coates"]
|
12
|
+
s.date = %q{2011-07-21}
|
13
|
+
s.description = %q{Taggable in context and aggregation of tags for MongoMapper. Adds weight and distribution convenience methods to models in which it is included. Uses MongoDB's increment/decrement ($inc/$dec) to keep real-time counts of individual tags in context with optional type. Based on 'Mongoid Taggable With Context' (https://github.com/aq1018/mongoid_taggable_with_context).}
|
14
|
+
s.email = %q{mark.coates@gmail.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
"Gemfile",
|
22
|
+
"Gemfile.lock",
|
23
|
+
"LICENSE.txt",
|
24
|
+
"README.rdoc",
|
25
|
+
"Rakefile",
|
26
|
+
"VERSION",
|
27
|
+
"lib/taggregator.rb",
|
28
|
+
"taggregator.gemspec",
|
29
|
+
"test/helper.rb",
|
30
|
+
"test/test_taggregator.rb"
|
31
|
+
]
|
32
|
+
s.homepage = %q{http://github.com/oddlyzen/taggregator}
|
33
|
+
s.licenses = ["MIT"]
|
34
|
+
s.require_paths = ["lib"]
|
35
|
+
s.rubygems_version = %q{1.6.2}
|
36
|
+
s.summary = %q{Bad-ass tagging intelligence for your document tagging in MongoMapper.}
|
37
|
+
|
38
|
+
if s.respond_to? :specification_version then
|
39
|
+
s.specification_version = 3
|
40
|
+
|
41
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
42
|
+
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
43
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
44
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6.2"])
|
45
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
46
|
+
s.add_development_dependency(%q<mongo_mapper>, ["~> 0.9.0"])
|
47
|
+
else
|
48
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
49
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
50
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.2"])
|
51
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
52
|
+
s.add_dependency(%q<mongo_mapper>, ["~> 0.9.0"])
|
53
|
+
end
|
54
|
+
else
|
55
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
56
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
57
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.2"])
|
58
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
59
|
+
s.add_dependency(%q<mongo_mapper>, ["~> 0.9.0"])
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
data/test/helper.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'test/unit'
|
11
|
+
require 'shoulda'
|
12
|
+
|
13
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
14
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
15
|
+
require 'taggregator'
|
16
|
+
|
17
|
+
class Test::Unit::TestCase
|
18
|
+
end
|
metadata
ADDED
@@ -0,0 +1,121 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: taggregator
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2.dev
|
5
|
+
prerelease: 6
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Mark Coates
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-07-21 00:00:00.000000000 -04:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: shoulda
|
17
|
+
requirement: &2153013020 !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '0'
|
23
|
+
type: :development
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: *2153013020
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: bundler
|
28
|
+
requirement: &2153012040 !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.0.0
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: *2153012040
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: jeweler
|
39
|
+
requirement: &2153011220 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ~>
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: 1.6.2
|
45
|
+
type: :development
|
46
|
+
prerelease: false
|
47
|
+
version_requirements: *2153011220
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: rcov
|
50
|
+
requirement: &2153010400 !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ! '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
type: :development
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: *2153010400
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: mongo_mapper
|
61
|
+
requirement: &2153009760 !ruby/object:Gem::Requirement
|
62
|
+
none: false
|
63
|
+
requirements:
|
64
|
+
- - ~>
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: 0.9.0
|
67
|
+
type: :development
|
68
|
+
prerelease: false
|
69
|
+
version_requirements: *2153009760
|
70
|
+
description: Taggable in context and aggregation of tags for MongoMapper. Adds weight
|
71
|
+
and distribution convenience methods to models in which it is included. Uses MongoDB's
|
72
|
+
increment/decrement ($inc/$dec) to keep real-time counts of individual tags in context
|
73
|
+
with optional type. Based on 'Mongoid Taggable With Context' (https://github.com/aq1018/mongoid_taggable_with_context).
|
74
|
+
email: mark.coates@gmail.com
|
75
|
+
executables: []
|
76
|
+
extensions: []
|
77
|
+
extra_rdoc_files:
|
78
|
+
- LICENSE.txt
|
79
|
+
- README.rdoc
|
80
|
+
files:
|
81
|
+
- .document
|
82
|
+
- Gemfile
|
83
|
+
- Gemfile.lock
|
84
|
+
- LICENSE.txt
|
85
|
+
- README.rdoc
|
86
|
+
- Rakefile
|
87
|
+
- VERSION
|
88
|
+
- lib/taggregator.rb
|
89
|
+
- taggregator.gemspec
|
90
|
+
- test/helper.rb
|
91
|
+
- test/test_taggregator.rb
|
92
|
+
has_rdoc: true
|
93
|
+
homepage: http://github.com/oddlyzen/taggregator
|
94
|
+
licenses:
|
95
|
+
- MIT
|
96
|
+
post_install_message:
|
97
|
+
rdoc_options: []
|
98
|
+
require_paths:
|
99
|
+
- lib
|
100
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
101
|
+
none: false
|
102
|
+
requirements:
|
103
|
+
- - ! '>='
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '0'
|
106
|
+
segments:
|
107
|
+
- 0
|
108
|
+
hash: -779744515643755822
|
109
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
|
+
none: false
|
111
|
+
requirements:
|
112
|
+
- - ! '>'
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: 1.3.1
|
115
|
+
requirements: []
|
116
|
+
rubyforge_project:
|
117
|
+
rubygems_version: 1.6.2
|
118
|
+
signing_key:
|
119
|
+
specification_version: 3
|
120
|
+
summary: Bad-ass tagging intelligence for your document tagging in MongoMapper.
|
121
|
+
test_files: []
|