protokoll 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/protokoll/auto_increment.rb +9 -27
- data/lib/protokoll/version.rb +1 -1
- data/test/dummy/log/test.log +10565 -0
- data/test/protokoll_test.rb +7 -8
- metadata +6 -6
data/test/protokoll_test.rb
CHANGED
@@ -97,9 +97,7 @@ class ProtokollTest < ActiveSupport::TestCase
|
|
97
97
|
Protocol.protokoll.pattern = "%y%m##"
|
98
98
|
|
99
99
|
protocol1 = Protocol.create
|
100
|
-
|
101
100
|
Timecop.travel(Time.now + 1.month)
|
102
|
-
|
103
101
|
protocol2 = Protocol.create
|
104
102
|
|
105
103
|
assert_equal "111001", protocol2.number
|
@@ -116,8 +114,9 @@ class ProtokollTest < ActiveSupport::TestCase
|
|
116
114
|
test "%y## on next year should get 1201" do
|
117
115
|
Protocol.protokoll.pattern = "%y##"
|
118
116
|
|
117
|
+
time = Time.local(2011, 9, 25, 12, 3, 0) #
|
119
118
|
protocol1 = Protocol.create
|
120
|
-
time = Time.local(2012, 9, 25, 12, 3, 0)
|
119
|
+
time = Time.local(2012, 9, 25, 12, 3, 0) # exactly 1 year after
|
121
120
|
Timecop.travel(time)
|
122
121
|
|
123
122
|
protocol2 = Protocol.create
|
@@ -179,6 +178,8 @@ class ProtokollTest < ActiveSupport::TestCase
|
|
179
178
|
assert_equal "2011150001PROTO", protocol1.number
|
180
179
|
end
|
181
180
|
|
181
|
+
## Can't reproduce this on test environmet!
|
182
|
+
## if you know how to do that, contact-me!
|
182
183
|
# test "Start application with populated db." do
|
183
184
|
# Protocol.protokoll.pattern = "%Y%M####PROTO"
|
184
185
|
#
|
@@ -186,11 +187,9 @@ class ProtokollTest < ActiveSupport::TestCase
|
|
186
187
|
# Protocol.create
|
187
188
|
# Protocol.create
|
188
189
|
#
|
189
|
-
# # restart application
|
190
|
-
#
|
191
|
-
#
|
192
|
-
# end
|
193
|
-
#
|
190
|
+
# # restart application or reload Protocol model
|
191
|
+
# # how do I do that?
|
192
|
+
#
|
194
193
|
# protocol = Protocol.create
|
195
194
|
#
|
196
195
|
# assert_equal "2011090004PROTO", protocol.number
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: protokoll
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-10-29 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement: &
|
16
|
+
requirement: &70286020323560 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.1.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70286020323560
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: sqlite3
|
27
|
-
requirement: &
|
27
|
+
requirement: &70286020353580 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70286020353580
|
36
36
|
description: ! 'Rails gem to enable creation of autoincrement Time based string on
|
37
37
|
a model defined by a pattern. Ex: :pattern => ''P%y###'' produces: ''P2011001'',
|
38
38
|
''P2011002''...'
|