acts-as-taggable-on 3.1.1 → 3.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/.travis.yml +9 -7
  4. data/Appraisals +13 -8
  5. data/CHANGELOG.md +8 -0
  6. data/Gemfile +1 -2
  7. data/README.md +23 -13
  8. data/Rakefile +5 -17
  9. data/UPGRADING.md +6 -0
  10. data/acts-as-taggable-on.gemspec +13 -13
  11. data/db/migrate/1_acts_as_taggable_on_migration.rb +3 -3
  12. data/db/migrate/2_add_missing_unique_indices.rb +3 -5
  13. data/db/migrate/3_add_taggings_counter_cache_to_tags.rb +1 -1
  14. data/gemfiles/activerecord_3.2.gemfile +15 -0
  15. data/gemfiles/activerecord_4.0.gemfile +15 -0
  16. data/gemfiles/activerecord_4.1.gemfile +15 -0
  17. data/gemfiles/activerecord_edge.gemfile +16 -0
  18. data/lib/acts-as-taggable-on.rb +23 -21
  19. data/lib/acts_as_taggable_on/acts_as_taggable_on/cache.rb +1 -4
  20. data/lib/acts_as_taggable_on/acts_as_taggable_on/collection.rb +29 -20
  21. data/lib/acts_as_taggable_on/acts_as_taggable_on/compatibility.rb +11 -10
  22. data/lib/acts_as_taggable_on/acts_as_taggable_on/core.rb +98 -80
  23. data/lib/acts_as_taggable_on/acts_as_taggable_on/ownership.rb +5 -12
  24. data/lib/acts_as_taggable_on/acts_as_taggable_on/related.rb +7 -7
  25. data/lib/acts_as_taggable_on/engine.rb +0 -1
  26. data/lib/acts_as_taggable_on/tag.rb +24 -19
  27. data/lib/acts_as_taggable_on/tag_list.rb +95 -21
  28. data/lib/acts_as_taggable_on/taggable.rb +28 -30
  29. data/lib/acts_as_taggable_on/tagger.rb +30 -18
  30. data/lib/acts_as_taggable_on/tagging.rb +7 -8
  31. data/lib/acts_as_taggable_on/tags_helper.rb +1 -1
  32. data/lib/acts_as_taggable_on/utils.rb +25 -3
  33. data/lib/acts_as_taggable_on/version.rb +1 -1
  34. data/spec/acts_as_taggable_on/acts_as_taggable_on_spec.rb +133 -138
  35. data/spec/acts_as_taggable_on/acts_as_tagger_spec.rb +55 -58
  36. data/spec/acts_as_taggable_on/caching_spec.rb +34 -35
  37. data/spec/acts_as_taggable_on/related_spec.rb +59 -113
  38. data/spec/acts_as_taggable_on/single_table_inheritance_spec.rb +118 -95
  39. data/spec/acts_as_taggable_on/tag_list_spec.rb +89 -57
  40. data/spec/acts_as_taggable_on/tag_spec.rb +125 -114
  41. data/spec/acts_as_taggable_on/taggable_spec.rb +538 -352
  42. data/spec/acts_as_taggable_on/tagger_spec.rb +81 -78
  43. data/spec/acts_as_taggable_on/tagging_spec.rb +13 -14
  44. data/spec/acts_as_taggable_on/tags_helper_spec.rb +25 -25
  45. data/spec/acts_as_taggable_on/utils_spec.rb +9 -9
  46. data/spec/internal/app/models/altered_inheriting_taggable_model.rb +3 -0
  47. data/spec/internal/app/models/cached_model.rb +3 -0
  48. data/spec/internal/app/models/cached_model_with_array.rb +5 -0
  49. data/spec/internal/app/models/company.rb +15 -0
  50. data/spec/internal/app/models/inheriting_taggable_model.rb +2 -0
  51. data/spec/internal/app/models/market.rb +2 -0
  52. data/spec/{models.rb → internal/app/models/models.rb} +34 -2
  53. data/spec/internal/app/models/non_standard_id_taggable_model.rb +8 -0
  54. data/spec/internal/app/models/ordered_taggable_model.rb +4 -0
  55. data/spec/internal/app/models/other_cached_model.rb +3 -0
  56. data/spec/internal/app/models/other_taggable_model.rb +4 -0
  57. data/spec/internal/app/models/student.rb +2 -0
  58. data/spec/internal/app/models/taggable_model.rb +13 -0
  59. data/spec/internal/app/models/untaggable_model.rb +3 -0
  60. data/spec/internal/app/models/user.rb +3 -0
  61. data/spec/{database.yml.sample → internal/config/database.yml.sample} +2 -2
  62. data/spec/internal/db/schema.rb +97 -0
  63. data/spec/schema.rb +11 -0
  64. data/spec/spec_helper.rb +9 -62
  65. data/spec/support/array.rb +9 -0
  66. data/spec/support/database.rb +42 -0
  67. data/spec/support/database_cleaner.rb +17 -0
  68. metadata +101 -37
  69. data/gemfiles/rails_3.2.gemfile +0 -7
  70. data/gemfiles/rails_4.0.gemfile +0 -7
  71. data/gemfiles/rails_4.1.gemfile +0 -7
  72. data/gemfiles/rails_edge.gemfile +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 85958d35c84d713f07c8002b6d13076d545c66ef
4
- data.tar.gz: 0886b4ccc2336cb4231c95a3ebfad17428bc2039
3
+ metadata.gz: bbd5e8b1bc5588e5fa1f7c52d650d51284426c46
4
+ data.tar.gz: 8310137e6ed880ac050af6a67e0afb648720c0a8
5
5
  SHA512:
6
- metadata.gz: 7aab69718b2ecca16126a6ccf094845c492bccbb56414721e39bd0a026639648df76d57bd0a89c70c320f16bbf382f2fb717aae885251d2e996113cf3fc6e466
7
- data.tar.gz: e4d6bd119431386cb2329a496984b7d401494cc150796b6e7155b5533ab60cd1e82480c831034595377eba9d2226a4aebe7523628bbc69ff2954b64f2596285b
6
+ metadata.gz: 1ba873f7c016fac3ddbbad4f8ff7b946bb7ffca89074b4db76f63d58c241e01726d18fcd502a7e60fe31b635f6f1fae5d5c26dce911211db07a9c8506e07d13b
7
+ data.tar.gz: 098fd2268afe38cd7278a8908e6c11b1aeba8370754224730510d71a336130b89831051640fac2af432171c09f51e346b18c141e2d97553a68efc680a6afa680
data/.gitignore CHANGED
@@ -3,7 +3,7 @@
3
3
  /pkg/*
4
4
  .bundle
5
5
  .ruby-version
6
- spec/database.yml
6
+ spec/internal/config/database.yml
7
7
  tmp*.sw?
8
8
  *.sw?
9
9
  tmp
@@ -1,21 +1,23 @@
1
1
  rvm:
2
2
  - 1.9.3
3
3
  - 2.0.0
4
- - 2.1.0
5
4
  - 2.1.1
5
+ - rbx-2
6
6
  env:
7
7
  - DB=sqlite3
8
8
  - DB=mysql
9
9
  - DB=postgresql
10
10
  gemfile:
11
- - gemfiles/rails_3.2.gemfile
12
- - gemfiles/rails_4.0.gemfile
13
- - gemfiles/rails_4.1.gemfile
14
- - gemfiles/rails_edge.gemfile
11
+ - gemfiles/activerecord_3.2.gemfile
12
+ - gemfiles/activerecord_4.0.gemfile
13
+ - gemfiles/activerecord_4.1.gemfile
14
+ - gemfiles/activerecord_edge.gemfile
15
15
  cache: bundler
16
16
  script: bundle exec rake
17
- before_install:
18
- - gem install bundler
17
+ before_install: gem install bundler
19
18
  bundler_args: '--without local_development'
20
19
  matrix:
21
20
  fast_finish: true
21
+ allow_failures:
22
+ - gemfile: gemfiles/activerecord_edge.gemfile
23
+ - rvm: rbx-2
data/Appraisals CHANGED
@@ -1,15 +1,20 @@
1
- appraise "rails-3.2" do
2
- gem "rails", "~> 3.2"
1
+ appraise "activerecord-3.2" do
2
+ gem "activerecord", "~> 3.2"
3
+ gem "actionpack", "~> 3.2"
3
4
  end
4
5
 
5
- appraise "rails-4.0" do
6
- gem "rails", "~> 4.0"
6
+ appraise "activerecord-4.0" do
7
+ gem "activerecord", "~> 4.0"
8
+ gem "actionpack", "~> 4.0"
7
9
  end
8
10
 
9
- appraise "rails-4.1" do
10
- gem "rails", "~> 4.1.0.beta1"
11
+ appraise "activerecord-4.1" do
12
+ gem "activerecord", "~> 4.1"
13
+ gem "actionpack", "~> 4.1"
11
14
  end
12
15
 
13
- appraise "rails-edge" do
14
- gem "rails", github: "rails/rails"
16
+ appraise "activerecord-edge" do
17
+ gem "activerecord", github: "rails/rails"
18
+ gem "actionpack", github: "rails/rails"
19
+ gem 'arel', github: 'rails/arel'
15
20
  end
@@ -8,9 +8,17 @@ As such, a _Feature_ would map to either major or minor. A _bug fix_ to a patch.
8
8
 
9
9
  * Breaking Changes
10
10
  * Features
11
+ * [@chess #413 Hook to support STI subclasses of Tag in save_tags](https://github.com/mbleigh/acts-as-taggable-on/pull/413)
11
12
  * Fixes
13
+ * [@jdelStrother #515 Rename Compatibility methods to reduce chance of conflicts ](https://github.com/mbleigh/acts-as-taggable-on/pull/515)
14
+ * [@seuros #512 fix for << method](https://github.com/mbleigh/acts-as-taggable-on/pull/512)
15
+ * [@sonots #510 fix IN subquery error for mysql](https://github.com/mbleigh/acts-as-taggable-on/pull/510)
16
+ * [@jonseaberg #499 fix for race condition when multiple processes try to add the same tag](https://github.com/mbleigh/acts-as-taggable-on/pull/499)
17
+ * [@leklund #496 Fix for distinct and postgresql json columns errors](https://github.com/mbleigh/acts-as-taggable-on/pull/496)
18
+ * [@thatbettina & @plexus #394 Multiple quoted tags](https://github.com/mbleigh/acts-as-taggable-on/pull/496)
12
19
  * Performance
13
20
  * Misc
21
+ * [@seuros #511 Rspec 3](https://github.com/mbleigh/acts-as-taggable-on/pull/511)
14
22
 
15
23
  ### [3.1.0 / 2014-03-31](https://github.com/mbleigh/acts-as-taggable-on/compare/v3.0.1...v3.1.0)
16
24
 
data/Gemfile CHANGED
@@ -7,5 +7,4 @@ group :local_development do
7
7
  gem 'guard-rspec'
8
8
  gem 'appraisal'
9
9
  gem 'rake'
10
- end
11
-
10
+ end
data/README.md CHANGED
@@ -76,14 +76,14 @@ end
76
76
  Add and remove a single tag
77
77
 
78
78
  ```ruby
79
- @user.tag_list.add("awesomer") # add a single tag. alias for <<
79
+ @user.tag_list.add("awesome") # add a single tag. alias for <<
80
80
  @user.tag_list.remove("awesome") # remove a single tag
81
81
  ```
82
82
 
83
83
  Add and remove multiple tags in an array
84
84
 
85
85
  ```ruby
86
- @user.tag_list.add("awesomer", "slicker")
86
+ @user.tag_list.add("awesome", "slick")
87
87
  @user.tag_list.remove("awesome", "slick")
88
88
  ```
89
89
 
@@ -98,7 +98,7 @@ a change on delimiter setting, make sure the string will match. See
98
98
  [configuration](#configuration) for more about delimiter.
99
99
 
100
100
  ```ruby
101
- @user.tag_list.add("awesomer, slicker", parse: true)
101
+ @user.tag_list.add("awesome, slick", parse: true)
102
102
  @user.tag_list.remove("awesome, slick", parse: true)
103
103
  ```
104
104
 
@@ -107,29 +107,39 @@ remove existing tags so use it with attention.
107
107
 
108
108
  ```ruby
109
109
  @user.tag_list = "awesome, slick, hefty"
110
+ @user.save
111
+ @user.reload
110
112
  @user.tags
111
- # => [<Tag name:"awesome">,<Tag name:"slick">,<Tag name:"hefty">]
113
+ => [#<ActsAsTaggableOn::Tag id: 1, name: "awesome", taggings_count: 1>,
114
+ #<ActsAsTaggableOn::Tag id: 2, name: "slick", taggings_count: 1>,
115
+ #<ActsAsTaggableOn::Tag id: 3, name: "hefty", taggings_count: 1>]
112
116
  ```
113
117
 
114
118
  With the defined context in model, you have multiple new methods at disposal
115
119
  to manage and view the tags in the context. For example, with `:skill` context
116
120
  these methods are added to the model: `skill_list`(and `skill_list.add`, `skill_list.remove`
117
- `skill_list=`), `skills`(plural), skill_counts
118
-
121
+ `skill_list=`), `skills`(plural), `skill_counts`.
119
122
 
120
123
  ```ruby
121
124
  @user.skill_list = "joking, clowning, boxing"
122
-
125
+ @user.save
126
+ @user.reload
123
127
  @user.skills
124
- # => [<Tag name:"joking">,<Tag name:"clowning">,<Tag name:"boxing">]
128
+ => [#<ActsAsTaggableOn::Tag id: 1, name: "joking", taggings_count: 1>,
129
+ #<ActsAsTaggableOn::Tag id: 2, name: "clowning", taggings_count: 1>,
130
+ #<ActsAsTaggableOn::Tag id: 3, name: "boxing", taggings_count: 1>]
125
131
 
126
132
  @user.skill_list.add("coding")
127
133
 
128
134
  @user.skill_list
129
- # => ["joking","clowning","boxing", "coding"]
135
+ # => ["joking", "clowning", "boxing", "coding"]
136
+
137
+ @another_user = User.new(:name => "Alice")
138
+ @another_story.skill_list.add("joking")
139
+ @another_story.save
130
140
 
131
141
  User.skill_counts
132
- # => [<Tag name="joking" count=2>,<Tag name="clowning" count=1>...]
142
+ => [#<ActsAsTaggableOn::Tag id: 1, name: "joking", taggings_count: 2>, #<ActsAsTaggableOn::Tag id: 2, name: "clowning", taggings_count: 1>, ...]
133
143
  ```
134
144
 
135
145
  To preserve the order in which tags are created use `acts_as_ordered_taggable`:
@@ -166,7 +176,7 @@ end
166
176
  User.tagged_with("awesome").by_join_date
167
177
  User.tagged_with("awesome").by_join_date.paginate(:page => params[:page], :per_page => 20)
168
178
 
169
- # Find a user with matching all tags, not just one
179
+ # Find a user with matching all tags, not just one:
170
180
  User.tagged_with(["awesome", "cool"], :match_all => true)
171
181
 
172
182
  # Find a user with any of the tags:
@@ -199,7 +209,7 @@ matched tags.
199
209
  @tom = User.find_by_name("Tom")
200
210
  @tom.skill_list # => ["hacking", "jogging", "diving"]
201
211
 
202
- @tom.find_related_skills # => [<User name="Bobby">,<User name="Frankie">]
212
+ @tom.find_related_skills # => [<User name="Bobby">, <User name="Frankie">]
203
213
  @bobby.find_related_skills # => [<User name="Tom">]
204
214
  @frankie.find_related_skills # => [<User name="Tom">]
205
215
  ```
@@ -212,7 +222,7 @@ to allow for dynamic tag contexts (this could be user generated tag contexts!)
212
222
  ```ruby
213
223
  @user = User.new(:name => "Bobby")
214
224
  @user.set_tag_list_on(:customs, "same, as, tag, list")
215
- @user.tag_list_on(:customs) # => ["same","as","tag","list"]
225
+ @user.tag_list_on(:customs) # => ["same", "as", "tag", "list"]
216
226
  @user.save
217
227
  @user.tags_on(:customs) # => [<Tag name='same'>,...]
218
228
  @user.tag_counts_on(:customs)
data/Rakefile CHANGED
@@ -1,31 +1,19 @@
1
1
  require 'rubygems'
2
- begin
3
- require 'bundler/setup'
4
- rescue LoadError
5
- STDERR.puts "Bundler not loaded"
6
- end
2
+ require 'bundler/setup'
7
3
 
8
4
  desc 'Default: run specs'
9
- task :default => :spec
5
+ task default: :spec
10
6
 
11
7
  desc 'Copy sample spec database.yml over if not exists'
12
8
  task :copy_db_config do
13
- cp 'spec/database.yml.sample', 'spec/database.yml'
9
+ cp 'spec/internal/config/database.yml.sample', 'spec/internal/config/database.yml'
14
10
  end
15
11
 
16
- task :spec => [:copy_db_config]
17
-
18
- begin
19
- require 'appraisal'
20
- desc 'Run tests across gemfiles specified in Appraisals'
21
- task :appraise => ['appraisal:cleanup', 'appraisal:install', 'appraisal']
22
- rescue LoadError
23
- puts "appraisal tasks not available"
24
- end
12
+ task spec: [:copy_db_config]
25
13
 
26
14
  require 'rspec/core/rake_task'
27
15
  RSpec::Core::RakeTask.new do |t|
28
- t.pattern = "spec/**/*_spec.rb"
16
+ t.pattern = 'spec/**/*_spec.rb'
29
17
  end
30
18
 
31
19
  Bundler::GemHelper.install_tasks
@@ -5,3 +5,9 @@ Re-run the migrations generator
5
5
  rake acts_as_taggable_on_engine:install:migrations
6
6
 
7
7
  It will create any new migrations and skip existing ones
8
+
9
+
10
+ ##Breaking changes:
11
+
12
+ - ActsAsTaggableOn::Tag is not extend with ActsAsTaggableOn::Utils anymore.
13
+ Please use ActsAsTaggableOn::Utils instead
@@ -4,35 +4,35 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'acts_as_taggable_on/version'
5
5
 
6
6
  Gem::Specification.new do |gem|
7
- gem.name = "acts-as-taggable-on"
7
+ gem.name = 'acts-as-taggable-on'
8
8
  gem.version = ActsAsTaggableOn::VERSION
9
- gem.authors = ["Michael Bleigh", "Joost Baaij"]
10
- gem.email = ["michael@intridea.com", "joost@spacebabies.nl"]
9
+ gem.authors = ['Michael Bleigh', 'Joost Baaij']
10
+ gem.email = %w(michael@intridea.com joost@spacebabies.nl)
11
11
  gem.description = %q{With ActsAsTaggableOn, you can tag a single model on several contexts, such as skills, interests, and awards. It also provides other advanced functionality.}
12
- gem.summary = "Advanced tagging for Rails."
12
+ gem.summary = 'Advanced tagging for Rails.'
13
13
  gem.homepage = 'https://github.com/mbleigh/acts-as-taggable-on'
14
- gem.license = "MIT"
14
+ gem.license = 'MIT'
15
15
 
16
16
  gem.files = `git ls-files`.split($/)
17
- gem.executables = gem.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
19
- gem.require_paths = ["lib"]
17
+ gem.test_files = gem.files.grep(%r{^spec/})
18
+ gem.require_paths = ['lib']
20
19
  gem.required_ruby_version = '>= 1.9.3'
21
20
 
22
- if File.exists?('UPGRADING.md')
21
+ if File.exist?('UPGRADING.md')
23
22
  gem.post_install_message = File.read('UPGRADING.md')
24
23
  end
25
24
 
26
25
  gem.add_runtime_dependency 'activerecord', ['>= 3', '< 5']
27
- gem.add_runtime_dependency 'activesupport', ['>= 3', '< 5']
28
26
  gem.add_runtime_dependency 'actionpack', ['>= 3', '< 5']
29
27
 
30
28
  gem.add_development_dependency 'sqlite3'
31
29
  gem.add_development_dependency 'mysql2', '~> 0.3.7'
32
30
  gem.add_development_dependency 'pg'
33
31
 
34
- gem.add_development_dependency 'rspec-rails', '2.13.0' # 2.13.1 is broken
35
- gem.add_development_dependency 'rspec', '~> 2.6'
32
+ gem.add_development_dependency 'rspec-rails' , '~> 3.0.0.beta'
33
+ gem.add_development_dependency 'rspec-its'
34
+ gem.add_development_dependency 'rspec'
36
35
  gem.add_development_dependency 'ammeter'
37
-
36
+ gem.add_development_dependency 'barrier'
37
+ gem.add_development_dependency 'database_cleaner'
38
38
  end
@@ -9,12 +9,12 @@ class ActsAsTaggableOnMigration < ActiveRecord::Migration
9
9
 
10
10
  # You should make sure that the column created is
11
11
  # long enough to store the required class names.
12
- t.references :taggable, :polymorphic => true
13
- t.references :tagger, :polymorphic => true
12
+ t.references :taggable, polymorphic: true
13
+ t.references :tagger, polymorphic: true
14
14
 
15
15
  # Limit is created to prevent MySQL error on index
16
16
  # length for MyISAM table type: http://bit.ly/vgW2Ql
17
- t.string :context, :limit => 128
17
+ t.string :context, limit: 128
18
18
 
19
19
  t.datetime :created_at
20
20
  end
@@ -1,14 +1,13 @@
1
1
  class AddMissingUniqueIndices < ActiveRecord::Migration
2
-
3
2
  def self.up
4
3
  add_index :tags, :name, unique: true
5
4
 
6
5
  remove_index :taggings, :tag_id
7
6
  remove_index :taggings, [:taggable_id, :taggable_type, :context]
8
7
  add_index :taggings,
9
- [:tag_id, :taggable_id, :taggable_type, :context, :tagger_id, :tagger_type],
10
- unique: true, name: 'taggings_idx'
11
- end
8
+ [:tag_id, :taggable_id, :taggable_type, :context, :tagger_id, :tagger_type],
9
+ unique: true, name: 'taggings_idx'
10
+ end
12
11
 
13
12
  def self.down
14
13
  remove_index :tags, :name
@@ -17,5 +16,4 @@ class AddMissingUniqueIndices < ActiveRecord::Migration
17
16
  add_index :taggings, :tag_id
18
17
  add_index :taggings, [:taggable_id, :taggable_type, :context]
19
18
  end
20
-
21
19
  end
@@ -1,6 +1,6 @@
1
1
  class AddTaggingsCounterCacheToTags < ActiveRecord::Migration
2
2
  def self.up
3
- add_column :tags, :taggings_count, :integer, :default => 0
3
+ add_column :tags, :taggings_count, :integer, default: 0
4
4
 
5
5
  ActsAsTaggableOn::Tag.reset_column_information
6
6
  ActsAsTaggableOn::Tag.find_each do |tag|
@@ -0,0 +1,15 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "~> 3.2"
6
+ gem "actionpack", "~> 3.2"
7
+
8
+ group :local_development do
9
+ gem "guard"
10
+ gem "guard-rspec"
11
+ gem "appraisal"
12
+ gem "rake"
13
+ end
14
+
15
+ gemspec :path => "../"
@@ -0,0 +1,15 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "~> 4.0"
6
+ gem "actionpack", "~> 4.0"
7
+
8
+ group :local_development do
9
+ gem "guard"
10
+ gem "guard-rspec"
11
+ gem "appraisal"
12
+ gem "rake"
13
+ end
14
+
15
+ gemspec :path => "../"
@@ -0,0 +1,15 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "~> 4.1"
6
+ gem "actionpack", "~> 4.1"
7
+
8
+ group :local_development do
9
+ gem "guard"
10
+ gem "guard-rspec"
11
+ gem "appraisal"
12
+ gem "rake"
13
+ end
14
+
15
+ gemspec :path => "../"
@@ -0,0 +1,16 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", :github => "rails/rails"
6
+ gem "actionpack", :github => "rails/rails"
7
+ gem "arel", :github => "rails/arel"
8
+
9
+ group :local_development do
10
+ gem "guard"
11
+ gem "guard-rspec"
12
+ gem "appraisal"
13
+ gem "rake"
14
+ end
15
+
16
+ gemspec :path => "../"
@@ -1,11 +1,14 @@
1
- require "active_record"
2
- require "active_record/version"
3
- require "active_support/core_ext/module"
4
- require "action_view"
1
+ require 'active_record'
2
+ require 'active_record/version'
3
+ require 'active_support/core_ext/module'
4
+ require 'action_view'
5
5
 
6
- require "digest/sha1"
6
+ require 'digest/sha1'
7
7
 
8
8
  module ActsAsTaggableOn
9
+ class DuplicateTagError < StandardError
10
+ end
11
+
9
12
  def self.setup
10
13
  @configuration ||= Configuration.new
11
14
  yield @configuration if block_given?
@@ -23,7 +26,7 @@ module ActsAsTaggableOn
23
26
  def self.glue
24
27
  setting = @configuration.delimiter
25
28
  delimiter = setting.kind_of?(Array) ? setting[0] : setting
26
- delimiter.ends_with?(" ") ? delimiter : "#{delimiter} "
29
+ delimiter.ends_with?(' ') ? delimiter : "#{delimiter} "
27
30
  end
28
31
 
29
32
  class Configuration
@@ -42,23 +45,22 @@ module ActsAsTaggableOn
42
45
  setup
43
46
  end
44
47
 
48
+ require 'acts_as_taggable_on/utils'
45
49
 
46
- require "acts_as_taggable_on/utils"
47
-
48
- require "acts_as_taggable_on/taggable"
49
- require "acts_as_taggable_on/acts_as_taggable_on/compatibility"
50
- require "acts_as_taggable_on/acts_as_taggable_on/core"
51
- require "acts_as_taggable_on/acts_as_taggable_on/collection"
52
- require "acts_as_taggable_on/acts_as_taggable_on/cache"
53
- require "acts_as_taggable_on/acts_as_taggable_on/ownership"
54
- require "acts_as_taggable_on/acts_as_taggable_on/related"
55
- require "acts_as_taggable_on/acts_as_taggable_on/dirty"
50
+ require 'acts_as_taggable_on/taggable'
51
+ require 'acts_as_taggable_on/acts_as_taggable_on/compatibility'
52
+ require 'acts_as_taggable_on/acts_as_taggable_on/core'
53
+ require 'acts_as_taggable_on/acts_as_taggable_on/collection'
54
+ require 'acts_as_taggable_on/acts_as_taggable_on/cache'
55
+ require 'acts_as_taggable_on/acts_as_taggable_on/ownership'
56
+ require 'acts_as_taggable_on/acts_as_taggable_on/related'
57
+ require 'acts_as_taggable_on/acts_as_taggable_on/dirty'
56
58
 
57
- require "acts_as_taggable_on/tagger"
58
- require "acts_as_taggable_on/tag"
59
- require "acts_as_taggable_on/tag_list"
60
- require "acts_as_taggable_on/tags_helper"
61
- require "acts_as_taggable_on/tagging"
59
+ require 'acts_as_taggable_on/tagger'
60
+ require 'acts_as_taggable_on/tag'
61
+ require 'acts_as_taggable_on/tag_list'
62
+ require 'acts_as_taggable_on/tags_helper'
63
+ require 'acts_as_taggable_on/tagging'
62
64
  require 'acts_as_taggable_on/engine'
63
65
 
64
66
  ActiveSupport.on_load(:active_record) do