gutentag 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/Appraisals +4 -4
- data/Gemfile +2 -0
- data/README.md +28 -1
- data/app/models/gutentag/tag.rb +1 -1
- data/gemfiles/rails_3_2.gemfile +1 -0
- data/gemfiles/rails_4_0.gemfile +2 -1
- data/gemfiles/rails_4_1.gemfile +2 -1
- data/gemfiles/rails_4_2.gemfile +2 -1
- data/gutentag.gemspec +5 -2
- data/lib/gutentag.rb +13 -1
- data/lib/gutentag/engine.rb +0 -2
- data/spec/spec_helper.rb +5 -0
- metadata +32 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41b7dca53fda65125a90143737854b6fefda5156
|
4
|
+
data.tar.gz: b0a453c0aa5aa9f40455f3f656c4f74376cdf828
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7331fcc7c2865f3eb6c9c734b7abcbe9e1ae16fc570868b978a78b6d26467ddf04235810f788dcec3e915faed6f7927009e2ccc4bbe0e7fc2e3473521cbcfa70
|
7
|
+
data.tar.gz: 64b42b9c53f92897b833464b5040bc2fa698f39cbe31c8142d9f5367a137fdc23def53960da25e4ebae6e579bb2395f44586259b0033e9423d0b48eb1bf9b270
|
data/.travis.yml
CHANGED
data/Appraisals
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
appraise 'rails_3_2' do
|
2
2
|
gem 'rails', '~> 3.2.21'
|
3
|
-
end
|
3
|
+
end if RUBY_VERSION < '2.2.0'
|
4
4
|
|
5
5
|
appraise 'rails_4_0' do
|
6
|
-
gem 'rails', '~> 4.0.
|
6
|
+
gem 'rails', '~> 4.0.13'
|
7
7
|
end
|
8
8
|
|
9
9
|
appraise 'rails_4_1' do
|
10
|
-
gem 'rails', '~> 4.1.
|
10
|
+
gem 'rails', '~> 4.1.13'
|
11
11
|
end
|
12
12
|
|
13
13
|
appraise 'rails_4_2' do
|
14
|
-
gem 'rails', '~> 4.2.
|
14
|
+
gem 'rails', '~> 4.2.4'
|
15
15
|
end
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -12,13 +12,36 @@ This was built partly as a proof-of-concept, and partly to see how a tagging gem
|
|
12
12
|
|
13
13
|
Get it into your Gemfile - and don't forget the version constraint!
|
14
14
|
|
15
|
-
gem 'gutentag', '~> 0.
|
15
|
+
gem 'gutentag', '~> 0.7.0'
|
16
16
|
|
17
17
|
Next: your tags get persisted to your database, so let's import and run the migrations to get the tables set up:
|
18
18
|
|
19
19
|
rake gutentag:install:migrations
|
20
20
|
rake db:migrate
|
21
21
|
|
22
|
+
If you want to use Gutentag outside of Rails, you can. However, this means you lose the migration import rake task. As a workaround, here's the expected schema (as of 0.7.0):
|
23
|
+
|
24
|
+
create_table :gutentag_taggings do |t|
|
25
|
+
t.integer :tag_id, :null => false
|
26
|
+
t.integer :taggable_id, :null => false
|
27
|
+
t.string :taggable_type, :null => false
|
28
|
+
t.timestamps :null => false
|
29
|
+
end
|
30
|
+
|
31
|
+
add_index :gutentag_taggings, :tag_id
|
32
|
+
add_index :gutentag_taggings, [:taggable_type, :taggable_id]
|
33
|
+
add_index :gutentag_taggings, [:taggable_type, :taggable_id, :tag_id],
|
34
|
+
:unique => true, :name => 'unique_taggings'
|
35
|
+
|
36
|
+
create_table :gutentag_tags do |t|
|
37
|
+
t.string :name, :null => false
|
38
|
+
t.integer :taggings_count, :null => false, :default => 0
|
39
|
+
t.timestamps :null => false
|
40
|
+
end
|
41
|
+
|
42
|
+
add_index :gutentag_tags, :name, :unique => true
|
43
|
+
add_index :gutentag_tags, :taggings_count
|
44
|
+
|
22
45
|
## Upgrading
|
23
46
|
|
24
47
|
### 0.6.0
|
@@ -57,6 +80,10 @@ Changes to tag_names are not persisted immediately - you must save your taggable
|
|
57
80
|
article.tag_names << 'ruby'
|
58
81
|
article.save
|
59
82
|
|
83
|
+
## Contribution
|
84
|
+
|
85
|
+
Please note that this project now has a [Contributor Code of Conduct](http://contributor-covenant.org/version/1/0/0/). By participating in this project you agree to abide by its terms.
|
86
|
+
|
60
87
|
## Licence
|
61
88
|
|
62
89
|
Copyright (c) 2013-2015, Gutentag is developed and maintained by Pat Allan, and is released under the open MIT Licence.
|
data/app/models/gutentag/tag.rb
CHANGED
@@ -4,7 +4,7 @@ class Gutentag::Tag < ActiveRecord::Base
|
|
4
4
|
has_many :taggings, :class_name => 'Gutentag::Tagging',
|
5
5
|
:dependent => :destroy
|
6
6
|
|
7
|
-
attr_accessible :name if
|
7
|
+
attr_accessible :name if ActiveRecord::VERSION::MAJOR == 3
|
8
8
|
|
9
9
|
scope :by_weight, ->{ order('gutentag_tags.taggings_count DESC') }
|
10
10
|
|
data/gemfiles/rails_3_2.gemfile
CHANGED
data/gemfiles/rails_4_0.gemfile
CHANGED
data/gemfiles/rails_4_1.gemfile
CHANGED
data/gemfiles/rails_4_2.gemfile
CHANGED
data/gutentag.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.name = 'gutentag'
|
4
|
-
s.version = '0.
|
4
|
+
s.version = '0.7.0'
|
5
5
|
s.authors = ['Pat Allan']
|
6
6
|
s.email = ['pat@freelancing-gods.com']
|
7
7
|
s.homepage = 'https://github.com/pat/gutentag'
|
@@ -14,8 +14,11 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.require_paths = ['lib']
|
15
15
|
|
16
16
|
s.add_runtime_dependency 'activerecord', '>= 3.2.0'
|
17
|
-
|
17
|
+
|
18
|
+
s.add_development_dependency 'appraisal', '~> 1.0.2'
|
19
|
+
s.add_development_dependency 'bundler', '>= 1.7.12'
|
18
20
|
s.add_development_dependency 'combustion', '0.5.1'
|
21
|
+
s.add_development_dependency 'rails'
|
19
22
|
s.add_development_dependency 'rspec-rails', '~> 3.1'
|
20
23
|
s.add_development_dependency 'sqlite3', '~> 1.3.7'
|
21
24
|
end
|
data/lib/gutentag.rb
CHANGED
@@ -20,7 +20,6 @@ end
|
|
20
20
|
|
21
21
|
require 'gutentag/active_record'
|
22
22
|
require 'gutentag/dirty'
|
23
|
-
require 'gutentag/engine'
|
24
23
|
require 'gutentag/persistence'
|
25
24
|
require 'gutentag/tag_name'
|
26
25
|
|
@@ -29,3 +28,16 @@ if ActiveRecord::VERSION::MAJOR == 3
|
|
29
28
|
elsif ActiveRecord::VERSION::MAJOR == 4 && ActiveRecord::VERSION::MINOR < 2
|
30
29
|
Gutentag.dirtier = Gutentag::Dirty
|
31
30
|
end
|
31
|
+
|
32
|
+
if defined?(Rails::Engine)
|
33
|
+
require 'gutentag/engine'
|
34
|
+
else
|
35
|
+
require 'active_record'
|
36
|
+
ActiveRecord::Base.include Gutentag::ActiveRecord
|
37
|
+
require File.expand_path(
|
38
|
+
'./../app/models/gutentag/tag', File.dirname(__FILE__)
|
39
|
+
)
|
40
|
+
require File.expand_path(
|
41
|
+
'./../app/models/gutentag/tagging', File.dirname(__FILE__)
|
42
|
+
)
|
43
|
+
end
|
data/lib/gutentag/engine.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gutentag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pat Allan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -31,13 +31,27 @@ dependencies:
|
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 1.0.2
|
34
|
-
type: :
|
34
|
+
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 1.0.2
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.7.12
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.7.12
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: combustion
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,6 +66,20 @@ dependencies:
|
|
52
66
|
- - '='
|
53
67
|
- !ruby/object:Gem::Version
|
54
68
|
version: 0.5.1
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rails
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
55
83
|
- !ruby/object:Gem::Dependency
|
56
84
|
name: rspec-rails
|
57
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -140,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
168
|
version: '0'
|
141
169
|
requirements: []
|
142
170
|
rubyforge_project:
|
143
|
-
rubygems_version: 2.
|
171
|
+
rubygems_version: 2.4.8
|
144
172
|
signing_key:
|
145
173
|
specification_version: 4
|
146
174
|
summary: Good Tags
|