procemon 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTVkYTA0MWEwOGQ0YjdhMzU2NjU1OWMzZjUyODdiOTU2MjMxYmFkOA==
4
+ ZmEwMDA2YjA1YTJhNmY0MDdlYjI0ZWIzOGU1MDJkMjMwZjE5ODdlZQ==
5
5
  data.tar.gz: !binary |-
6
- YzBiNjU4NWY0NjljNGFlM2Y0YmQ1MWZjMGE3NzBhNzFhMDI1NGNhMg==
6
+ YTBmMDQxYjkwMzMzNTAyYTdmYjM0N2FhYTBjZmZiYTI3OWU4MTlhZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Y2YxYTMyN2FjYjMxYzRjZGRiNTc2ZGYwNmEyNmVjY2JhZmM5ZDBlOGM2NDg4
10
- NDcwMzRhOGNjNDExN2UxYTkyNTA0M2I4YjM2ZDQxNjcyZTcyMDM5NzgxODk5
11
- NjAwZTVjZTU5OTJjY2IzMDdkNTQwOTQ0ZWIzM2Y4ZmI0YTgyZmU=
9
+ ZDI4NWI0ZDVkNjhmMjQyODJiNTc1MTJhNjViZGY2OGFlNDQzN2Y3NTcyNDVi
10
+ OWE2OGIyNDFhNTJmNjYxNjhjM2M3MjUyY2JjZTBkODQ3YzkxYWNiMDk0Y2Q3
11
+ NjU2ZTNhNjM0MjZmZjQxOGMxN2E3YjA1NWRhMzIzOTkzN2VhZDQ=
12
12
  data.tar.gz: !binary |-
13
- YjZiZDlhM2Q2ZmQzNjQ2ZjA3NmJkOGNjMGMyYTViZWIzNjYxNjFjMzQ5YThh
14
- YzY4Mzc4NTQ4N2RhMTVmN2E3ZGMxOTYyMzQ4NjgyYzc2MmVhZDkxZWYyNDE1
15
- ZDg2OTlhYTU0NmNmMWEyMjQ4MmVkNzdiMzRkODE4MzE1MjFjNGM=
13
+ NTY1MTMxYWRkYzE1OGZhNzQ5ZDMwMTVjZDI0YmVjODc0NTRhNDlmODRhNWRj
14
+ ZTdjNGUyOGIwZGY0MTMyYmM3NGJkZjc5ZGE3YzA5MDJiMWFkY2UxMjFiY2Jj
15
+ Y2IwMGU0NmEwMjIwNmM2MGI3MjJkMjllMzMyYjZiYzdkYzM0OGQ=
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.3
1
+ 0.4.4
@@ -9,8 +9,9 @@ module MethodToProcSource
9
9
  return_string= ProcSource.new
10
10
  block= 0
11
11
  end
12
- unless Proc.source_cache[self.object_id].nil?
13
- return Proc.source_cache[self.object_id]
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
- Proc.source_cache[self.object_id]= return_string
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
- class << self
6
- attr_accessor :source_cache
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 test.nil?
17
- puts Proc.source_cache.inspect
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
- Proc.source_cache[self.object_id]= return_string
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
- # do cache to proc!
33
- begin
34
- Proc.source_cache[return_proc.object_id]= self
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: procemon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Luzsi