taggregator 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. data/README.md +42 -0
  2. data/Rakefile +1 -1
  3. data/VERSION +1 -1
  4. data/taggregator.gemspec +4 -4
  5. metadata +18 -18
  6. data/README.rdoc +0 -19
data/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # Taggregator
2
+
3
+ Adds tagging with 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).
4
+
5
+ ## Usage
6
+
7
+ **Taggregator** is very easy to use. Just include the MongoMapper plugin in your model the normal way and call `taggable`, like so:
8
+
9
+ class Article
10
+ include MongoMapper::Document
11
+ plugin MongoMapper::Plugins::Taggregator
12
+
13
+ key :title, String
14
+ key :body, String
15
+ taggable
16
+ taggable :keywords
17
+ taggable :ads, :separator => ','
18
+ end
19
+
20
+ a = Article.new
21
+
22
+ Tags are then set with a string by calling `a.tags = 'space separated tags'`. Tag separators default to a space character, but as you see in the above example, can be overridden for with any character or string of your choice. If we follow the lead of the example, we would set `a.ads` by calling `a.ads = 'comma,separated,tags'`. The call to `taggable` will also add the array representation of the taggable fields with context, accessible through `a.tags_array`, `a.keywords_array`, and `a.ads_array`. If you have an array of string tags and wish to set the tags array manually, you can (i.e., `a.ads_array = ['xmas', 'shopping', 'books']`). Just as setting the string `a.ads` will populate `a.ads_array`, setting the tags array will also populate the string representation of the tag list in context.
23
+
24
+ The call to `taggable` will also allow you to do some pretty cool stuff now. You can get all articles tags with a call to `Article.tags` and all tags (in the 'keywords' context) with `Article.keywords`. If you would like to get a list of all keywords with the keyword's associated frequency/weight, simply do something like:
25
+
26
+ Article.tags_with_weight_for :keywords
27
+ => [["stocks", 4], ["finance", 4], ["banking", 3], ["bonds", 1]]
28
+
29
+ ## Contributing to taggregator
30
+
31
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
32
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
33
+ * Fork the project
34
+ * Start a feature/bugfix branch
35
+ * Commit and push until you are happy with your contribution
36
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
37
+ * 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.
38
+
39
+ ## Copyright
40
+
41
+ Copyright © 2011 Mark Coates. See LICENSE.txt for further details.
42
+
data/Rakefile CHANGED
@@ -18,7 +18,7 @@ Jeweler::Tasks.new do |gem|
18
18
  gem.homepage = "http://github.com/oddlyzen/taggregator"
19
19
  gem.license = "MIT"
20
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).}
21
+ gem.description = %Q{Adds tagging with 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
22
  gem.email = "mark.coates@gmail.com"
23
23
  gem.authors = ["Mark Coates"]
24
24
  # dependencies defined in Gemfile
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
data/taggregator.gemspec CHANGED
@@ -5,23 +5,23 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{taggregator}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Mark Coates"]
12
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).}
13
+ s.description = %q{Adds tagging with 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
14
  s.email = %q{mark.coates@gmail.com}
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE.txt",
17
- "README.rdoc"
17
+ "README.md"
18
18
  ]
19
19
  s.files = [
20
20
  ".document",
21
21
  "Gemfile",
22
22
  "Gemfile.lock",
23
23
  "LICENSE.txt",
24
- "README.rdoc",
24
+ "README.md",
25
25
  "Rakefile",
26
26
  "VERSION",
27
27
  "lib/taggregator.rb",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: taggregator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: shoulda
17
- requirement: &2152389060 !ruby/object:Gem::Requirement
17
+ requirement: &2152444980 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :development
24
24
  prerelease: false
25
- version_requirements: *2152389060
25
+ version_requirements: *2152444980
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: bundler
28
- requirement: &2152388340 !ruby/object:Gem::Requirement
28
+ requirement: &2152444440 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ~>
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 1.0.0
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *2152388340
36
+ version_requirements: *2152444440
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: jeweler
39
- requirement: &2152387840 !ruby/object:Gem::Requirement
39
+ requirement: &2152443920 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ~>
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: 1.6.2
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *2152387840
47
+ version_requirements: *2152443920
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: rcov
50
- requirement: &2152387320 !ruby/object:Gem::Requirement
50
+ requirement: &2152443340 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: '0'
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *2152387320
58
+ version_requirements: *2152443340
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: mongo_mapper
61
- requirement: &2152386800 !ruby/object:Gem::Requirement
61
+ requirement: &2152442720 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ~>
@@ -66,23 +66,23 @@ dependencies:
66
66
  version: 0.9.0
67
67
  type: :development
68
68
  prerelease: false
69
- version_requirements: *2152386800
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).
69
+ version_requirements: *2152442720
70
+ description: Adds tagging with context and aggregation of tags for MongoMapper. Adds
71
+ weight and distribution convenience methods to models in which it is included. Uses
72
+ MongoDB's increment/decrement ($inc/$dec) to keep real-time counts of individual
73
+ tags in context with optional type. Based on 'Mongoid Taggable With Context' (https://github.com/aq1018/mongoid_taggable_with_context).
74
74
  email: mark.coates@gmail.com
75
75
  executables: []
76
76
  extensions: []
77
77
  extra_rdoc_files:
78
78
  - LICENSE.txt
79
- - README.rdoc
79
+ - README.md
80
80
  files:
81
81
  - .document
82
82
  - Gemfile
83
83
  - Gemfile.lock
84
84
  - LICENSE.txt
85
- - README.rdoc
85
+ - README.md
86
86
  - Rakefile
87
87
  - VERSION
88
88
  - lib/taggregator.rb
@@ -106,7 +106,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
106
106
  version: '0'
107
107
  segments:
108
108
  - 0
109
- hash: 4143605487689595211
109
+ hash: 1716478362843917750
110
110
  required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  none: false
112
112
  requirements:
data/README.rdoc DELETED
@@ -1,19 +0,0 @@
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
-