ozataman-acts-as-taggable-on 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
@@ -0,0 +1,32 @@
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
+ end
18
+
19
+ create_table :taggable_models, :force => true do |t|
20
+ t.column :name, :string
21
+ t.column :type, :string
22
+ #t.column :cached_tag_list, :string
23
+ end
24
+ create_table :taggable_users, :force => true do |t|
25
+ t.column :name, :string
26
+ end
27
+ create_table :other_taggable_models, :force => true do |t|
28
+ t.column :name, :string
29
+ t.column :type, :string
30
+ #t.column :cached_tag_list, :string
31
+ end
32
+ 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
@@ -0,0 +1 @@
1
+ # Uninstall hook code here
metadata ADDED
@@ -0,0 +1,81 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ozataman-acts-as-taggable-on
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.3
5
+ platform: ruby
6
+ authors:
7
+ - Michael Bleigh
8
+ - Ozgun Ataman
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2009-01-22 00:00:00 -08:00
14
+ default_executable:
15
+ dependencies: []
16
+
17
+ 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.
18
+ email: michael@intridea.com
19
+ executables: []
20
+
21
+ extensions: []
22
+
23
+ extra_rdoc_files: []
24
+
25
+ files:
26
+ - CHANGELOG
27
+ - MIT-LICENSE
28
+ - README
29
+ - generators/acts_as_taggable_on_migration
30
+ - generators/acts_as_taggable_on_migration/acts_as_taggable_on_migration_generator.rb
31
+ - generators/acts_as_taggable_on_migration/templates
32
+ - generators/acts_as_taggable_on_migration/templates/add_users_migration.rb
33
+ - generators/acts_as_taggable_on_migration/templates/migration.rb
34
+ - init.rb
35
+ - lib/acts-as-taggable-on.rb
36
+ - lib/acts_as_taggable_on/acts_as_taggable_on.rb
37
+ - lib/acts_as_taggable_on/acts_as_tagger.rb
38
+ - lib/acts_as_taggable_on/tag.rb
39
+ - lib/acts_as_taggable_on/tag_list.rb
40
+ - lib/acts_as_taggable_on/tagging.rb
41
+ - lib/acts_as_taggable_on/tags_helper.rb
42
+ - rails/init.rb
43
+ - spec/acts_as_taggable_on
44
+ - spec/acts_as_taggable_on/acts_as_taggable_on_spec.rb
45
+ - spec/acts_as_taggable_on/tag_list_spec.rb
46
+ - spec/acts_as_taggable_on/tag_spec.rb
47
+ - spec/acts_as_taggable_on/taggable_spec.rb
48
+ - spec/acts_as_taggable_on/tagger_spec.rb
49
+ - spec/acts_as_taggable_on/tagging_spec.rb
50
+ - spec/debug.log
51
+ - spec/schema.rb
52
+ - spec/spec_helper.rb
53
+ - uninstall.rb
54
+ has_rdoc: false
55
+ homepage: http://www.actsascommunity.com/projects/acts-as-taggable-on
56
+ post_install_message:
57
+ rdoc_options: []
58
+
59
+ require_paths:
60
+ - lib
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: "0"
66
+ version:
67
+ required_rubygems_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: "0"
72
+ version:
73
+ requirements: []
74
+
75
+ rubyforge_project:
76
+ rubygems_version: 1.2.0
77
+ signing_key:
78
+ specification_version: 2
79
+ summary: Tagging for ActiveRecord with custom contexts and advanced features.
80
+ test_files: []
81
+