atomy 0.6.12 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -1
- data/lib/atomy/codeloader.rb +31 -9
- data/lib/atomy/module.rb +1 -2
- data/lib/atomy/version.rb +1 -1
- 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: c3cde8f2dfde4e4ef9b44378e3f34dad86a0bf6f
|
4
|
+
data.tar.gz: c9a49d6929d7c678a51324ac73324ec5f634d59a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bb5963c57be61b977db39df7aac6922da343157d9e35ec2911cfeba1db9fc4f19c3425606e8363d1b95f48b9fa4d079ad4dee40a95723f2a05a5b50b06a8e58
|
7
|
+
data.tar.gz: a635a73bf15dfdd26998b637bceb8f9e6bd1d71bcf4fc0ac17339230f43cec13a08cbab5f841fd81a4c7efd3ce234bc5d52c9f206c5de0e3a7ef87015f0d1da3
|
data/Gemfile
CHANGED
data/lib/atomy/codeloader.rb
CHANGED
@@ -81,6 +81,14 @@ module Atomy
|
|
81
81
|
end
|
82
82
|
|
83
83
|
def require(path)
|
84
|
+
synchronized_load(path, false)
|
85
|
+
end
|
86
|
+
|
87
|
+
def load(path)
|
88
|
+
synchronized_load(path, true)
|
89
|
+
end
|
90
|
+
|
91
|
+
def synchronized_load(path, check_up_to_date)
|
84
92
|
file = find_source(path)
|
85
93
|
|
86
94
|
return super unless file
|
@@ -114,7 +122,7 @@ module Atomy
|
|
114
122
|
end
|
115
123
|
|
116
124
|
begin
|
117
|
-
mod = load_atomy(file)
|
125
|
+
mod = load_atomy(file, check_up_to_date)
|
118
126
|
else
|
119
127
|
req.module = mod
|
120
128
|
req.passed!
|
@@ -126,13 +134,17 @@ module Atomy
|
|
126
134
|
end
|
127
135
|
|
128
136
|
def register_feature(file, mod)
|
129
|
-
LOADED_MODULES[file] =
|
137
|
+
LOADED_MODULES[file] = {
|
138
|
+
module: mod,
|
139
|
+
time: Time.now
|
140
|
+
}
|
141
|
+
|
130
142
|
$LOADED_FEATURES << file
|
131
143
|
end
|
132
144
|
|
133
|
-
def load_atomy(file)
|
134
|
-
if loaded?(file)
|
135
|
-
LOADED_MODULES[file]
|
145
|
+
def load_atomy(file, check_up_to_date)
|
146
|
+
if loaded?(file, check_up_to_date)
|
147
|
+
LOADED_MODULES[file][:module]
|
136
148
|
else
|
137
149
|
_, mod = run_script(file)
|
138
150
|
register_feature(file, mod)
|
@@ -149,7 +161,7 @@ module Atomy
|
|
149
161
|
mod.file = file.to_sym
|
150
162
|
|
151
163
|
compiled_file_name = CodeTools::Compiler.compiled_name(file)
|
152
|
-
if
|
164
|
+
if compiled_file_up_to_date(compiled_file_name, file)
|
153
165
|
code_loader = Rubinius::CodeLoader.new(compiled_file_name)
|
154
166
|
code = code_loader.load_compiled_file(compiled_file_name, 0, 0)
|
155
167
|
|
@@ -219,15 +231,25 @@ module Atomy
|
|
219
231
|
|
220
232
|
private
|
221
233
|
|
222
|
-
def loaded?(file)
|
223
|
-
|
234
|
+
def loaded?(file, check_up_to_date)
|
235
|
+
loaded = LOADED_MODULES[file]
|
236
|
+
return false unless loaded
|
237
|
+
|
238
|
+
if check_up_to_date
|
239
|
+
return false if File.mtime(file) > loaded[:time]
|
240
|
+
|
241
|
+
compiled_file = CodeTools::Compiler.compiled_name(file)
|
242
|
+
return false unless compiled_file_up_to_date(compiled_file, file)
|
243
|
+
end
|
244
|
+
|
245
|
+
true
|
224
246
|
end
|
225
247
|
|
226
248
|
def source_extension
|
227
249
|
".ay"
|
228
250
|
end
|
229
251
|
|
230
|
-
def
|
252
|
+
def compiled_file_up_to_date(compiled_file, source_file)
|
231
253
|
return false unless compiled_file
|
232
254
|
return false unless File.exists?(compiled_file)
|
233
255
|
|
data/lib/atomy/module.rb
CHANGED
data/lib/atomy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: atomy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Suraci
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kpeg
|