test_ids 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/version.rb +1 -1
- data/lib/test_ids/allocator.rb +0 -10
- data/lib/test_ids.rb +15 -20
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e249266baf4396291cc0f319a287fa71642187b
|
4
|
+
data.tar.gz: 89704013f2853841006b8cf657be0f74d84017c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fe7c17bd3cbe77917de7bbca0dc219e10ecf9acda0b79eca340f3745b42dc69e771f549cc09f2eb5f82ff6741979257071f5051f62f28000d01bc5b5e145382
|
7
|
+
data.tar.gz: 2011b621e23bd29a5651802cb591e32d194d298e441d1a1382e2fb341cf9f6e6177a11cda281467c4601a517b618855f59c9dfcc61664bf0a9b9393d2068e3f4
|
data/config/version.rb
CHANGED
data/lib/test_ids/allocator.rb
CHANGED
@@ -103,16 +103,6 @@ module TestIds
|
|
103
103
|
|
104
104
|
private
|
105
105
|
|
106
|
-
def publish?
|
107
|
-
git? && config.on_completion == :publish
|
108
|
-
end
|
109
|
-
|
110
|
-
def git?
|
111
|
-
if config.repo
|
112
|
-
!!(config.repo =~ /\.git$/)
|
113
|
-
end
|
114
|
-
end
|
115
|
-
|
116
106
|
# Returns the next available bin in the pool, if they have all been given out
|
117
107
|
# the one that hasn't been used for the longest time will be given out
|
118
108
|
def allocate_bin
|
data/lib/test_ids.rb
CHANGED
@@ -57,7 +57,7 @@ module TestIds
|
|
57
57
|
@git_initialized ||= begin
|
58
58
|
if repo
|
59
59
|
@git = Git.new(local: git_database_dir, remote: repo)
|
60
|
-
git.get_lock if
|
60
|
+
git.get_lock if publish?
|
61
61
|
end
|
62
62
|
true
|
63
63
|
end
|
@@ -66,7 +66,7 @@ module TestIds
|
|
66
66
|
# Returns a full path to the database file for the given id, returns nil if
|
67
67
|
# git storage has not been enabled
|
68
68
|
def database_file(id)
|
69
|
-
if repo
|
69
|
+
if repo
|
70
70
|
if id == :not_specified
|
71
71
|
f = 'store.json'
|
72
72
|
else
|
@@ -103,38 +103,33 @@ module TestIds
|
|
103
103
|
@repo
|
104
104
|
end
|
105
105
|
|
106
|
-
|
107
|
-
|
108
|
-
#
|
109
|
-
# If a repo has not been specified, then this attribute has no effect and the
|
110
|
-
# data will always be discarded.
|
111
|
-
def on_completion
|
112
|
-
@on_completion || :save
|
106
|
+
def publish?
|
107
|
+
@publish ? @publish == :save : true
|
113
108
|
end
|
114
109
|
|
115
|
-
def
|
116
|
-
return if @
|
117
|
-
if @
|
118
|
-
fail 'You can only use a single setting for
|
110
|
+
def publish=(val)
|
111
|
+
return if @publish && publish? == val
|
112
|
+
if @publish && publish? != val
|
113
|
+
fail 'You can only use a single setting for publish per program generation run'
|
119
114
|
end
|
120
115
|
if @configuration
|
121
|
-
fail 'TestIds.
|
116
|
+
fail 'TestIds.publish must be set before creating the first configuration'
|
122
117
|
end
|
123
|
-
unless
|
124
|
-
fail '
|
118
|
+
unless [true, false].include?(val)
|
119
|
+
fail 'TestIds.publish must be set to either true or false'
|
125
120
|
end
|
126
|
-
@
|
121
|
+
@publish = val ? :save : :dont_save
|
127
122
|
end
|
128
123
|
|
129
124
|
private
|
130
125
|
|
131
126
|
def on_origen_shutdown
|
132
|
-
|
133
|
-
if repo
|
127
|
+
if !testing? && @configuration
|
128
|
+
if repo
|
134
129
|
@configuration.each do |id, config|
|
135
130
|
config.allocator.save
|
136
131
|
end
|
137
|
-
git.publish
|
132
|
+
git.publish if publish?
|
138
133
|
end
|
139
134
|
end
|
140
135
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test_ids
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen McGinty
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: origen
|