slillibri-acts-as-taggable-on 1.0.5

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,46 @@
1
+ # require File.dirname(__FILE__) + '/../../../../spec/spec_helper'
2
+ require 'rubygems'
3
+ require 'active_support'
4
+ require 'active_record'
5
+ require 'spec'
6
+
7
+ module Spec::Example::ExampleGroupMethods
8
+ alias :context :describe
9
+ end
10
+
11
+ TEST_DATABASE_FILE = File.join(File.dirname(__FILE__), '..', 'test.sqlite3')
12
+
13
+ File.unlink(TEST_DATABASE_FILE) if File.exist?(TEST_DATABASE_FILE)
14
+ ActiveRecord::Base.establish_connection(
15
+ "adapter" => "sqlite3", "database" => TEST_DATABASE_FILE
16
+ )
17
+
18
+ RAILS_DEFAULT_LOGGER = Logger.new(File.join(File.dirname(__FILE__), "debug.log"))
19
+
20
+ load(File.dirname(__FILE__) + '/schema.rb')
21
+
22
+ $: << File.join(File.dirname(__FILE__), '..', 'lib')
23
+ require File.join(File.dirname(__FILE__), '..', 'init')
24
+
25
+ class TaggableModel < ActiveRecord::Base
26
+ acts_as_taggable_on :tags, :languages
27
+ acts_as_taggable_on :skills
28
+ end
29
+
30
+ class OtherTaggableModel < ActiveRecord::Base
31
+ acts_as_taggable_on :tags, :languages
32
+ end
33
+
34
+ class InheritingTaggableModel < TaggableModel
35
+ end
36
+
37
+ class AlteredInheritingTaggableModel < TaggableModel
38
+ acts_as_taggable_on :parts
39
+ end
40
+
41
+ class TaggableUser < ActiveRecord::Base
42
+ acts_as_tagger
43
+ end
44
+
45
+ class UntaggableModel < ActiveRecord::Base
46
+ end
@@ -0,0 +1 @@
1
+ # Uninstall hook code here
metadata ADDED
@@ -0,0 +1,78 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: slillibri-acts-as-taggable-on
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.5
5
+ platform: ruby
6
+ authors:
7
+ - Michael Bleigh
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-06-10 00:00:00 -07: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
+ - rails/init.rb
41
+ - spec/acts_as_taggable_on
42
+ - spec/acts_as_taggable_on/acts_as_taggable_on_spec.rb
43
+ - spec/acts_as_taggable_on/tag_list_spec.rb
44
+ - spec/acts_as_taggable_on/tag_spec.rb
45
+ - spec/acts_as_taggable_on/taggable_spec.rb
46
+ - spec/acts_as_taggable_on/tagger_spec.rb
47
+ - spec/acts_as_taggable_on/tagging_spec.rb
48
+ - spec/schema.rb
49
+ - spec/spec_helper.rb
50
+ - uninstall.rb
51
+ has_rdoc: false
52
+ homepage: http://www.actsascommunity.com/projects/acts-as-taggable-on
53
+ post_install_message:
54
+ rdoc_options: []
55
+
56
+ require_paths:
57
+ - lib
58
+ required_ruby_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: "0"
63
+ version:
64
+ required_rubygems_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: "0"
69
+ version:
70
+ requirements: []
71
+
72
+ rubyforge_project:
73
+ rubygems_version: 1.2.0
74
+ signing_key:
75
+ specification_version: 2
76
+ summary: Tagging for ActiveRecord with custom contexts and advanced features.
77
+ test_files: []
78
+