mrkurt-versioned 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc ADDED
@@ -0,0 +1,51 @@
1
+ = versioned
2
+
3
+ Simple versioning for MongoMapper
4
+
5
+ = installation
6
+
7
+ The versioned gem is hosted on gemcutter.org:
8
+
9
+ * gem install versioned
10
+
11
+ = usage
12
+
13
+ class Doc
14
+ include MongoMapper::Document
15
+ include Versioned
16
+ key :title, String
17
+ end
18
+
19
+ @doc = Doc.create(:title=>"v1")
20
+ @doc.title = "v2"
21
+ @doc.save
22
+
23
+ @doc.revert
24
+
25
+ puts @doc.title
26
+ => v1
27
+
28
+ @doc.title = "v3"
29
+ @doc.save
30
+ @doc.version
31
+ => 3
32
+
33
+ @doc.retrieve_version 2
34
+ puts @doc.title
35
+ => "v2"
36
+
37
+ @doc = Doc.find(@doc.id)
38
+ @doc.title
39
+ => "v3"
40
+ @doc.version
41
+ => 3
42
+
43
+ == Note on Patches/Pull Requests
44
+
45
+ * Fork the project.
46
+ * Make your feature addition or bug fix.
47
+ * Add tests for it. This is important so I don't break it in a
48
+ future version unintentionally.
49
+ * Commit, do not mess with rakefile, version, or history.
50
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
51
+ * Send me a pull request. Bonus points for topic branches.
data/Rakefile ADDED
@@ -0,0 +1,26 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require 'rake/testtask'
4
+ require 'rake/rdoctask'
5
+
6
+ begin
7
+ require 'jeweler'
8
+ Jeweler::Tasks.new do |g|
9
+ g.name = 'mrkurt-versioned'
10
+ g.summary = %(Versioning for MongoMapper)
11
+ g.description = %(Versioning for MongoMapper)
12
+ g.email = 'mrkurt@gmail.com'
13
+ g.homepage = 'http://github.com/mrkurt/versioned'
14
+ g.authors = %w(twoism toastyapps jacqui mrkurt)
15
+ end
16
+ Jeweler::GemcutterTasks.new
17
+ rescue LoadError
18
+ puts 'Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com'
19
+ end
20
+
21
+ Rake::TestTask.new do |t|
22
+ t.libs = %w(test)
23
+ t.pattern = 'test/**/*_test.rb'
24
+ end
25
+
26
+ task :default => :test
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
data/lib/version.rb ADDED
@@ -0,0 +1,20 @@
1
+ class Version
2
+ include MongoMapper::Document
3
+ include Comparable
4
+
5
+ key :number, Integer
6
+ key :versioned_type, String
7
+ key :versioned_id, ObjectId
8
+ key :changes, Hash
9
+ timestamps!
10
+
11
+ belongs_to :versioned, :polymorphic => true
12
+ def changes
13
+ read_attribute(:changes)
14
+ end
15
+ alias_attribute :version, :number
16
+
17
+ def <=>(other)
18
+ number <=> other.number
19
+ end
20
+ end
data/lib/versioned.rb ADDED
@@ -0,0 +1,172 @@
1
+ require 'version'
2
+
3
+ module Versioned
4
+ def self.included(base)
5
+ base.extend ClassMethods
6
+ base.class_eval do
7
+ versioned
8
+ end
9
+ end
10
+
11
+ module ClassMethods
12
+ def versioned(options = {})
13
+ class_inheritable_accessor :version_only_columns
14
+ self.version_only_columns = Array(options[:only]).map(&:to_s).uniq if options[:only]
15
+ class_inheritable_accessor :version_except_columns
16
+ self.version_except_columns = Array(options[:except]).map(&:to_s).uniq if options[:except]
17
+
18
+ class_inheritable_accessor :version_use_key
19
+ self.version_use_key = options[:use_key]
20
+
21
+ many :versions, :as => :versioned, :order => 'number ASC', :dependent => :delete_all do
22
+ def between(from, to)
23
+ from_number, to_number = number_at(from), number_at(to)
24
+ return [] if from_number.nil? || to_number.nil?
25
+ condition = (from_number == to_number) ? to_number : Range.new(*[from_number, to_number].sort)
26
+ if condition.is_a?(Range)
27
+ conditions = {'$gte' => condition.first, '$lte' => condition.last}
28
+ else
29
+ conditions = condition
30
+ end
31
+ find(:all,
32
+ :number => conditions,
33
+ :order => "number #{(from_number > to_number) ? 'DESC' : 'ASC'}"
34
+ )
35
+ end
36
+
37
+ def at(value)
38
+ case value
39
+ when Version then value
40
+ when Numeric then find_by_number(value.floor)
41
+ when Symbol then respond_to?(value) ? send(value) : nil
42
+ when Date, Time then last(:created_at => {'$lte' => value.to_time})
43
+ end
44
+ end
45
+
46
+ def number_at(value)
47
+ case value
48
+ when Version then value.number
49
+ when Numeric then value.floor
50
+ when Symbol, Date, Time then at(value).try(:number)
51
+ end
52
+ end
53
+ end
54
+
55
+ after_create :create_initial_version
56
+ after_update :create_initial_version, :if => :needs_initial_version?
57
+ after_update :create_version, :if => :needs_version?
58
+
59
+ include InstanceMethods
60
+ alias_method_chain :reload, :versions
61
+ end
62
+ end
63
+
64
+ module InstanceMethods
65
+ private
66
+ def versioned_columns
67
+ case
68
+ when version_only_columns then self.class.keys.keys & version_only_columns
69
+ when version_except_columns then self.class.keys.keys - version_except_columns
70
+ else self.class.keys.keys
71
+ end - %w(created_at created_on updated_at updated_on)
72
+ end
73
+
74
+ def needs_initial_version?
75
+ versions.empty?
76
+ end
77
+
78
+ def needs_version?
79
+ !(versioned_columns & changed).empty?
80
+ end
81
+
82
+ def reset_version(new_version = nil)
83
+ @last_version = nil if new_version.nil?
84
+ @version = new_version
85
+ end
86
+
87
+ def next_version_number(initial = false)
88
+ v = read_attribute self.version_use_key unless self.version_use_key.nil?
89
+ v = 1 if v.nil? && initial
90
+ v = last_version + 1 if v.nil? && !initial
91
+ v
92
+ end
93
+ def create_initial_version
94
+ versions.create(:changes => nil, :number => next_version_number(true))
95
+ end
96
+
97
+ def create_version
98
+ versions << Version.create(:changes => changes.slice(*versioned_columns), :number => next_version_number)
99
+ reset_version
100
+ end
101
+
102
+ public
103
+ def version
104
+ @version ||= last_version
105
+ end
106
+
107
+ def last_version
108
+ @last_version ||= versions.inject(1){|max, version| version.number > max ? version.number : max}
109
+ end
110
+
111
+ def reverted?
112
+ version != last_version
113
+ end
114
+
115
+ def reload_with_versions(*args)
116
+ reset_version
117
+ reload_without_versions(*args)
118
+ end
119
+
120
+ def changes_between(from, to)
121
+ from_number, to_number = versions.number_at(from), versions.number_at(to)
122
+ return {} if from_number == to_number
123
+ chain = versions.between(from_number, to_number)
124
+ return {} if chain.empty?
125
+
126
+ backward = chain.first > chain.last
127
+ backward ? chain.pop : chain.shift
128
+
129
+ chain.inject({}) do |changes, version|
130
+ version.changes.each do |attribute, change|
131
+ change.reverse! if backward
132
+ new_change = [changes.fetch(attribute, change).first, change.last]
133
+ changes.update(attribute => new_change)
134
+ end
135
+ changes
136
+ end
137
+ end
138
+
139
+ def revert
140
+ revert_to self.version -1
141
+ end
142
+
143
+ def retrieve_version n
144
+ versions.find_by_number(n).changes.each do |n,v|
145
+ self.send("#{n.to_sym}=",v.first)
146
+ end
147
+ end
148
+
149
+ def revert_to(value)
150
+ to_number = versions.number_at(value)
151
+ changes = changes_between(version, to_number)
152
+ return version if changes.empty?
153
+
154
+ changes.each do |attribute, change|
155
+ write_attribute(attribute, change.last)
156
+ end
157
+
158
+ reset_version(to_number)
159
+ end
160
+
161
+ def revert_to!(value)
162
+ revert_to(value)
163
+ reset_version if saved = save
164
+ saved
165
+ end
166
+
167
+ def latest_changes
168
+ return {} if version.nil? || version == 1
169
+ versions.at(version).changes
170
+ end
171
+ end
172
+ end
Binary file
@@ -0,0 +1,58 @@
1
+ require 'test_helper'
2
+
3
+ class BetweenTest < Test::Unit::TestCase
4
+ context 'The number of versions between' do
5
+ setup do
6
+ @user = User.create(:name => 'Steve Richert')
7
+ @version = @user.version
8
+ @valid = [@version, 0, 1_000_000, :first, :last, 1.day.since(@user.created_at), @user.versions.first]
9
+ @invalid = [nil, :bogus, 'bogus', Date.parse('0001-12-25')]
10
+ end
11
+
12
+ context 'the current version and the current version' do
13
+ should 'equal one' do
14
+ assert_equal 1, @user.versions.between(@version, @version).size
15
+ end
16
+ end
17
+
18
+ context 'the current version and a valid value' do
19
+ should 'not equal zero' do
20
+ @valid.each do |valid|
21
+ assert_not_equal 0, @user.versions.between(@version, valid).size
22
+ assert_not_equal 0, @user.versions.between(valid, @version).size
23
+ end
24
+ end
25
+ end
26
+
27
+ context 'the current version and an invalid value' do
28
+ should 'equal zero' do
29
+ @invalid.each do |invalid|
30
+ assert_equal 0, @user.versions.between(@version, invalid).size
31
+ assert_equal 0, @user.versions.between(invalid, @version).size
32
+ end
33
+ end
34
+ end
35
+
36
+ context 'two invalid values' do
37
+ should 'equal zero' do
38
+ @invalid.each do |first|
39
+ @invalid.each do |second|
40
+ assert_equal 0, @user.versions.between(first, second).size
41
+ assert_equal 0, @user.versions.between(second, first).size
42
+ end
43
+ end
44
+ end
45
+ end
46
+
47
+ context 'a valid value and an invalid value' do
48
+ should 'equal zero' do
49
+ @valid.each do |valid|
50
+ @invalid.each do |invalid|
51
+ assert_equal 0, @user.versions.between(valid, invalid).size
52
+ assert_equal 0, @user.versions.between(invalid, valid).size
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,28 @@
1
+ require 'test_helper'
2
+
3
+ class ChangesTest < Test::Unit::TestCase
4
+ context "A version's changes" do
5
+ setup do
6
+ @user = User.create(:name => 'Steve Richert')
7
+ end
8
+
9
+ should "initially be blank" do
10
+ assert @user.versions.first.changes.blank?
11
+ end
12
+
13
+ should 'contain all changed attributes' do
14
+ @user.name = 'Steve Jobs'
15
+ changes = @user.changes
16
+ @user.save
17
+ assert_equal changes, @user.versions.last.changes.slice(*changes.keys)
18
+ end
19
+
20
+ should 'contain no more than the changed attributes and timestamps' do
21
+ timestamps = %w(created_at created_on updated_at updated_on)
22
+ @user.name = 'Steve Jobs'
23
+ changes = @user.changes
24
+ @user.save
25
+ assert_equal changes, @user.versions.last.changes.except(*timestamps)
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,35 @@
1
+ require 'test_helper'
2
+
3
+ class ComparableTest < Test::Unit::TestCase
4
+ context 'A comparable version' do
5
+ setup do
6
+ @version_1 = Version.new(:number => 1)
7
+ @version_2 = Version.new(:number => 2)
8
+ end
9
+
10
+ should 'equal itself' do
11
+ assert @version_1 == @version_1
12
+ assert @version_2 == @version_2
13
+ end
14
+
15
+ context 'with version number 1' do
16
+ should 'not equal a version with version number 2' do
17
+ assert @version_1 != @version_2
18
+ end
19
+
20
+ should 'be less than a version with version number 2' do
21
+ assert @version_1 < @version_2
22
+ end
23
+ end
24
+
25
+ context 'with version number 2' do
26
+ should 'not equal a version with version number 1' do
27
+ assert @version_2 != @version_1
28
+ end
29
+
30
+ should 'be greater than a version with version number 1' do
31
+ assert @version_2 > @version_1
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,79 @@
1
+ require 'test_helper'
2
+
3
+ class CreationTest < Test::Unit::TestCase
4
+ context 'The number of versions' do
5
+ setup do
6
+ @name = 'Steve Richert'
7
+ @user = User.create(:name => @name)
8
+ @count = @user.versions.count
9
+ end
10
+
11
+ should 'initially equal one' do
12
+ assert_equal 1, @count
13
+ end
14
+
15
+ should 'not increase when no changes are made in an update' do
16
+ @user.name = @name
17
+ assert_equal @count, @user.versions.count
18
+ end
19
+
20
+ should 'not increase when no changes are made before a save' do
21
+ @user.save
22
+ assert_equal @count, @user.versions.count
23
+ end
24
+
25
+ should 'not increase when reverting to the current version' do
26
+ @user.revert_to!(@user.version)
27
+ assert_equal @count, @user.versions.count
28
+ end
29
+
30
+ context 'after an update' do
31
+ setup do
32
+ @initial_count = @count
33
+ @name = 'Steve Jobs'
34
+ @user.name = @name
35
+ @user.save
36
+ @count = @user.versions.count
37
+ end
38
+
39
+ should 'increase by one' do
40
+ assert_equal @initial_count + 1, @count
41
+ end
42
+
43
+ should 'increase by one when reverted' do
44
+ @user.revert_to!(:first)
45
+ assert_equal @count + 1, @user.versions.count
46
+ end
47
+
48
+ should 'not increase until a revert is saved' do
49
+ @user.revert_to(:first)
50
+ assert_equal @count, @user.versions.count
51
+ @user.save
52
+ assert_not_equal @count, @user.versions.count
53
+ end
54
+ end
55
+
56
+ should "retrieve a specific version without reverting it" do
57
+ @user.name = "Hoge"
58
+ @user.save
59
+ version_count = @user.versions.size
60
+ @user.retrieve_version 2
61
+ assert_equal version_count, @user.versions.size
62
+ end
63
+
64
+ context 'after multiple updates' do
65
+ setup do
66
+ @initial_count = @count
67
+ @new_name = 'Steve Jobs'
68
+ @user.name = @new_name
69
+ @user.name = @name
70
+ @count = @user.versions.count
71
+ end
72
+
73
+ should 'not increase when reverting to an identical version' do
74
+ @user.revert_to!(:first)
75
+ assert_equal @count, @user.versions.count
76
+ end
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,42 @@
1
+ require 'test_helper'
2
+
3
+ class LatestChangesTest < Test::Unit::TestCase
4
+ context "A created model's last changes" do
5
+ setup do
6
+ @user = User.create(:name => 'Steve Richert')
7
+ end
8
+
9
+ should 'be blank' do
10
+ assert @user.latest_changes.blank?
11
+ end
12
+ end
13
+
14
+ context "An updated model's last changes" do
15
+ setup do
16
+ @user = User.create(:name => 'Steve Richert')
17
+ @previous_attributes = @user.attributes
18
+ @user.name = 'Steve Jobs'
19
+ @current_attributes = @user.attributes
20
+ end
21
+
22
+ should 'values of two-element arrays with unique values' do
23
+ @user.latest_changes.values.each do |value|
24
+ assert_kind_of Array, value
25
+ assert_equal 2, value.size
26
+ assert_equal value, value.uniq
27
+ end
28
+ end
29
+
30
+ should 'begin with the previous attribute values' do
31
+ changes = @user.latest_changes.inject({}){|h,(k,v)| h.update(k => v.first) }
32
+ previous = @previous_attributes.slice(*@user.latest_changes.keys)
33
+ assert_equal previous, changes
34
+ end
35
+
36
+ should 'end with the current attribute values' do
37
+ changes = @user.latest_changes.inject({}){|h,(k,v)| h.update(k => v.last) }
38
+ current = @current_attributes.slice(*@user.latest_changes.keys)
39
+ assert_equal current, changes
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,79 @@
1
+ require 'test_helper'
2
+
3
+ class RevertTest < Test::Unit::TestCase
4
+ context 'A model reversion' do
5
+ setup do
6
+ @user, @attributes, @times = User.new, {}, {}
7
+ names = ['Steve Richert', 'Stephen Richert', 'Stephen Jobs', 'Steve Jobs']
8
+ time = names.size.hours.ago
9
+ names.each do |name|
10
+ @user.update_attributes({:name => name})
11
+ @attributes[@user.version] = @user.attributes
12
+ time += 1.hour
13
+ @user.versions.last.update_attributes({:created_at => time})
14
+ @times[@user.version] = time
15
+ end
16
+ @first_version, @last_version = @attributes.keys.min, @attributes.keys.max
17
+ end
18
+
19
+ should 'do nothing for a non-existent version' do
20
+ attributes = @user.attributes
21
+ @user.revert_to!(nil)
22
+ assert_equal attributes, @user.attributes
23
+ end
24
+
25
+ should 'return the new version number' do
26
+ new_version = @user.revert_to(@first_version)
27
+ assert_equal @first_version, new_version
28
+ end
29
+
30
+ should 'change the version number when saved' do
31
+ current_version = @user.version
32
+ @user.revert_to!(@first_version)
33
+ assert_not_equal current_version, @user.version
34
+ end
35
+
36
+ should 'be able to target the first version' do
37
+ @user.revert_to(:first)
38
+ assert_equal @first_version, @user.version
39
+ end
40
+
41
+ should 'be able to target the last version' do
42
+ @user.revert_to(:last)
43
+ assert_equal @last_version, @user.version
44
+ end
45
+
46
+ should 'do nothing for a non-existent method name' do
47
+ current_version = @user.version
48
+ @user.revert_to(:bogus)
49
+ assert_equal current_version, @user.version
50
+ end
51
+
52
+ should 'be able to target a version number' do
53
+ @user.revert_to(1)
54
+ assert 1, @user.version
55
+ end
56
+
57
+ should 'be able to target a date and time' do
58
+ @times.each do |version, time|
59
+ @user.revert_to(time + 1.second)
60
+ assert_equal version, @user.version
61
+ end
62
+ end
63
+
64
+ should 'be able to target a version object' do
65
+ @user.versions.each do |version|
66
+ @user.revert_to(version)
67
+ assert_equal version.number, @user.version
68
+ end
69
+ end
70
+
71
+ should "correctly roll back the model's attributes" do
72
+ timestamps = %w(created_at created_on updated_at updated_on)
73
+ @attributes.each do |version, attributes|
74
+ @user.revert_to!(version)
75
+ assert_equal attributes.except(*timestamps), @user.attributes.except(*timestamps)
76
+ end
77
+ end
78
+ end
79
+ end
data/test/schema.rb ADDED
@@ -0,0 +1,36 @@
1
+ MongoMapper.connection = Mongo::Connection.new('127.0.0.1')
2
+ MongoMapper.database = "testing_versioned"
3
+
4
+ class User
5
+ include MongoMapper::Document
6
+ include Versioned
7
+ key :first_name, String
8
+ key :last_name, String
9
+ timestamps!
10
+
11
+ def name
12
+ [first_name, last_name].compact.join(' ')
13
+ end
14
+
15
+ def name=(names)
16
+ self[:first_name], self[:last_name] = names.split(' ', 2)
17
+ end
18
+ end
19
+
20
+ class Loser
21
+ include MongoMapper::Document
22
+ extend Versioned::ClassMethods
23
+ versioned :use_key => :revision
24
+ key :revision, Integer
25
+ key :name, String
26
+ timestamps!
27
+
28
+ before_save :set_revision
29
+
30
+ def set_revision
31
+ write_attribute :revision, (Time.now.to_f * 1000).ceil
32
+ end
33
+ end
34
+
35
+ User.destroy_all
36
+ Version.destroy_all
@@ -0,0 +1,49 @@
1
+ require 'test_helper'
2
+
3
+ class SpecifiedVersionKey < Test::Unit::TestCase
4
+ context 'A specified version key' do
5
+ setup do
6
+ @name = "Blah"
7
+ @loser = Loser.create(:name => @name)
8
+ @version = @loser.version
9
+ end
10
+ should 'be used for the initial version' do
11
+ assert_equal @loser.revision, @loser.version
12
+ assert_equal @loser.revision, @loser.versions.first.number
13
+ end
14
+
15
+ context 'after an update' do
16
+ setup do
17
+ @initial_version = @loser.version
18
+ @initial_count = @loser.versions.count
19
+ @initial_name = @loser.name
20
+ @name = 'Blip'
21
+ @loser.name = @name
22
+ @loser.save
23
+ @version = @loser.version
24
+ @count = @loser.versions.count
25
+ end
26
+
27
+ should 'have a different version number' do
28
+ assert_not_equal @initial_version, @loser.version
29
+ end
30
+
31
+ should 'still be using the specified key' do
32
+ assert_equal @loser.revision, @loser.version
33
+ assert_equal @loser.revision, @loser.versions.last.number
34
+ end
35
+
36
+ should 'version count should have increased by one' do
37
+ assert_equal @initial_count + 1, @count
38
+ end
39
+
40
+ should 'revert properly' do
41
+ @loser.revert_to!(@initial_version)
42
+ assert_equal @initial_name, @loser.name
43
+ assert_equal @count + 1, @loser.versions.count
44
+ assert_not_equal @version, @loser.version
45
+ assert_not_equal @initial_version, @loser.version
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,10 @@
1
+ $: << File.join(File.dirname(__FILE__), '..', 'lib')
2
+ $: << File.dirname(__FILE__)
3
+
4
+ require 'rubygems'
5
+ require 'test/unit'
6
+ require 'shoulda'
7
+ require 'mongo_mapper'
8
+ require 'versioned'
9
+ require 'schema'
10
+ begin; require 'redgreen'; rescue LoadError; end
data/versioned.gemspec ADDED
@@ -0,0 +1,60 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{versioned}
8
+ s.version = "0.1.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["twoism", "toastyapps", "jacqui"]
12
+ s.date = %q{2009-12-17}
13
+ s.description = %q{Versioning for MongoMapper}
14
+ s.email = %q{signalstatic@gmail.com}
15
+ s.extra_rdoc_files = [
16
+ "README.markdown"
17
+ ]
18
+ s.files = [
19
+ "README.markdown",
20
+ "Rakefile",
21
+ "VERSION",
22
+ "lib/version.rb",
23
+ "lib/versioned.rb",
24
+ "test/between_test.rb",
25
+ "test/changes_test.rb",
26
+ "test/comparable_test.rb",
27
+ "test/creation_test.rb",
28
+ "test/latest_changes_test.rb",
29
+ "test/revert_test.rb",
30
+ "test/schema.rb",
31
+ "test/test_helper.rb",
32
+ "versioned.gemspec"
33
+ ]
34
+ s.homepage = %q{http://github.com/twoism/versioned}
35
+ s.rdoc_options = ["--charset=UTF-8"]
36
+ s.require_paths = ["lib"]
37
+ s.rubygems_version = %q{1.3.5}
38
+ s.summary = %q{Versioning for MongoMapper}
39
+ s.test_files = [
40
+ "test/between_test.rb",
41
+ "test/changes_test.rb",
42
+ "test/comparable_test.rb",
43
+ "test/creation_test.rb",
44
+ "test/latest_changes_test.rb",
45
+ "test/revert_test.rb",
46
+ "test/schema.rb",
47
+ "test/test_helper.rb"
48
+ ]
49
+
50
+ if s.respond_to? :specification_version then
51
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
52
+ s.specification_version = 3
53
+
54
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
55
+ else
56
+ end
57
+ else
58
+ end
59
+ end
60
+
metadata ADDED
@@ -0,0 +1,81 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mrkurt-versioned
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - twoism
8
+ - toastyapps
9
+ - jacqui
10
+ - mrkurt
11
+ autorequire:
12
+ bindir: bin
13
+ cert_chain: []
14
+
15
+ date: 2010-01-09 00:00:00 -06:00
16
+ default_executable:
17
+ dependencies: []
18
+
19
+ description: Versioning for MongoMapper
20
+ email: mrkurt@gmail.com
21
+ executables: []
22
+
23
+ extensions: []
24
+
25
+ extra_rdoc_files:
26
+ - README.rdoc
27
+ files:
28
+ - README.rdoc
29
+ - Rakefile
30
+ - VERSION
31
+ - lib/version.rb
32
+ - lib/versioned.rb
33
+ - pkg/versioned-0.1.0.gem
34
+ - test/between_test.rb
35
+ - test/changes_test.rb
36
+ - test/comparable_test.rb
37
+ - test/creation_test.rb
38
+ - test/latest_changes_test.rb
39
+ - test/revert_test.rb
40
+ - test/schema.rb
41
+ - test/specified_version_key_test.rb
42
+ - test/test_helper.rb
43
+ - versioned.gemspec
44
+ has_rdoc: true
45
+ homepage: http://github.com/mrkurt/versioned
46
+ licenses: []
47
+
48
+ post_install_message:
49
+ rdoc_options:
50
+ - --charset=UTF-8
51
+ require_paths:
52
+ - lib
53
+ required_ruby_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: "0"
58
+ version:
59
+ required_rubygems_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: "0"
64
+ version:
65
+ requirements: []
66
+
67
+ rubyforge_project:
68
+ rubygems_version: 1.3.5
69
+ signing_key:
70
+ specification_version: 3
71
+ summary: Versioning for MongoMapper
72
+ test_files:
73
+ - test/test_helper.rb
74
+ - test/between_test.rb
75
+ - test/comparable_test.rb
76
+ - test/revert_test.rb
77
+ - test/creation_test.rb
78
+ - test/latest_changes_test.rb
79
+ - test/specified_version_key_test.rb
80
+ - test/schema.rb
81
+ - test/changes_test.rb