gutentag 2.0.0 → 2.1.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 +0 -1
- data/Appraisals +2 -1
- data/CHANGELOG.md +11 -1
- data/README.md +1 -1
- data/gutentag.gemspec +3 -3
- data/lib/gutentag.rb +1 -0
- data/lib/gutentag/remove_unused.rb +10 -0
- data/lib/gutentag/tag_validations.rb +2 -0
- data/spec/acceptance/removing_unused_spec.rb +20 -0
- metadata +8 -7
- data/bin/literals +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22821eb031cd1b00ea0f167035e557971b5c3c073ce56964394b96f05b364d5b
|
4
|
+
data.tar.gz: d523b07744aa3159028c765284b91e4d83bfebff3ad5fdaab27383bfee76e1d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04f2eb02cfd53bac7b394f07e0c2d035b79978b96388f7ea8c083adfb2bc5cbe59a2ae4a4535863455d3cdc62260c8927879ef987cd1596567c3402006b954e8
|
7
|
+
data.tar.gz: fc75caec7d7a1b03f42136087c78f8cd5c0319595afca6e76b2977b8c7f11b2b75a456434342040f2c8b78a4e9f9091181a327785eae551a52adcbc2ebb3f496
|
data/.travis.yml
CHANGED
data/Appraisals
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,7 +2,17 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project (at least, from v0.5.0 onwards) will be documented in this file.
|
4
4
|
|
5
|
-
## 2.
|
5
|
+
## 2.1.0 - 2018-02-01
|
6
|
+
|
7
|
+
### Added
|
8
|
+
|
9
|
+
* `Gutentag::RemoveUnused` is now present, and can be invoked with the `call` method. It will remove all unused tags (i.e. tags that aren't connected to any taggable objects). Related to [#19](https://github.com/pat/gutentag/issues/19).
|
10
|
+
|
11
|
+
### Fixed
|
12
|
+
|
13
|
+
* Tag validations logic fails gracefully when no database exists (Nishutosh Sharma in [#46](https://github.com/pat/gutentag/pull/46)).
|
14
|
+
|
15
|
+
## 2.0.0 - 2017-12-27
|
6
16
|
|
7
17
|
### Changed
|
8
18
|
|
data/README.md
CHANGED
@@ -80,7 +80,7 @@ These are the versions the test suite runs against. It's possible it may work on
|
|
80
80
|
Get it into your Gemfile - and don't forget the version constraint!
|
81
81
|
|
82
82
|
```Ruby
|
83
|
-
gem 'gutentag', '~> 2.
|
83
|
+
gem 'gutentag', '~> 2.1.0'
|
84
84
|
```
|
85
85
|
|
86
86
|
Next: your tags get persisted to your database, so let's import and run the migrations to get the tables set up:
|
data/gutentag.gemspec
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "gutentag"
|
6
|
-
s.version = "2.
|
6
|
+
s.version = "2.1.0"
|
7
7
|
s.authors = ["Pat Allan"]
|
8
8
|
s.email = ["pat@freelancing-gods.com"]
|
9
9
|
s.homepage = "https://github.com/pat/gutentag"
|
@@ -19,8 +19,8 @@ Gem::Specification.new do |s|
|
|
19
19
|
|
20
20
|
s.add_development_dependency "appraisal", "~> 2.1.0"
|
21
21
|
s.add_development_dependency "bundler", ">= 1.7.12"
|
22
|
-
s.add_development_dependency "combustion", "0.
|
22
|
+
s.add_development_dependency "combustion", "0.8.0"
|
23
23
|
s.add_development_dependency "rails"
|
24
24
|
s.add_development_dependency "rspec-rails", "~> 3.1"
|
25
|
-
s.add_development_dependency "rubocop", "~> 0.
|
25
|
+
s.add_development_dependency "rubocop", "~> 0.52.1"
|
26
26
|
end
|
data/lib/gutentag.rb
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "spec_helper"
|
4
|
+
|
5
|
+
describe "Removing unused" do
|
6
|
+
let(:article) { Article.create }
|
7
|
+
|
8
|
+
it "deletes only unused tags" do
|
9
|
+
pancakes = Gutentag::Tag.create :name => "pancakes"
|
10
|
+
Gutentag::Tag.create :name => "waffles"
|
11
|
+
|
12
|
+
Gutentag::Tagging.create :tag => pancakes, :taggable => article
|
13
|
+
|
14
|
+
expect(Gutentag::Tag.pluck(:name)).to match_array(%w[ pancakes waffles ])
|
15
|
+
|
16
|
+
Gutentag::RemoveUnused.call
|
17
|
+
|
18
|
+
expect(Gutentag::Tag.pluck(:name)).to match_array(%w[ pancakes ])
|
19
|
+
end
|
20
|
+
end
|
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: 2.
|
4
|
+
version: 2.1.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:
|
11
|
+
date: 2018-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
61
|
+
version: 0.8.0
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.
|
68
|
+
version: 0.8.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rails
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.
|
103
|
+
version: 0.52.1
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.
|
110
|
+
version: 0.52.1
|
111
111
|
description: A good, simple, solid tagging extension for ActiveRecord
|
112
112
|
email:
|
113
113
|
- pat@freelancing-gods.com
|
@@ -126,7 +126,6 @@ files:
|
|
126
126
|
- Rakefile
|
127
127
|
- app/models/gutentag/tag.rb
|
128
128
|
- app/models/gutentag/tagging.rb
|
129
|
-
- bin/literals
|
130
129
|
- db/migrate/1_gutentag_tables.rb
|
131
130
|
- db/migrate/2_gutentag_cache_counter.rb
|
132
131
|
- db/migrate/3_no_null_counters.rb
|
@@ -139,11 +138,13 @@ files:
|
|
139
138
|
- lib/gutentag/dirty.rb
|
140
139
|
- lib/gutentag/engine.rb
|
141
140
|
- lib/gutentag/persistence.rb
|
141
|
+
- lib/gutentag/remove_unused.rb
|
142
142
|
- lib/gutentag/tag_validations.rb
|
143
143
|
- lib/gutentag/tagged_with.rb
|
144
144
|
- lib/gutentag/tagged_with/id_query.rb
|
145
145
|
- lib/gutentag/tagged_with/name_query.rb
|
146
146
|
- lib/gutentag/tagged_with/query.rb
|
147
|
+
- spec/acceptance/removing_unused_spec.rb
|
147
148
|
- spec/acceptance/tag_names_spec.rb
|
148
149
|
- spec/acceptance/tags_spec.rb
|
149
150
|
- spec/gutentag/active_record_spec.rb
|
data/bin/literals
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
if (ruby -e "exit RUBY_VERSION.to_f >= 2.4")
|
2
|
-
then
|
3
|
-
echo "Automatic frozen string literals are supported"
|
4
|
-
gem install pragmater -v 4.0.0
|
5
|
-
pragmater --add lib --comments "# frozen_string_literal: true" --whitelist "**/*.rb"
|
6
|
-
pragmater --add spec --comments "# frozen_string_literal: true" --whitelist "**/*.rb"
|
7
|
-
else
|
8
|
-
echo "Automatic frozen string literals are not supported."
|
9
|
-
fi
|