memories 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/memories/base.rb +10 -0
  2. metadata +3 -3
@@ -315,6 +315,16 @@ module Memories
315
315
  self.milestones.last
316
316
  end
317
317
 
318
+ # Returns true if this instance represents a milestone
319
+ def milestone?
320
+ self.milestones.collect(&:version_number).include? self.logical_version_number
321
+ end
322
+
323
+ # Returns true if this instance is the version made right after a milestone, to denote the previous version as a milestone.
324
+ def milestone_commit?
325
+ self.milestones.collect(&:version_number).include? self.logical_version_number - 1
326
+ end
327
+
318
328
  # When you soft revert a document, you can ask what the logical revision of it is.
319
329
  # For example, suppose you soft revert a document with 10 versions to version 2.
320
330
  # @doc.revert_to 2
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: memories
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 1
10
- version: 0.3.1
9
+ - 2
10
+ version: 0.3.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matt Parker