memories 0.2.11 → 0.2.12
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +4 -1
- data/README.rdoc +6 -1
- data/lib/memories/versions_proxy.rb +6 -0
- metadata +3 -3
data/README.markdown
CHANGED
@@ -117,7 +117,7 @@ at at the first milestone. How do we do that? Simple!
|
|
117
117
|
|
118
118
|
And now our document properties are back to the where they were when we first published the document.
|
119
119
|
|
120
|
-
If you want to access the
|
120
|
+
If you want to access the version instance of a milestone, simply use the "data" method:
|
121
121
|
|
122
122
|
a.milestones.first.data.title #==> returns the "title" attribute on the first milestone
|
123
123
|
a.milestones.each do |m|
|
@@ -158,3 +158,6 @@ You can access old versions of your document via the "versions" method; it will
|
|
158
158
|
@doc.versions.count # ==> returns the number of versions of your document
|
159
159
|
@doc.versions.last # ==> returns the latest version of your document
|
160
160
|
@doc.versions.first # ==> returns the first version of your document
|
161
|
+
@doc.versions.each do |v|
|
162
|
+
puts v.some_property
|
163
|
+
end
|
data/README.rdoc
CHANGED
@@ -116,7 +116,7 @@ at at the first milestone. How do we do that? Simple!
|
|
116
116
|
|
117
117
|
And now our document properties are back to the where they were when we first published the document.
|
118
118
|
|
119
|
-
If you want to access the
|
119
|
+
If you want to access the version instance of a milestone, simply use the "data" method:
|
120
120
|
|
121
121
|
a.milestones.first.data.title #==> returns the "title" attribute on the first milestone
|
122
122
|
a.milestones.each do |m|
|
@@ -156,3 +156,8 @@ You can access old versions of your document via the "versions" method; it will
|
|
156
156
|
@doc.versions['rev-1-kjfdsla3289430289432'] # ==> returns version 1 of your document
|
157
157
|
@doc.versions[1..20] # ==> returns versions 1 through 20 of your document
|
158
158
|
@doc.versions.count # ==> returns the number of versions of your document
|
159
|
+
@doc.versions.last # ==> returns the latest version of your document
|
160
|
+
@doc.versions.first # ==> returns the first version of your document
|
161
|
+
@doc.versions.each do |v|
|
162
|
+
puts v.some_property
|
163
|
+
end
|
@@ -52,6 +52,12 @@ module Memories
|
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
+
# Iterate through all versions
|
56
|
+
# @doc.versions.each {|v| puts v.some_property}
|
57
|
+
def each(&block)
|
58
|
+
version_range(1..@doc.current_version).each &block
|
59
|
+
end
|
60
|
+
|
55
61
|
private
|
56
62
|
def version_range(range)
|
57
63
|
sanitize_range(range).to_a.map {|i| version_num i}
|
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:
|
4
|
+
hash: 15
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 12
|
10
|
+
version: 0.2.12
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Matt Parker
|