increment 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/increment.rb +5 -1
- metadata +2 -2
data/lib/increment.rb
CHANGED
@@ -6,11 +6,15 @@ class Increment
|
|
6
6
|
|
7
7
|
def self.update(file='counter.txt')
|
8
8
|
|
9
|
+
i = '1'
|
10
|
+
|
9
11
|
if File.exists? file then
|
10
12
|
File.open(file, 'r+'){|f| i = f.read.succ; f.rewind; f.write i}
|
11
13
|
else
|
12
|
-
File.open(file,'w'){|f| f.write
|
14
|
+
File.open(file,'w'){|f| f.write i}
|
13
15
|
end
|
16
|
+
|
17
|
+
return i
|
14
18
|
end
|
15
19
|
|
16
20
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: increment
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- James Robertson
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-06-11 00:00:00 Z
|
14
14
|
dependencies: []
|
15
15
|
|
16
16
|
description:
|