wideopenspaces-acts-as-taggable-on 1.0.3

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.
@@ -0,0 +1,23 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ describe "Tagger" do
4
+ before(:each) do
5
+ [TaggableModel, Tag, Tagging, TaggableUser].each(&:delete_all)
6
+ @user = TaggableUser.new
7
+ @taggable = TaggableModel.new(:name => "Bob Jones")
8
+ end
9
+
10
+ it "should have taggings" do
11
+ @user.tag(@taggable, :with=>'ruby,scheme', :on=>:tags)
12
+ @user.owned_taggings.size == 2
13
+ end
14
+
15
+ it "should have tags" do
16
+ @user.tag(@taggable, :with=>'ruby,scheme', :on=>:tags)
17
+ @user.owned_tags.size == 2
18
+ end
19
+
20
+ it "is tagger" do
21
+ @user.is_tagger?.should(be_true)
22
+ end
23
+ end
@@ -0,0 +1,7 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ describe Tagging do
4
+ before(:each) do
5
+ @tagging = Tagging.new
6
+ end
7
+ end
data/spec/schema.rb ADDED
@@ -0,0 +1,33 @@
1
+ ActiveRecord::Schema.define :version => 0 do
2
+ create_table "taggings", :force => true do |t|
3
+ t.integer "tag_id", :limit => 11
4
+ t.integer "taggable_id", :limit => 11
5
+ t.string "taggable_type"
6
+ t.string "context"
7
+ t.datetime "created_at"
8
+ t.integer "tagger_id", :limit => 11
9
+ t.string "tagger_type"
10
+ end
11
+
12
+ add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id"
13
+ add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context"
14
+
15
+ create_table "tags", :force => true do |t|
16
+ t.string "name"
17
+ t.integer "tag_count", :default => 0
18
+ end
19
+
20
+ create_table :taggable_models, :force => true do |t|
21
+ t.column :name, :string
22
+ t.column :type, :string
23
+ #t.column :cached_tag_list, :string
24
+ end
25
+ create_table :taggable_users, :force => true do |t|
26
+ t.column :name, :string
27
+ end
28
+ create_table :other_taggable_models, :force => true do |t|
29
+ t.column :name, :string
30
+ t.column :type, :string
31
+ #t.column :cached_tag_list, :string
32
+ end
33
+ end
@@ -0,0 +1,33 @@
1
+ require File.dirname(__FILE__) + '/../../../../spec/spec_helper'
2
+
3
+ module Spec::Example::ExampleGroupMethods
4
+ alias :context :describe
5
+ end
6
+
7
+ plugin_spec_dir = File.dirname(__FILE__)
8
+ ActiveRecord::Base.logger = Logger.new(plugin_spec_dir + "/debug.log")
9
+
10
+ load(File.dirname(__FILE__) + '/schema.rb')
11
+
12
+ class TaggableModel < ActiveRecord::Base
13
+ acts_as_taggable_on :tags, :languages
14
+ acts_as_taggable_on :skills
15
+ end
16
+
17
+ class OtherTaggableModel < ActiveRecord::Base
18
+ acts_as_taggable_on :tags, :languages
19
+ end
20
+
21
+ class InheritingTaggableModel < TaggableModel
22
+ end
23
+
24
+ class AlteredInheritingTaggableModel < TaggableModel
25
+ acts_as_taggable_on :parts
26
+ end
27
+
28
+ class TaggableUser < ActiveRecord::Base
29
+ acts_as_tagger
30
+ end
31
+
32
+ class UntaggableModel < ActiveRecord::Base
33
+ end
data/uninstall.rb ADDED
@@ -0,0 +1 @@
1
+ # Uninstall hook code here
metadata ADDED
@@ -0,0 +1,79 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: wideopenspaces-acts-as-taggable-on
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.3
5
+ platform: ruby
6
+ authors:
7
+ - Michael Bleigh
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-01-21 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: Acts As Taggable On provides the ability to have multiple tag contexts on a single model in ActiveRecord. It also has support for tag clouds, related items, taggers, and more.
17
+ email: michael@intridea.com
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files: []
23
+
24
+ files:
25
+ - CHANGELOG
26
+ - MIT-LICENSE
27
+ - README
28
+ - generators/acts_as_taggable_on_migration
29
+ - generators/acts_as_taggable_on_migration/acts_as_taggable_on_migration_generator.rb
30
+ - generators/acts_as_taggable_on_migration/templates
31
+ - generators/acts_as_taggable_on_migration/templates/migration.rb
32
+ - init.rb
33
+ - lib/acts-as-taggable-on.rb
34
+ - lib/acts_as_taggable_on/acts_as_taggable_on.rb
35
+ - lib/acts_as_taggable_on/acts_as_tagger.rb
36
+ - lib/acts_as_taggable_on/tag.rb
37
+ - lib/acts_as_taggable_on/tag_list.rb
38
+ - lib/acts_as_taggable_on/tagging.rb
39
+ - lib/acts_as_taggable_on/tags_helper.rb
40
+ - lib/autotest/discover.rb
41
+ - rails/init.rb
42
+ - spec/acts_as_taggable_on
43
+ - spec/acts_as_taggable_on/acts_as_taggable_on_spec.rb
44
+ - spec/acts_as_taggable_on/tag_list_spec.rb
45
+ - spec/acts_as_taggable_on/tag_spec.rb
46
+ - spec/acts_as_taggable_on/taggable_spec.rb
47
+ - spec/acts_as_taggable_on/tagger_spec.rb
48
+ - spec/acts_as_taggable_on/tagging_spec.rb
49
+ - spec/schema.rb
50
+ - spec/spec_helper.rb
51
+ - uninstall.rb
52
+ has_rdoc: false
53
+ homepage: http://www.actsascommunity.com/projects/acts-as-taggable-on
54
+ post_install_message:
55
+ rdoc_options: []
56
+
57
+ require_paths:
58
+ - lib
59
+ required_ruby_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: "0"
64
+ version:
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: "0"
70
+ version:
71
+ requirements: []
72
+
73
+ rubyforge_project:
74
+ rubygems_version: 1.2.0
75
+ signing_key:
76
+ specification_version: 2
77
+ summary: Tagging for ActiveRecord with custom contexts and advanced features.
78
+ test_files: []
79
+