dm-tags 0.9.7 → 0.9.8
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/History.txt +18 -4
- data/{License.txt → LICENSE} +0 -0
- data/Manifest.txt +6 -5
- data/README.txt +2 -2
- data/Rakefile +24 -3
- data/TODO +0 -0
- data/lib/dm-tags/dm_tags.rb +83 -69
- data/lib/dm-tags/tag.rb +4 -3
- data/lib/dm-tags/tagging.rb +6 -5
- data/lib/dm-tags/version.rb +3 -8
- data/spec/dm-tags/dm_tags_spec.rb +8 -4
- data/spec/dm-tags/tag_spec.rb +3 -2
- data/spec/dm-tags/taggable_spec.rb +3 -7
- data/spec/dm-tags/tagging_spec.rb +4 -2
- data/spec/dm-tags/updating_spec.rb +36 -0
- data/spec/spec_helper.rb +49 -5
- data/tasks/install.rb +13 -0
- data/tasks/spec.rb +25 -0
- metadata +30 -22
- data/setup.rb +0 -1585
- data/spec/classes.rb +0 -25
- data/spec/dm-setup.rb +0 -2
- data/tasks/rspec.rake +0 -21
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
pkg/*
|
data/History.txt
CHANGED
@@ -1,9 +1,23 @@
|
|
1
|
-
|
1
|
+
=== 0.9.8 / 2008-12-07
|
2
2
|
|
3
|
-
*
|
4
|
-
|
3
|
+
* 2 minor enhancements:
|
4
|
+
|
5
|
+
* Added dm-validations dependency. Tag names must be non-nil
|
6
|
+
* Added safe tagging destroy
|
5
7
|
|
6
|
-
|
8
|
+
* 2 bug fixes:
|
9
|
+
|
10
|
+
* Ensure Model#tagged_with scopes the query to just include itself [#606 state:resolved]
|
11
|
+
* internal cleanups
|
12
|
+
|
13
|
+
=== 0.0.2 / 2008-07-30
|
7
14
|
|
8
15
|
* 1 major enhancement:
|
16
|
+
|
9
17
|
* Added contextual finding to Model.tagged_with
|
18
|
+
|
19
|
+
=== 0.0.1 / 2008-07-29
|
20
|
+
|
21
|
+
* 1 major enhancement:
|
22
|
+
|
23
|
+
* Initial release
|
data/{License.txt → LICENSE}
RENAMED
File without changes
|
data/Manifest.txt
CHANGED
@@ -1,20 +1,21 @@
|
|
1
|
+
.gitignore
|
1
2
|
History.txt
|
2
|
-
|
3
|
+
LICENSE
|
3
4
|
Manifest.txt
|
4
5
|
README.txt
|
5
6
|
Rakefile
|
7
|
+
TODO
|
6
8
|
lib/dm-tags.rb
|
7
9
|
lib/dm-tags/dm_tags.rb
|
8
10
|
lib/dm-tags/tag.rb
|
9
11
|
lib/dm-tags/tagging.rb
|
10
12
|
lib/dm-tags/version.rb
|
11
|
-
setup.rb
|
12
|
-
spec/classes.rb
|
13
|
-
spec/dm-setup.rb
|
14
13
|
spec/dm-tags/dm_tags_spec.rb
|
15
14
|
spec/dm-tags/tag_spec.rb
|
16
15
|
spec/dm-tags/taggable_spec.rb
|
17
16
|
spec/dm-tags/tagging_spec.rb
|
17
|
+
spec/dm-tags/updating_spec.rb
|
18
18
|
spec/spec.opts
|
19
19
|
spec/spec_helper.rb
|
20
|
-
tasks/
|
20
|
+
tasks/install.rb
|
21
|
+
tasks/spec.rb
|
data/README.txt
CHANGED
@@ -28,7 +28,7 @@ This package brings tagging to DataMapper. It is inspired by Acts As Taggable O
|
|
28
28
|
|
29
29
|
class MyModel
|
30
30
|
include DataMapper::Resource
|
31
|
-
property :id,
|
31
|
+
property :id, Serial
|
32
32
|
has_tags_on :tags, :skills
|
33
33
|
end
|
34
34
|
|
@@ -65,7 +65,7 @@ This package brings tagging to DataMapper. It is inspired by Acts As Taggable O
|
|
65
65
|
|
66
66
|
class TagsOnly
|
67
67
|
include DataMapper::Resource
|
68
|
-
property :id,
|
68
|
+
property :id, Serial
|
69
69
|
has_tags
|
70
70
|
end
|
71
71
|
|
data/Rakefile
CHANGED
@@ -1,4 +1,25 @@
|
|
1
|
-
require '
|
2
|
-
require '
|
1
|
+
require 'pathname'
|
2
|
+
require 'rubygems'
|
3
3
|
|
4
|
-
|
4
|
+
ROOT = Pathname(__FILE__).dirname.expand_path
|
5
|
+
JRUBY = RUBY_PLATFORM =~ /java/
|
6
|
+
WINDOWS = Gem.win_platform?
|
7
|
+
SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
|
8
|
+
|
9
|
+
require ROOT + 'lib/dm-tags/version'
|
10
|
+
|
11
|
+
AUTHOR = 'Bobby Calderwood'
|
12
|
+
EMAIL = 'bobby_calderwood [a] me [d] com'
|
13
|
+
GEM_NAME = 'dm-tags'
|
14
|
+
GEM_VERSION = DataMapper::Tags::VERSION
|
15
|
+
GEM_DEPENDENCIES = [['dm-core', "~>#{GEM_VERSION}"], ['dm-validations', "~>#{GEM_VERSION}"]]
|
16
|
+
GEM_CLEAN = %w[ log pkg coverage ]
|
17
|
+
GEM_EXTRAS = { :has_rdoc => true, :extra_rdoc_files => %w[ README.txt LICENSE TODO History.txt ] }
|
18
|
+
|
19
|
+
PROJECT_NAME = 'datamapper'
|
20
|
+
PROJECT_URL = "http://github.com/sam/dm-more/tree/master/#{GEM_NAME}"
|
21
|
+
PROJECT_DESCRIPTION = PROJECT_SUMMARY = "This package brings tagging to DataMapper. It is inspired by Acts As Taggable On by Michael Bleigh, github's mbleigh. Props to him for the contextual tagging based on Acts As Taggable on Steroids."
|
22
|
+
|
23
|
+
[ ROOT, ROOT.parent ].each do |dir|
|
24
|
+
Pathname.glob(dir.join('tasks/**/*.rb').to_s).each { |f| require f }
|
25
|
+
end
|
data/TODO
ADDED
File without changes
|
data/lib/dm-tags/dm_tags.rb
CHANGED
@@ -1,7 +1,12 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
|
3
|
+
gem 'dm-core', '~>0.9.8'
|
1
4
|
require 'dm-core'
|
5
|
+
|
2
6
|
module DataMapper
|
3
7
|
module Resource
|
4
8
|
class << self
|
9
|
+
# FIXME: remove alias method chain like code
|
5
10
|
alias_method :old_included, :included
|
6
11
|
def included(receiver)
|
7
12
|
old_included(receiver)
|
@@ -12,86 +17,95 @@ module DataMapper
|
|
12
17
|
end
|
13
18
|
module DataMapper
|
14
19
|
module Tags
|
20
|
+
module SingletonMethods
|
21
|
+
# Class Methods
|
22
|
+
def tagged_with(string, options = {})
|
23
|
+
tag = Tag.first(:name => string)
|
24
|
+
conditions = {}
|
25
|
+
conditions[:tag_id] = tag.id
|
26
|
+
conditions[:tag_context] = options[:on] if options.has_key?(:on)
|
27
|
+
conditions[:taggable_type] = self.to_s
|
28
|
+
Tagging.all(conditions).map { |tagging| tagging.taggable }
|
29
|
+
end
|
30
|
+
|
31
|
+
def taggable?
|
32
|
+
true
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
15
36
|
module ClassMethods
|
16
|
-
def has_tags_on(*
|
17
|
-
|
18
|
-
|
37
|
+
def has_tags_on(*associations)
|
38
|
+
associations.flatten!
|
39
|
+
associations.uniq!
|
19
40
|
|
20
41
|
self.extend(DataMapper::Tags::SingletonMethods)
|
21
42
|
|
22
|
-
|
43
|
+
associations.each do |association|
|
44
|
+
association = association.to_s
|
45
|
+
singular = association.singular
|
46
|
+
|
23
47
|
class_eval <<-RUBY
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
def #{arg.to_s.singular}_list
|
34
|
-
@#{arg.to_s.singular}_list ||= #{arg}.map{|#{arg.to_s.singular}| #{arg.to_s.singular}.name}.sort
|
35
|
-
end
|
36
|
-
|
37
|
-
def #{arg.to_s.singular}_list=(string)
|
38
|
-
@#{arg.to_s.singular}_list = string.to_s.split(",").map{|name| name.gsub(/[^\\w\\s_-]/i,"").strip}.uniq.sort
|
39
|
-
end
|
40
|
-
|
41
|
-
def update_#{arg}
|
42
|
-
return if #{arg.to_s.singular}_list.empty?
|
43
|
-
deleted_#{arg} = frozen_#{arg.to_s.singular}_list.to_s.split(',') - #{arg.to_s.singular}_list
|
44
|
-
deleted_#{arg}.each do |name|
|
45
|
-
tag = Tag.first(:name => name)
|
46
|
-
tagging = #{arg.to_s.singular}_taggings.first(:tag_id => tag.id)
|
47
|
-
tagging.destroy
|
48
|
-
#{arg.to_s.singular}_taggings.reload
|
48
|
+
property :frozen_#{singular}_list, String
|
49
|
+
|
50
|
+
has n, :#{singular}_taggings, :class_name => "Tagging", :child_key => [:taggable_id], :taggable_type => self.to_s, :tag_context => "#{association}"
|
51
|
+
|
52
|
+
before :create, :update_#{association}
|
53
|
+
before :update, :update_#{association}
|
54
|
+
|
55
|
+
def #{association}
|
56
|
+
#{singular}_taggings.map { |tagging| tagging.tag }.sort_by { |tag| tag.name }
|
49
57
|
end
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
tag = Tag.create!(:name => name) unless tag
|
54
|
-
#{arg.to_s.singular}_taggings << Tagging.new(:tag => tag, :taggable_type => self.class.to_s, :tag_context => "#{arg}")
|
58
|
+
|
59
|
+
def #{singular}_list
|
60
|
+
@#{singular}_list ||= #{association}.map { |tag| tag.name }
|
55
61
|
end
|
56
|
-
self.frozen_#{arg.to_s.singular}_list = #{arg}.map{|#{arg.to_s.singular}| #{arg.to_s.singular}.name}.sort.join(',')
|
57
|
-
end
|
58
|
-
RUBY
|
59
|
-
end
|
60
|
-
end
|
61
62
|
|
62
|
-
|
63
|
-
|
64
|
-
|
63
|
+
def #{singular}_list=(string)
|
64
|
+
@#{singular}_list = string.to_s.split(',').map { |name| name.gsub(/[^\\w\\s_-]/i, '').strip }.uniq.sort
|
65
|
+
end
|
65
66
|
|
66
|
-
|
67
|
-
|
68
|
-
end
|
69
|
-
end
|
67
|
+
def update_#{association}
|
68
|
+
return if #{singular}_list.empty?
|
70
69
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
conditions[:tag_id] = tag.id
|
77
|
-
conditions[:tag_context] = options[:on] if options[:on]
|
78
|
-
Tagging.all(conditions).map{|tagging| tagging.taggable}
|
79
|
-
end
|
70
|
+
Tag.all(:name => frozen_#{singular}_list.to_s.split(',') - #{singular}_list).each do |tag|
|
71
|
+
if tagging = #{singular}_taggings.first(:tag_id => tag.id)
|
72
|
+
tagging.destroy
|
73
|
+
end
|
74
|
+
end
|
80
75
|
|
81
|
-
|
82
|
-
true
|
83
|
-
end
|
84
|
-
end
|
76
|
+
#{singular}_taggings.reload
|
85
77
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
78
|
+
#{singular}_list.each do |name|
|
79
|
+
tag = Tag.first(:name => name)
|
80
|
+
next if tag && #{association}.include?(tag)
|
81
|
+
tag ||= Tag.create(:name => name)
|
82
|
+
#{singular}_taggings << Tagging.new(:tag => tag, :taggable_type => self.class.to_s, :tag_context => "#{association}")
|
83
|
+
end
|
91
84
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
end
|
96
|
-
end
|
85
|
+
self.frozen_#{singular}_list = #{association}.map { |tag| tag.name }.join(',')
|
86
|
+
end
|
87
|
+
RUBY
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
def has_tags(*)
|
92
|
+
has_tags_on :tags
|
93
|
+
end
|
94
|
+
|
95
|
+
def taggable?
|
96
|
+
false
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
module InstanceMethods
|
101
|
+
def taggable?
|
102
|
+
self.class.taggable?
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
def self.included(base)
|
107
|
+
base.send(:include, InstanceMethods)
|
108
|
+
base.extend(ClassMethods)
|
109
|
+
end
|
110
|
+
end
|
97
111
|
end
|
data/lib/dm-tags/tag.rb
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
class Tag
|
2
2
|
include DataMapper::Resource
|
3
|
-
|
4
|
-
property :
|
3
|
+
|
4
|
+
property :id, Serial
|
5
|
+
property :name, String, :nullable => false, :unique => true, :unique_index => true
|
5
6
|
|
6
7
|
has n, :taggings
|
7
8
|
|
8
9
|
def taggables
|
9
|
-
taggings.map{|tagging| tagging.taggable}
|
10
|
+
taggings.map{ |tagging| tagging.taggable }
|
10
11
|
end
|
11
12
|
end
|
data/lib/dm-tags/tagging.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
class Tagging
|
2
2
|
include DataMapper::Resource
|
3
|
-
|
4
|
-
property :
|
5
|
-
property :
|
6
|
-
property :
|
7
|
-
property :
|
3
|
+
|
4
|
+
property :id, Serial
|
5
|
+
property :tag_id, Integer, :nullable => false
|
6
|
+
property :taggable_id, Integer, :nullable => false
|
7
|
+
property :taggable_type, String, :nullable => false
|
8
|
+
property :tag_context, String, :nullable => false
|
8
9
|
|
9
10
|
belongs_to :tag
|
10
11
|
|
data/lib/dm-tags/version.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
require
|
1
|
+
require 'pathname'
|
2
|
+
require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper'
|
2
3
|
|
3
4
|
describe DataMapper::Tags do
|
4
5
|
it "should add a .has_tags method to models which include DataMapper::Resource" do
|
@@ -17,17 +18,19 @@ describe DataMapper::Tags do
|
|
17
18
|
|
18
19
|
describe ".has_tags_on" do
|
19
20
|
it "should accept an array of context names" do
|
21
|
+
Object.send(:remove_const, :HasTagsOnTestModel) if defined?(HasTagsOnTestModel)
|
20
22
|
class HasTagsOnTestModel
|
21
23
|
include DataMapper::Resource
|
22
|
-
property :id,
|
24
|
+
property :id, Serial
|
23
25
|
end
|
24
26
|
lambda{HasTagsOnTestModel.has_tags_on(:should, 'not', :raise)}.should_not raise_error(ArgumentError)
|
25
27
|
end
|
26
28
|
|
27
29
|
it "should create taggable functionality for each of the context names passed" do
|
30
|
+
Object.send(:remove_const, :TestModel) if defined?(TestModel)
|
28
31
|
class TestModel
|
29
32
|
include DataMapper::Resource
|
30
|
-
property :id,
|
33
|
+
property :id, Serial
|
31
34
|
|
32
35
|
has_tags_on(:pets, 'skills', :tags)
|
33
36
|
end
|
@@ -45,9 +48,10 @@ describe DataMapper::Tags do
|
|
45
48
|
|
46
49
|
describe ".has_tags" do
|
47
50
|
it "should create a taggable with 'tags' context regardless of passed arguments" do
|
51
|
+
Object.send(:remove_const, :TagsOnly) if defined?(TagsOnly)
|
48
52
|
class TagsOnly
|
49
53
|
include DataMapper::Resource
|
50
|
-
property :id,
|
54
|
+
property :id, Serial
|
51
55
|
has_tags :pets, :skills
|
52
56
|
end
|
53
57
|
TagsOnly.should be_taggable
|
data/spec/dm-tags/tag_spec.rb
CHANGED
@@ -1,12 +1,8 @@
|
|
1
|
-
require
|
1
|
+
require 'pathname'
|
2
|
+
require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper'
|
2
3
|
|
3
4
|
describe "Taggable" do
|
4
|
-
before
|
5
|
-
TaggedModel.all.destroy!
|
6
|
-
AnotherTaggedModel.all.destroy!
|
7
|
-
DefaultTaggedModel.all.destroy!
|
8
|
-
UntaggedModel.all.destroy!
|
9
|
-
Tag.all.destroy!
|
5
|
+
before do
|
10
6
|
@taggable = DefaultTaggedModel.new
|
11
7
|
end
|
12
8
|
|
@@ -1,8 +1,10 @@
|
|
1
|
-
require
|
1
|
+
require 'pathname'
|
2
|
+
require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper'
|
3
|
+
|
2
4
|
include DataMapper::Tags
|
3
5
|
|
4
6
|
describe Tagging do
|
5
|
-
before
|
7
|
+
before do
|
6
8
|
@tagging = Tagging.new
|
7
9
|
end
|
8
10
|
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper'
|
3
|
+
|
4
|
+
describe "Tag", "when updating" do
|
5
|
+
before do
|
6
|
+
@tagged_model = TaggedModel.new
|
7
|
+
end
|
8
|
+
|
9
|
+
it "should create itself" do
|
10
|
+
@tagged_model.tag_list = "abc, def, ghi"
|
11
|
+
@tagged_model.skill_list = "Casablanca, Morocco"
|
12
|
+
@tagged_model.save
|
13
|
+
|
14
|
+
@tagged_model.should_not be_new_record
|
15
|
+
@tagged_model.reload
|
16
|
+
@tagged_model.tags.map { |t| t.name }.should == %w[ abc def ghi ]
|
17
|
+
@tagged_model.skills.map { |t| t.name }.should == %w[ Casablanca Morocco ]
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should update itself" do
|
21
|
+
@tagged_model.save
|
22
|
+
@tagged_model.should_not be_new_record
|
23
|
+
@tagged_model.reload
|
24
|
+
|
25
|
+
@tagged_model.tags.should be_empty
|
26
|
+
@tagged_model.skills.should be_empty
|
27
|
+
|
28
|
+
@tagged_model.tag_list = "abc, def, xyz, jkl"
|
29
|
+
@tagged_model.skill_list = "Sahara, Morocco"
|
30
|
+
@tagged_model.save
|
31
|
+
|
32
|
+
@tagged_model.reload
|
33
|
+
@tagged_model.tags.map { |t| t.name }.should == %w[ abc def jkl xyz ]
|
34
|
+
@tagged_model.skills.map { |t| t.name }.should == %w[ Morocco Sahara ]
|
35
|
+
end
|
36
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,8 +1,52 @@
|
|
1
|
+
require 'pathname'
|
1
2
|
require 'rubygems'
|
2
|
-
|
3
|
-
|
3
|
+
|
4
|
+
gem 'dm-core', '~>0.9.8'
|
4
5
|
require 'dm-core'
|
6
|
+
|
7
|
+
ROOT = Pathname(__FILE__).dirname.parent.expand_path
|
8
|
+
|
9
|
+
# use local dm-validations if running from dm-more directly
|
10
|
+
lib = ROOT.parent.join('dm-validations', 'lib').expand_path
|
11
|
+
$LOAD_PATH.unshift(lib) if lib.directory?
|
5
12
|
require 'dm-validations'
|
6
|
-
|
7
|
-
require
|
8
|
-
|
13
|
+
|
14
|
+
require ROOT + 'lib/dm-tags'
|
15
|
+
|
16
|
+
DataMapper.setup(:default, 'sqlite3::memory:')
|
17
|
+
|
18
|
+
Spec::Runner.configure do |config|
|
19
|
+
config.before(:each) do
|
20
|
+
Object.send(:remove_const, :TaggedModel) if defined?(TaggedModel)
|
21
|
+
class TaggedModel
|
22
|
+
include DataMapper::Resource
|
23
|
+
property :id, Serial
|
24
|
+
|
25
|
+
has_tags_on :skills, :interests, :tags
|
26
|
+
end
|
27
|
+
|
28
|
+
Object.send(:remove_const, :AnotherTaggedModel) if defined?(AnotherTaggedModel)
|
29
|
+
class AnotherTaggedModel
|
30
|
+
include DataMapper::Resource
|
31
|
+
property :id, Serial
|
32
|
+
|
33
|
+
has_tags_on :skills, :pets
|
34
|
+
end
|
35
|
+
|
36
|
+
Object.send(:remove_const, :DefaultTaggedModel) if defined?(DefaultTaggedModel)
|
37
|
+
class DefaultTaggedModel
|
38
|
+
include DataMapper::Resource
|
39
|
+
property :id, Serial
|
40
|
+
|
41
|
+
has_tags
|
42
|
+
end
|
43
|
+
|
44
|
+
Object.send(:remove_const, :UntaggedModel) if defined?(UntaggedModel)
|
45
|
+
class UntaggedModel
|
46
|
+
include DataMapper::Resource
|
47
|
+
property :id, Serial
|
48
|
+
end
|
49
|
+
|
50
|
+
DataMapper.auto_migrate!
|
51
|
+
end
|
52
|
+
end
|
data/tasks/install.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
def sudo_gem(cmd)
|
2
|
+
sh "#{SUDO} #{RUBY} -S gem #{cmd}", :verbose => false
|
3
|
+
end
|
4
|
+
|
5
|
+
desc "Install #{GEM_NAME} #{GEM_VERSION}"
|
6
|
+
task :install => [ :package ] do
|
7
|
+
sudo_gem "install --local pkg/#{GEM_NAME}-#{GEM_VERSION} --no-update-sources"
|
8
|
+
end
|
9
|
+
|
10
|
+
desc "Uninstall #{GEM_NAME} #{GEM_VERSION}"
|
11
|
+
task :uninstall => [ :clobber ] do
|
12
|
+
sudo_gem "uninstall #{GEM_NAME} -v#{GEM_VERSION} -Ix"
|
13
|
+
end
|
data/tasks/spec.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
begin
|
2
|
+
gem 'rspec', '~>1.1.11'
|
3
|
+
require 'spec'
|
4
|
+
require 'spec/rake/spectask'
|
5
|
+
|
6
|
+
task :default => [ :spec ]
|
7
|
+
|
8
|
+
desc 'Run specifications'
|
9
|
+
Spec::Rake::SpecTask.new(:spec) do |t|
|
10
|
+
t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
|
11
|
+
t.spec_files = Pathname.glob((ROOT + 'spec/**/*_spec.rb').to_s)
|
12
|
+
|
13
|
+
begin
|
14
|
+
gem 'rcov', '~>0.8'
|
15
|
+
t.rcov = JRUBY ? false : (ENV.has_key?('NO_RCOV') ? ENV['NO_RCOV'] != 'true' : true)
|
16
|
+
t.rcov_opts << '--exclude' << 'spec'
|
17
|
+
t.rcov_opts << '--text-summary'
|
18
|
+
t.rcov_opts << '--sort' << 'coverage' << '--sort-reverse'
|
19
|
+
rescue LoadError
|
20
|
+
# rcov not installed
|
21
|
+
end
|
22
|
+
end
|
23
|
+
rescue LoadError
|
24
|
+
# rspec not installed
|
25
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dm-tags
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bobby Calderwood
|
@@ -9,55 +9,66 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-12-07 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
17
|
-
type: :
|
16
|
+
name: dm-core
|
17
|
+
type: :runtime
|
18
18
|
version_requirement:
|
19
19
|
version_requirements: !ruby/object:Gem::Requirement
|
20
20
|
requirements:
|
21
|
-
- -
|
21
|
+
- - ~>
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version:
|
23
|
+
version: 0.9.8
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: dm-validations
|
27
|
+
type: :runtime
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.9.8
|
24
34
|
version:
|
25
35
|
description: This package brings tagging to DataMapper. It is inspired by Acts As Taggable On by Michael Bleigh, github's mbleigh. Props to him for the contextual tagging based on Acts As Taggable on Steroids.
|
26
36
|
email:
|
27
|
-
- bobby_calderwood
|
37
|
+
- bobby_calderwood [a] me [d] com
|
28
38
|
executables: []
|
29
39
|
|
30
40
|
extensions: []
|
31
41
|
|
32
42
|
extra_rdoc_files:
|
33
|
-
- History.txt
|
34
|
-
- License.txt
|
35
|
-
- Manifest.txt
|
36
43
|
- README.txt
|
44
|
+
- LICENSE
|
45
|
+
- TODO
|
46
|
+
- History.txt
|
37
47
|
files:
|
48
|
+
- .gitignore
|
38
49
|
- History.txt
|
39
|
-
-
|
50
|
+
- LICENSE
|
40
51
|
- Manifest.txt
|
41
52
|
- README.txt
|
42
53
|
- Rakefile
|
54
|
+
- TODO
|
43
55
|
- lib/dm-tags.rb
|
44
56
|
- lib/dm-tags/dm_tags.rb
|
45
57
|
- lib/dm-tags/tag.rb
|
46
58
|
- lib/dm-tags/tagging.rb
|
47
59
|
- lib/dm-tags/version.rb
|
48
|
-
- setup.rb
|
49
|
-
- spec/classes.rb
|
50
|
-
- spec/dm-setup.rb
|
51
60
|
- spec/dm-tags/dm_tags_spec.rb
|
52
61
|
- spec/dm-tags/tag_spec.rb
|
53
62
|
- spec/dm-tags/taggable_spec.rb
|
54
63
|
- spec/dm-tags/tagging_spec.rb
|
64
|
+
- spec/dm-tags/updating_spec.rb
|
55
65
|
- spec/spec.opts
|
56
66
|
- spec/spec_helper.rb
|
57
|
-
- tasks/
|
67
|
+
- tasks/install.rb
|
68
|
+
- tasks/spec.rb
|
58
69
|
has_rdoc: true
|
59
|
-
homepage: http://
|
60
|
-
post_install_message:
|
70
|
+
homepage: http://github.com/sam/dm-more/tree/master/dm-tags
|
71
|
+
post_install_message:
|
61
72
|
rdoc_options:
|
62
73
|
- --main
|
63
74
|
- README.txt
|
@@ -82,8 +93,5 @@ rubygems_version: 1.3.1
|
|
82
93
|
signing_key:
|
83
94
|
specification_version: 2
|
84
95
|
summary: This package brings tagging to DataMapper. It is inspired by Acts As Taggable On by Michael Bleigh, github's mbleigh. Props to him for the contextual tagging based on Acts As Taggable on Steroids.
|
85
|
-
test_files:
|
86
|
-
|
87
|
-
- spec/dm-tags/tag_spec.rb
|
88
|
-
- spec/dm-tags/taggable_spec.rb
|
89
|
-
- spec/dm-tags/tagging_spec.rb
|
96
|
+
test_files: []
|
97
|
+
|