procemon 0.4.3 → 0.4.4
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.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZmEwMDA2YjA1YTJhNmY0MDdlYjI0ZWIzOGU1MDJkMjMwZjE5ODdlZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTBmMDQxYjkwMzMzNTAyYTdmYjM0N2FhYTBjZmZiYTI3OWU4MTlhZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZDI4NWI0ZDVkNjhmMjQyODJiNTc1MTJhNjViZGY2OGFlNDQzN2Y3NTcyNDVi
|
10
|
+
OWE2OGIyNDFhNTJmNjYxNjhjM2M3MjUyY2JjZTBkODQ3YzkxYWNiMDk0Y2Q3
|
11
|
+
NjU2ZTNhNjM0MjZmZjQxOGMxN2E3YjA1NWRhMzIzOTkzN2VhZDQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NTY1MTMxYWRkYzE1OGZhNzQ5ZDMwMTVjZDI0YmVjODc0NTRhNDlmODRhNWRj
|
14
|
+
ZTdjNGUyOGIwZGY0MTMyYmM3NGJkZjc5ZGE3YzA5MDJiMWFkY2UxMjFiY2Jj
|
15
|
+
Y2IwMGU0NmEwMjIwNmM2MGI3MjJkMjllMzMyYjZiYzdkYzM0OGQ=
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.4
|
@@ -9,8 +9,9 @@ module MethodToProcSource
|
|
9
9
|
return_string= ProcSource.new
|
10
10
|
block= 0
|
11
11
|
end
|
12
|
-
|
13
|
-
|
12
|
+
|
13
|
+
unless ProcSource.source_cache[self.source_location].nil?
|
14
|
+
return ProcSource.source_cache[self.source_location]
|
14
15
|
else
|
15
16
|
|
16
17
|
File.open(File.expand_path(self.source_location[0])
|
@@ -43,7 +44,7 @@ module MethodToProcSource
|
|
43
44
|
return_string.sub!(/^[^{]*(?!={)/,'Proc.new')
|
44
45
|
end
|
45
46
|
|
46
|
-
|
47
|
+
ProcSource.source_cache[self.source_location]= return_string
|
47
48
|
|
48
49
|
return return_string
|
49
50
|
end
|
@@ -2,24 +2,16 @@ class Proc
|
|
2
2
|
|
3
3
|
# create a raw eval-able process source, so you can set
|
4
4
|
# the right bindings using the .to_proc call from String methods
|
5
|
-
|
6
|
-
|
7
|
-
end
|
8
|
-
Proc.source_cache= Hash.new
|
9
|
-
def source(test=nil)
|
5
|
+
def source
|
6
|
+
|
10
7
|
# defaults
|
11
8
|
begin
|
12
9
|
return_string= ProcSource.new
|
13
10
|
block= 0
|
14
11
|
end
|
15
12
|
|
16
|
-
unless
|
17
|
-
|
18
|
-
puts self.object_id
|
19
|
-
end
|
20
|
-
|
21
|
-
unless Proc.source_cache[self.object_id].nil?
|
22
|
-
return Proc.source_cache[self.object_id]
|
13
|
+
unless ProcSource.source_cache[self.source_location].nil?
|
14
|
+
return ProcSource.source_cache[self.source_location]
|
23
15
|
else
|
24
16
|
|
25
17
|
File.open(File.expand_path(self.source_location[0])
|
@@ -36,7 +28,7 @@ class Proc
|
|
36
28
|
return_string.sub!(/^[^{]*(?!={)/,'Proc.new')
|
37
29
|
end
|
38
30
|
|
39
|
-
|
31
|
+
ProcSource.source_cache[self.source_location]= return_string
|
40
32
|
|
41
33
|
return return_string
|
42
34
|
end
|
@@ -1,5 +1,10 @@
|
|
1
1
|
class ProcSource < String
|
2
2
|
|
3
|
+
class << self
|
4
|
+
attr_accessor :source_cache
|
5
|
+
end
|
6
|
+
self.source_cache= Hash.new
|
7
|
+
|
3
8
|
def self.build(source_code_to_be_wrappered,*params_obj_array)
|
4
9
|
self.new(source_code_to_be_wrappered).wrapper_around!(*params_obj_array)
|
5
10
|
end
|
@@ -29,10 +34,10 @@ class ProcSource < String
|
|
29
34
|
return_proc= eval(self,binding)
|
30
35
|
end
|
31
36
|
|
32
|
-
#
|
33
|
-
begin
|
34
|
-
|
35
|
-
end
|
37
|
+
#do cache to proc!
|
38
|
+
#begin
|
39
|
+
# ProcSource.source_cache[return_proc.source_location]= self
|
40
|
+
#end
|
36
41
|
|
37
42
|
return return_proc
|
38
43
|
end
|
@@ -41,11 +46,7 @@ class ProcSource < String
|
|
41
46
|
def body
|
42
47
|
|
43
48
|
body= ProcSourceBody.new(self.dup.to_s)
|
44
|
-
|
45
|
-
body.gsub!("{","{\n")
|
46
|
-
body.gsub!("}","\n}")
|
47
|
-
|
48
|
-
body.sub!(/^\s*Proc\.new\s*{ *[\S ]*/,String.new)
|
49
|
+
body.sub!(/.*Proc\.new *{ *(\|.*\|)?/,String.new)
|
49
50
|
body.gsub!(/^$\n/, String.new)
|
50
51
|
body.sub!(/\s*}\s*$/,String.new)
|
51
52
|
|