sadie 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sadie/version.rb +1 -1
- data/lib/sadie.rb +22 -5
- metadata +4 -4
data/lib/sadie/version.rb
CHANGED
data/lib/sadie.rb
CHANGED
@@ -105,14 +105,25 @@ class Sadie
|
|
105
105
|
# if initializing primers, just remember how to get back to the primer later,
|
106
106
|
# otherwise, prime
|
107
107
|
if Sadie::_midPrimerInit?
|
108
|
+
|
109
|
+
# mid primer init, just memorize primer location
|
108
110
|
Sadie::_memorizePrimerLocation( @@mid_primer_filepath, primer_definition["provides"] )
|
109
111
|
else
|
112
|
+
|
113
|
+
# run code block with the current sadie instance
|
110
114
|
current_sadie_instance = Sadie::_getCurrentSadieInstance
|
111
|
-
current_primer_filepath = Sadie::_getCurrentPrimerFilepath
|
112
115
|
yield( current_sadie_instance )
|
116
|
+
|
117
|
+
# loop thru all primer provides, ensuring each primed
|
118
|
+
current_primer_filepath = Sadie::_getCurrentPrimerFilepath
|
113
119
|
primer_definition["provides"].each do | key |
|
120
|
+
|
121
|
+
# skip blank lines
|
114
122
|
next if key.match /^\s*$/
|
123
|
+
|
115
124
|
#puts "Prime> providing: #{key}"
|
125
|
+
|
126
|
+
# key primed or raise error
|
116
127
|
current_sadie_instance.primed? key \
|
117
128
|
or raise "primer definition file: #{current_primer_filepath} was supposed to define #{key}, but did not"
|
118
129
|
end
|
@@ -201,18 +212,20 @@ class Sadie
|
|
201
212
|
_initializeWithSessionId( get( "sadie.session_id" ) )
|
202
213
|
end
|
203
214
|
|
204
|
-
private
|
205
|
-
|
206
|
-
|
207
215
|
# ==method: primed?
|
208
216
|
#
|
209
|
-
#
|
217
|
+
# INTERNAL: this method should only be called the the class method, Prime
|
218
|
+
#
|
210
219
|
def primed?( k )
|
211
220
|
@flag_primed[:"#{k}"] \
|
212
221
|
and return true
|
213
222
|
return false
|
214
223
|
end
|
215
224
|
|
225
|
+
# ==method: primed?
|
226
|
+
#
|
227
|
+
# INTERNAL: this method should only be called the the class method, Prime
|
228
|
+
#
|
216
229
|
def expensive?( k )
|
217
230
|
@flag_expensive[:"#{k}"] \
|
218
231
|
and return true
|
@@ -220,6 +233,10 @@ class Sadie
|
|
220
233
|
end
|
221
234
|
|
222
235
|
|
236
|
+
|
237
|
+
private
|
238
|
+
|
239
|
+
|
223
240
|
def _prime ( k )
|
224
241
|
primer_dirpath = _get("sadie.primers_dirpath")
|
225
242
|
if primer_filepath = @@primer_hash["#{primer_dirpath}"]["#{k}"]
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sadie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 6
|
10
|
+
version: 0.0.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Fred McDavid
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-01-
|
18
|
+
date: 2012-01-20 00:00:00 Z
|
19
19
|
dependencies: []
|
20
20
|
|
21
21
|
description: Sadie is a data framework intended to ease the pain of managing related data.
|