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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5caab7c06cc22c8d471dff482d8a0e8697bd9fea
4
- data.tar.gz: 8402bccf294c70bd31d12e4bf31eda66e4b347db
3
+ metadata.gz: 41b7dca53fda65125a90143737854b6fefda5156
4
+ data.tar.gz: b0a453c0aa5aa9f40455f3f656c4f74376cdf828
5
5
  SHA512:
6
- metadata.gz: 6e6370b2e38a4c3d97f5d48e43057cf1890f22cbd059f9ffd7f36a4781c7e9863bb32bbdef3e5c76cf3d5f7c8f4ec5432fc70671080567d95f04018e78c7a3b0
7
- data.tar.gz: ff1200c35f2076cfdf3182e7b6d65a67707436c806782f9df6bfe363291c75942d634cc6da1599cb14d974dda3c313ab2a98d8f1cec944499c9c4de83b655f0c
6
+ metadata.gz: 7331fcc7c2865f3eb6c9c734b7abcbe9e1ae16fc570868b978a78b6d26467ddf04235810f788dcec3e915faed6f7927009e2ccc4bbe0e7fc2e3473521cbcfa70
7
+ data.tar.gz: 64b42b9c53f92897b833464b5040bc2fa698f39cbe31c8142d9f5367a137fdc23def53960da25e4ebae6e579bb2395f44586259b0033e9423d0b48eb1bf9b270
data/.travis.yml CHANGED
@@ -3,5 +3,7 @@ script: bundle exec appraisal rspec
3
3
  rvm:
4
4
  - 2.0.0
5
5
  - 2.2.0
6
+ before_install:
7
+ - gem install bundler
6
8
  before_script:
7
9
  - bundle exec appraisal install
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.12'
6
+ gem 'rails', '~> 4.0.13'
7
7
  end
8
8
 
9
9
  appraise 'rails_4_1' do
10
- gem 'rails', '~> 4.1.8'
10
+ gem 'rails', '~> 4.1.13'
11
11
  end
12
12
 
13
13
  appraise 'rails_4_2' do
14
- gem 'rails', '~> 4.2.0'
14
+ gem 'rails', '~> 4.2.4'
15
15
  end
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
+
5
+ gem 'test-unit', :platform => :ruby_22
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.6.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.
@@ -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 Rails.version.to_s < '4.0.0'
7
+ attr_accessible :name if ActiveRecord::VERSION::MAJOR == 3
8
8
 
9
9
  scope :by_weight, ->{ order('gutentag_tags.taggings_count DESC') }
10
10
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
+ gem "test-unit", :platform => :ruby_22
5
6
  gem "rails", "~> 3.2.21"
6
7
 
7
8
  gemspec :path => "../"
@@ -2,6 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "~> 4.0.12"
5
+ gem "test-unit", :platform => :ruby_22
6
+ gem "rails", "~> 4.0.13"
6
7
 
7
8
  gemspec :path => "../"
@@ -2,6 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "~> 4.1.8"
5
+ gem "test-unit", :platform => :ruby_22
6
+ gem "rails", "~> 4.1.13"
6
7
 
7
8
  gemspec :path => "../"
@@ -2,6 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "~> 4.2.0"
5
+ gem "test-unit", :platform => :ruby_22
6
+ gem "rails", "~> 4.2.4"
6
7
 
7
8
  gemspec :path => "../"
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.6.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
- s.add_runtime_dependency 'appraisal', '~> 1.0.2'
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
@@ -1,5 +1,3 @@
1
- require 'rails/engine'
2
-
3
1
  class Gutentag::Engine < Rails::Engine
4
2
  engine_name :gutentag
5
3
 
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,10 @@
1
1
  require 'bundler'
2
2
 
3
+ # Get Bundler set up
4
+ Bundler.setup :default, :development
5
+ # Require Rails first
6
+ require 'rails'
7
+ # Then require everything else
3
8
  Bundler.require :default, :development
4
9
 
5
10
  Combustion.initialize! :active_record
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.6.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-01-24 00:00:00.000000000 Z
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: :runtime
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.2.2
171
+ rubygems_version: 2.4.8
144
172
  signing_key:
145
173
  specification_version: 4
146
174
  summary: Good Tags