dm-tags 0.9.11 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,16 +1,10 @@
1
- === 0.9.11 / 2009-03-29
2
-
3
- Change frozen_tag_list property to Text
4
-
5
- * 3 minor enhancements:
1
+ === 0.10.0 / 2009-10-15
6
2
 
7
- * Added add_tag(string) for convenient adding of tags
8
- * Added tag_collection method to allow easy adding/editing of tags
9
- * Added callback to destroy orphaned taggings
3
+ * Updated to work with dm-core 0.10.0
10
4
 
11
- * 1 bug fix:
5
+ === 0.9.11 / 2009-03-29
12
6
 
13
- * Fix bug in add_tag where exisiting tags would be overwritten
7
+ * No changes this version
14
8
 
15
9
  === 0.9.10 / 2009-01-19
16
10
 
data/Manifest.txt CHANGED
@@ -1,8 +1,8 @@
1
1
  .gitignore
2
- History.txt
2
+ History.rdoc
3
3
  LICENSE
4
4
  Manifest.txt
5
- README.txt
5
+ README.rdoc
6
6
  Rakefile
7
7
  TODO
8
8
  lib/dm-tags.rb
@@ -49,6 +49,7 @@ This package brings tagging to DataMapper. It is inspired by Acts As Taggable O
49
49
  #=> [#<Tag id=3 name="test">, #<Tag id=4 name="again">] # Checks for existing tags
50
50
  Tag.all
51
51
  #=> [#<Tag id=1 name="me out">, #<Tag id=2 name="please">, #<Tag id=3 name="test">, #<Tag id=4 name="again">]
52
+
52
53
  another = MyModel.new
53
54
  another.skill_list = 'test, all, you, like'
54
55
  another.save #=> true
@@ -60,13 +61,25 @@ This package brings tagging to DataMapper. It is inspired by Acts As Taggable O
60
61
  MyModel.tagged_with('test', :on => 'tags') #=> [#<MyModel id=1>]
61
62
  MyModel.tagged_with('test', :on => 'skills') #=> [#<MyModel id=2>]
62
63
 
64
+ # Deleting tags
65
+ model.tag_list = ''
66
+ model.save #=> true
67
+ model.tags
68
+ #=> []
69
+ another.skill_list = ''
70
+ another.save #=> true
71
+ another.skills
72
+ #= []
63
73
 
64
74
  #Helper methods for text fields
65
75
  model.tag_collection = "tag1, tag2, tag3"
66
76
  model.save
67
- model.tag_collection => "tag1, tag2, tag3"
77
+ model.tag_collection #=> "tag1, tag2, tag3"
68
78
  model.tags
69
79
  #=> [#<Tag id=1 name="tag1">, #<Tag id=2 name="tag2">, #<Tag id=3 name="tag3">]
80
+ model.tag_collection = ''
81
+ model.save
82
+ model.tag_collection = '' #=> ""
70
83
 
71
84
  # Traditional 'tags only' tagging
72
85
 
@@ -86,6 +99,9 @@ This package brings tagging to DataMapper. It is inspired by Acts As Taggable O
86
99
  tags_only.tag_list #=> ['only', 'tags']
87
100
  tags_only.save #=> true
88
101
  tags_only.tags #=> [#<Tag id=8 name="only">, #<Tag id=9 name="tags">]
102
+ tags_only.tag_list = ''
103
+ tags_only.save #= true
104
+ tags_only.tags #=> []
89
105
 
90
106
  == Requirements
91
107
 
data/Rakefile CHANGED
@@ -1,5 +1,4 @@
1
1
  require 'pathname'
2
- require 'rubygems'
3
2
 
4
3
  ROOT = Pathname(__FILE__).dirname.expand_path
5
4
  JRUBY = RUBY_PLATFORM =~ /java/
@@ -14,10 +13,10 @@ GEM_NAME = 'dm-tags'
14
13
  GEM_VERSION = DataMapper::Tags::VERSION
15
14
  GEM_DEPENDENCIES = [['dm-core', GEM_VERSION], ['dm-validations', GEM_VERSION]]
16
15
  GEM_CLEAN = %w[ log pkg coverage ]
17
- GEM_EXTRAS = { :has_rdoc => true, :extra_rdoc_files => %w[ README.txt LICENSE TODO History.txt ] }
16
+ GEM_EXTRAS = { :has_rdoc => true, :extra_rdoc_files => %w[ README.rdoc LICENSE TODO History.rdoc ] }
18
17
 
19
18
  PROJECT_NAME = 'datamapper'
20
- PROJECT_URL = "http://github.com/sam/dm-more/tree/master/#{GEM_NAME}"
19
+ PROJECT_URL = "http://github.com/datamapper/dm-more/tree/master/#{GEM_NAME}"
21
20
  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
21
 
23
22
  [ ROOT, ROOT.parent ].each do |dir|
@@ -1,8 +1,3 @@
1
- require 'rubygems'
2
-
3
- gem 'dm-core', '0.9.11'
4
- require 'dm-core'
5
-
6
1
  module DataMapper
7
2
  module Resource
8
3
  class << self
@@ -38,88 +33,76 @@ module DataMapper
38
33
  associations.flatten!
39
34
  associations.uniq!
40
35
 
41
- class_eval do
42
- has n, :taggings, :class_name => "Tagging", :child_key => [:taggable_id],
43
- :taggable_type => self.to_s
44
-
45
- before :destroy, :destroy_taggings unless respond_to?(:destroy_taggings)
36
+ has n, :taggings, Tagging, :child_key => [ :taggable_id ], :taggable_type => self
46
37
 
47
- def destroy_taggings
48
- taggings.destroy!
49
- end unless respond_to?(:destroy_taggings)
38
+ before :destroy, :destroy_taggings
50
39
 
51
- private :taggings, :taggings=, :destroy_taggings
40
+ unless instance_methods(false).include?('destroy_taggings')
41
+ class_eval <<-RUBY, __FILE__, __LINE__ + 1
42
+ def destroy_taggings
43
+ taggings.destroy!
44
+ end
45
+ RUBY
52
46
  end
53
47
 
54
- self.extend(DataMapper::Tags::SingletonMethods)
48
+ private :taggings, :taggings=, :destroy_taggings
49
+
50
+ extend(DataMapper::Tags::SingletonMethods)
55
51
 
56
52
  associations.each do |association|
57
53
  association = association.to_s
58
54
  singular = association.singular
59
55
 
60
- class_eval <<-RUBY
56
+ class_eval <<-RUBY, __FILE__, __LINE__ + 1
61
57
  property :frozen_#{singular}_list, Text
62
58
 
63
- has n, :#{singular}_taggings, :class_name => "Tagging", :child_key => [:taggable_id], :taggable_type => self.to_s, :tag_context => "#{association}"
64
-
65
- before :create, :update_#{association}
66
- before :update, :update_#{association}
59
+ has n, :#{singular}_taggings, Tagging, :child_key => [ :taggable_id ], :taggable_type => self, :tag_context => '#{association}'
60
+ has n, :#{association}, Tag, :through => :#{singular}_taggings, :via => :tag, :order => [ :name ]
67
61
 
68
- def #{association}
69
- #{singular}_taggings.map { |tagging| tagging.tag }.sort_by { |tag| tag.name }
70
- end
62
+ before :save, :update_#{association}
71
63
 
72
64
  def #{singular}_list
73
- @#{singular}_list ||= #{association}.map { |tag| tag.name }
65
+ @#{singular}_list ||= self.#{association}.map { |tag| tag.name }
74
66
  end
75
67
 
76
68
  def #{singular}_list=(string)
77
69
  @#{singular}_list = string.to_s.split(',').map { |name| name.gsub(/[^\\w\\s_-]/i, '').strip }.uniq.sort
78
70
  end
79
71
 
80
- def update_#{association}
81
- return if #{singular}_list.empty?
72
+ alias #{singular}_collection= #{singular}_list=
82
73
 
83
- Tag.all(:name => frozen_#{singular}_list.to_s.split(',') - #{singular}_list).each do |tag|
84
- if tagging = #{singular}_taggings.first(:tag_id => tag.id)
85
- tagging.destroy
86
- end
87
- end
74
+ def update_#{association}
88
75
 
89
- #{singular}_taggings.reload
76
+ remove_tags = self.frozen_#{singular}_list.to_s.split(',') - self.#{singular}_list
77
+ tags = self.#{association}
90
78
 
91
- #{singular}_list.each do |name|
92
- tag = Tag.first(:name => name)
93
- next if tag && #{association}.include?(tag)
94
- tag ||= Tag.create(:name => name)
95
- #{singular}_taggings << Tagging.new(:tag => tag, :taggable_type => self.class.to_s, :tag_context => "#{association}")
79
+ tags.all(:name => remove_tags).each do |tag|
80
+ tags.delete(tag)
96
81
  end
97
82
 
98
- self.frozen_#{singular}_list = #{association}.map { |tag| tag.name }.join(',')
99
- end
83
+ self.#{singular}_list.each do |name|
84
+ tag = Tag.first_or_new(:name => name)
85
+ tags << tag unless tags.include?(tag)
86
+ end
100
87
 
101
- ##
102
- # Helper methods to make setting tags easier
103
- # FIXME: figure out why calling #{singular}_list=(string) won't work
104
- def #{singular}_collection=(string)
105
- @#{singular}_list = string.to_s.split(',').map { |name| name.gsub(/[^\\w\\s_-]/i, '').strip }.uniq.sort
88
+ self.frozen_#{singular}_list = tags.map { |tag| tag.name }.join(',')
106
89
  end
107
90
 
108
91
  ##
109
92
  # Helper methods to make setting tags easier
110
93
  #
111
94
  def #{singular}_collection
112
- #{association}.map { |tag| tag.name }.join(', ')
95
+ self.#{association}.map { |tag| tag.name }.join(', ')
113
96
  end
114
97
 
115
98
  ##
116
99
  # Like tag_collection= except it only add's tags
117
100
  #
118
101
  def add_#{singular}(string)
119
- tag_array = string.to_s.split(',').map { |name| name.gsub(/[^\\w\\s_-]/i, '').strip }.uniq.sort
120
- @#{singular}_list = (tag_array + #{singular}_list)
102
+ tag_names = string.to_s.split(',').map { |name| name.gsub(/[^\\w\\s_-]/i, '').strip }
103
+ tag_names.concat(self.#{singular}_list)
104
+ @#{singular}_list = tag_names.uniq.sort
121
105
  end
122
-
123
106
  RUBY
124
107
  end
125
108
  end
@@ -135,7 +118,7 @@ module DataMapper
135
118
 
136
119
  module InstanceMethods
137
120
  def taggable?
138
- self.class.taggable?
121
+ model.taggable?
139
122
  end
140
123
  end
141
124
 
data/lib/dm-tags/tag.rb CHANGED
@@ -7,6 +7,6 @@ class Tag
7
7
  has n, :taggings
8
8
 
9
9
  def taggables
10
- taggings.map{ |tagging| tagging.taggable }
10
+ taggings.map { |tagging| tagging.taggable }
11
11
  end
12
12
  end
@@ -2,9 +2,8 @@ class Tagging
2
2
  include DataMapper::Resource
3
3
 
4
4
  property :id, Serial
5
- property :tag_id, Integer, :nullable => false
6
5
  property :taggable_id, Integer, :nullable => false
7
- property :taggable_type, String, :nullable => false
6
+ property :taggable_type, Class, :nullable => false
8
7
  property :tag_context, String, :nullable => false
9
8
 
10
9
  belongs_to :tag
@@ -14,6 +13,6 @@ class Tagging
14
13
  end
15
14
 
16
15
  def taggable
17
- Object.const_get(taggable_type).send(:get!, taggable_id)
16
+ taggable_type.get!(taggable_id)
18
17
  end
19
18
  end
@@ -1,5 +1,5 @@
1
1
  module DataMapper
2
2
  class Tags
3
- VERSION = '0.9.11'
3
+ VERSION = '0.10.0'.freeze
4
4
  end
5
5
  end
data/lib/dm-tags.rb CHANGED
@@ -1,6 +1,3 @@
1
- $:.unshift(File.dirname(__FILE__)) unless
2
- $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
-
4
1
  require 'dm-tags/tagging'
5
2
  require 'dm-tags/tag'
6
3
  require 'dm-tags/dm_tags'
@@ -1,5 +1,4 @@
1
- require 'pathname'
2
- require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper'
1
+ require 'spec_helper'
3
2
 
4
3
  describe DataMapper::Tags do
5
4
  it "should add a .has_tags method to models which include DataMapper::Resource" do
@@ -1,5 +1,4 @@
1
- require 'pathname'
2
- require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper'
1
+ require 'spec_helper'
3
2
 
4
3
  describe Tag do
5
4
  before do
@@ -22,15 +21,11 @@ describe Tag do
22
21
  end
23
22
 
24
23
  it "should list taggables for a tag" do
25
- tag = Tag.create!(:name => 'tag1')
26
- taggable1 = TaggedModel.new
27
- taggable2 = TaggedModel.new
28
- taggable3 = TaggedModel.new
29
- taggable1.tag_list = "tag1"
30
- taggable1.save
31
- taggable2.tag_list = "tag1"
32
- taggable2.save
33
- tag.taggables.should == [taggable1, taggable2]
34
- tag.taggables.include?(taggable3).should be_false
24
+ tag = Tag.create(:name => 'tag1')
25
+
26
+ taggable1 = TaggedModel.create(:tag_list => tag.name)
27
+ taggable2 = TaggedModel.create(:tag_list => tag.name)
28
+
29
+ tag.taggables.should == [ taggable1, taggable2 ]
35
30
  end
36
31
  end
@@ -1,5 +1,4 @@
1
- require 'pathname'
2
- require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper'
1
+ require 'spec_helper'
3
2
 
4
3
  describe "Taggable" do
5
4
  before do
@@ -11,15 +10,18 @@ describe "Taggable" do
11
10
  end
12
11
 
13
12
  it "should return an alphabetically sorted array of the tag names when sent #tag_list" do
14
- tag1 = Tag.create!(:name => 'tag1')
15
- tag2 = Tag.create!(:name => 'tag2')
16
- tag3 = Tag.create!(:name => 'tag3')
17
- @taggable.tag_taggings << Tagging.new(:tag => tag1, :taggable_type => DefaultTaggedModel.to_s)
18
- @taggable.tag_taggings << Tagging.new(:tag => tag2, :taggable_type => DefaultTaggedModel.to_s)
19
- @taggable.tag_taggings << Tagging.new(:tag => tag3, :taggable_type => DefaultTaggedModel.to_s)
13
+ tag_names = %w[ tag1 tag2 tag3 ]
14
+
15
+ # @taggable.tags = tag_names.map { |name| { :name => name } }
16
+
17
+ tag_names.each do |name|
18
+ @taggable.tag_taggings.new(:tag => Tag.create(:name => name))
19
+ end
20
+
20
21
  @taggable.save.should be_true
21
- @taggable = DefaultTaggedModel.get!(@taggable.id)
22
- @taggable.tag_list.should == ['tag1', 'tag2', 'tag3']
22
+
23
+ @taggable = @taggable.model.get!(@taggable.key)
24
+ @taggable.tag_list.should == tag_names
23
25
  end
24
26
 
25
27
  it "should set the tag list to a sanitized, stripped, alphabetized, unique array of tag names" do
@@ -34,9 +36,9 @@ describe "Taggable" do
34
36
 
35
37
  it "should set the associated collection of tags to those whose names
36
38
  are in the tag list upon saving, creating and deleting as necessary" do
37
- tag1 = Tag.create!(:name => 'tag1')
38
- tag2 = Tag.create!(:name => 'tag2')
39
- tag3 = Tag.create!(:name => 'tag3')
39
+ tag1 = Tag.create(:name => 'tag1')
40
+ tag2 = Tag.create(:name => 'tag2')
41
+ tag3 = Tag.create(:name => 'tag3')
40
42
  @taggable = TaggedModel.new
41
43
  @taggable.tag_list = 'tag1, tag2, tag3'
42
44
  @taggable.save.should be_true
@@ -1,16 +1,14 @@
1
- require 'pathname'
2
- require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper'
1
+ require 'spec_helper'
3
2
 
4
3
  include DataMapper::Tags
5
4
 
6
5
  describe Tagging do
7
6
  before do
8
7
  @tagging = Tagging.new
9
- @tagged_model =TaggedModel.create
8
+ @tagged_resource = TaggedModel.create
10
9
  end
11
10
 
12
11
  it "should be a model which includes DataMapper::Resource" do
13
- Tagging.should be
14
12
  Tagging.should include(DataMapper::Resource)
15
13
  end
16
14
 
@@ -41,8 +39,8 @@ describe Tagging do
41
39
 
42
40
  it "should have a method Tagging#taggable which returns the associated taggable instance" do
43
41
  @tagging.should respond_to(:taggable)
44
- @tagging.taggable_id = @tagged_model.id
45
- @tagging.taggable_type = @tagged_model.class.to_s
46
- @tagging.taggable.should == @tagged_model
42
+ @tagging.taggable_id = @tagged_resource.id
43
+ @tagging.taggable_type = @tagged_resource.model.to_s
44
+ @tagging.taggable.should == @tagged_resource
47
45
  end
48
46
  end
@@ -1,5 +1,4 @@
1
- require 'pathname'
2
- require Pathname(__FILE__).dirname.expand_path.parent + 'spec_helper'
1
+ require 'spec_helper'
3
2
 
4
3
  describe "Tag", "when updating" do
5
4
  before do
@@ -9,28 +8,35 @@ describe "Tag", "when updating" do
9
8
  it "should create itself" do
10
9
  @tagged_model.tag_list = "abc, def, ghi"
11
10
  @tagged_model.skill_list = "Casablanca, Morocco"
12
- @tagged_model.save
11
+ @tagged_model.save.should be_true
12
+ @tagged_model.should be_saved
13
13
 
14
- @tagged_model.should_not be_new_record
15
14
  @tagged_model.reload
16
15
  @tagged_model.tags.map { |t| t.name }.should == %w[ abc def ghi ]
17
16
  @tagged_model.skills.map { |t| t.name }.should == %w[ Casablanca Morocco ]
18
17
  end
19
18
 
20
19
  it "should update itself" do
21
- @tagged_model.save
22
- @tagged_model.should_not be_new_record
23
- @tagged_model.reload
20
+ @tagged_model.save.should be_true
21
+ @tagged_model.should be_saved
24
22
 
23
+ @tagged_model.reload
25
24
  @tagged_model.tags.should be_empty
26
25
  @tagged_model.skills.should be_empty
27
26
 
28
27
  @tagged_model.tag_list = "abc, def, xyz, jkl"
29
28
  @tagged_model.skill_list = "Sahara, Morocco"
30
- @tagged_model.save
29
+ @tagged_model.save.should be_true
31
30
 
32
31
  @tagged_model.reload
33
32
  @tagged_model.tags.map { |t| t.name }.should == %w[ abc def jkl xyz ]
34
33
  @tagged_model.skills.map { |t| t.name }.should == %w[ Morocco Sahara ]
34
+
35
+ @tagged_model.tag_list = ""
36
+ @tagged_model.skill_list = ""
37
+ @tagged_model.save
38
+
39
+ @tagged_model.tags.should == []
40
+ @tagged_model.skills.should == []
35
41
  end
36
42
  end
data/spec/spec.opts CHANGED
@@ -1 +1,2 @@
1
1
  --colour
2
+ --loadby random
data/spec/spec_helper.rb CHANGED
@@ -1,25 +1,46 @@
1
- require 'pathname'
2
1
  require 'rubygems'
3
2
 
4
- gem 'dm-core', '0.9.11'
3
+ # Use local dm-core if running from a typical dev checkout.
4
+ lib = File.join('..', '..', 'dm-core', 'lib')
5
+ $LOAD_PATH.unshift(lib) if File.directory?(lib)
5
6
  require 'dm-core'
6
7
 
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?
8
+ # Use local dm-validations if running from a typical dev checkout.
9
+ lib = File.join('..', 'dm-validations', 'lib')
10
+ $LOAD_PATH.unshift(lib) if File.directory?(lib)
12
11
  require 'dm-validations'
13
12
 
14
- require ROOT + 'lib/dm-tags'
13
+ # Support running specs with 'rake spec' and 'spec'
14
+ $LOAD_PATH.unshift('lib') unless $LOAD_PATH.include?('lib')
15
+
16
+ require 'dm-tags'
17
+
18
+ def load_driver(name, default_uri)
19
+ return false if ENV['ADAPTER'] != name.to_s
20
+
21
+ begin
22
+ DataMapper.setup(name, ENV["#{name.to_s.upcase}_SPEC_URI"] || default_uri)
23
+ DataMapper::Repository.adapters[:default] = DataMapper::Repository.adapters[name]
24
+ true
25
+ rescue LoadError => e
26
+ warn "Could not load do_#{name}: #{e}"
27
+ false
28
+ end
29
+ end
30
+
31
+ ENV['ADAPTER'] ||= 'sqlite3'
32
+
33
+ HAS_SQLITE3 = load_driver(:sqlite3, 'sqlite3::memory:')
34
+ HAS_MYSQL = load_driver(:mysql, 'mysql://localhost/dm_core_test')
35
+ HAS_POSTGRES = load_driver(:postgres, 'postgres://postgres@localhost/dm_core_test')
15
36
 
16
- DataMapper.setup(:default, 'sqlite3::memory:')
17
37
 
18
38
  Spec::Runner.configure do |config|
19
- config.before(:each) do
39
+ config.before do
20
40
  Object.send(:remove_const, :TaggedModel) if defined?(TaggedModel)
21
41
  class ::TaggedModel
22
42
  include DataMapper::Resource
43
+
23
44
  property :id, Serial
24
45
 
25
46
  has_tags_on :skills, :interests, :tags
@@ -28,6 +49,7 @@ Spec::Runner.configure do |config|
28
49
  Object.send(:remove_const, :AnotherTaggedModel) if defined?(AnotherTaggedModel)
29
50
  class ::AnotherTaggedModel
30
51
  include DataMapper::Resource
52
+
31
53
  property :id, Serial
32
54
 
33
55
  has_tags_on :skills, :pets
@@ -36,6 +58,7 @@ Spec::Runner.configure do |config|
36
58
  Object.send(:remove_const, :DefaultTaggedModel) if defined?(DefaultTaggedModel)
37
59
  class ::DefaultTaggedModel
38
60
  include DataMapper::Resource
61
+
39
62
  property :id, Serial
40
63
 
41
64
  has_tags
@@ -44,6 +67,7 @@ Spec::Runner.configure do |config|
44
67
  Object.send(:remove_const, :UntaggedModel) if defined?(UntaggedModel)
45
68
  class ::UntaggedModel
46
69
  include DataMapper::Resource
70
+
47
71
  property :id, Serial
48
72
  end
49
73
 
data/tasks/install.rb CHANGED
@@ -4,7 +4,7 @@ end
4
4
 
5
5
  desc "Install #{GEM_NAME} #{GEM_VERSION}"
6
6
  task :install => [ :package ] do
7
- sudo_gem "install --local pkg/#{GEM_NAME}-#{GEM_VERSION} --no-update-sources"
7
+ sudo_gem "install pkg/#{GEM_NAME}-#{GEM_VERSION} --no-update-sources"
8
8
  end
9
9
 
10
10
  desc "Uninstall #{GEM_NAME} #{GEM_VERSION}"
data/tasks/spec.rb CHANGED
@@ -1,6 +1,4 @@
1
1
  begin
2
- gem 'rspec', '~>1.2'
3
- require 'spec'
4
2
  require 'spec/rake/spectask'
5
3
 
6
4
  task :default => [ :spec ]
@@ -8,17 +6,18 @@ begin
8
6
  desc 'Run specifications'
9
7
  Spec::Rake::SpecTask.new(:spec) do |t|
10
8
  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).map { |f| f.to_s }
9
+ t.libs << 'lib' << 'spec' # needed for CI rake spec task, duplicated in spec_helper
12
10
 
13
11
  begin
14
- gem 'rcov', '~>0.8'
12
+ require 'rcov'
15
13
  t.rcov = JRUBY ? false : (ENV.has_key?('NO_RCOV') ? ENV['NO_RCOV'] != 'true' : true)
16
14
  t.rcov_opts << '--exclude' << 'spec'
17
- t.rcov_opts << '--exclude' << 'dm-validations'
18
15
  t.rcov_opts << '--text-summary'
19
16
  t.rcov_opts << '--sort' << 'coverage' << '--sort-reverse'
20
17
  rescue LoadError
21
18
  # rcov not installed
19
+ rescue SyntaxError
20
+ # rcov syntax invalid
22
21
  end
23
22
  end
24
23
  rescue LoadError
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.11
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bobby Calderwood
@@ -9,29 +9,10 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-29 00:00:00 -07:00
12
+ date: 2009-09-16 00:00:00 -07:00
13
13
  default_executable:
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: dm-core
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
20
- requirements:
21
- - - "="
22
- - !ruby/object:Gem::Version
23
- version: 0.9.11
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.11
34
- version:
14
+ dependencies: []
15
+
35
16
  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.
36
17
  email:
37
18
  - bobby_calderwood [a] me [d] com
@@ -40,16 +21,16 @@ executables: []
40
21
  extensions: []
41
22
 
42
23
  extra_rdoc_files:
43
- - README.txt
24
+ - README.rdoc
44
25
  - LICENSE
45
26
  - TODO
46
- - History.txt
27
+ - History.rdoc
47
28
  files:
48
29
  - .gitignore
49
- - History.txt
30
+ - History.rdoc
50
31
  - LICENSE
51
32
  - Manifest.txt
52
- - README.txt
33
+ - README.rdoc
53
34
  - Rakefile
54
35
  - TODO
55
36
  - lib/dm-tags.rb
@@ -67,11 +48,13 @@ files:
67
48
  - tasks/install.rb
68
49
  - tasks/spec.rb
69
50
  has_rdoc: true
70
- homepage: http://github.com/sam/dm-more/tree/master/dm-tags
51
+ homepage: http://github.com/datamapper/dm-more/tree/master/dm-tags
52
+ licenses: []
53
+
71
54
  post_install_message:
72
55
  rdoc_options:
73
56
  - --main
74
- - README.txt
57
+ - README.rdoc
75
58
  require_paths:
76
59
  - lib
77
60
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -89,9 +72,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
72
  requirements: []
90
73
 
91
74
  rubyforge_project: datamapper
92
- rubygems_version: 1.3.1
75
+ rubygems_version: 1.3.5
93
76
  signing_key:
94
- specification_version: 2
77
+ specification_version: 3
95
78
  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.
96
79
  test_files: []
97
80