explore_rb 0.0.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +27 -0
- data/lib/explore_rb/version.rb +1 -1
- data/lib/explore_rb.rb +10 -9
- 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: 90cd8245889b92d657f766767017f992d81141af
|
4
|
+
data.tar.gz: 2f5ff08ba0d7981d6249d5db93b695759be85f35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f3e6ad9a15891b766ce2e4e809e39e0383a7c0fb059cc7326a356c72204642dd717ab9fdb4d0a3df9f0c86df6b83d796902704c8daeaea79ecf1e7c02c89df8
|
7
|
+
data.tar.gz: 75121b4ed58be433ef85efd582064b737cf76766e91d360baa049f4cf5d10d5a43eb6b9094503165be6107b53ae65e1f411e445f2775c710f95f0c2d897670df
|
data/README.md
CHANGED
@@ -72,6 +72,33 @@ The greeting message displayed when this library is required mentions
|
|
72
72
|
this library but it was worth pointing out since fits in with what this library
|
73
73
|
is trying to accomplish.
|
74
74
|
|
75
|
+
### Garbage Collection
|
76
|
+
|
77
|
+
There are also methods "start_garbage_collection" and "stop_garbage_collection"
|
78
|
+
to allow people to experiment with the Ruby garbage collector:
|
79
|
+
|
80
|
+
$ class Person; end
|
81
|
+
$=> nil
|
82
|
+
$ bob = Person.new
|
83
|
+
$=> #<Person:0x007fc63e503b90>
|
84
|
+
$ Person.new
|
85
|
+
$=> #<Person:0x007fc63e507920>
|
86
|
+
$ Person.new
|
87
|
+
$=> #<Person:0x007fc63e5041a8>
|
88
|
+
$ get_objects Person
|
89
|
+
$=> [#<Person:0x007fc63e503b90>, #<Person:0x007fc63e5041a8>, #<Person:0x007fc63e507920>]
|
90
|
+
$ start_garbage_collection
|
91
|
+
$=> nil
|
92
|
+
$ get_objects Person
|
93
|
+
$=> [#<Person:0x007fc63e503b90>]
|
94
|
+
$ bob = nil
|
95
|
+
$=> nil
|
96
|
+
$ get_objects Person
|
97
|
+
$=> []
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
75
102
|
## Contributing
|
76
103
|
|
77
104
|
1. Fork it
|
data/lib/explore_rb/version.rb
CHANGED
data/lib/explore_rb.rb
CHANGED
@@ -3,11 +3,11 @@ require "explore_rb/version"
|
|
3
3
|
|
4
4
|
module ExploreRb
|
5
5
|
|
6
|
-
include GC
|
7
|
-
|
8
6
|
def self.extended base
|
9
7
|
puts "Use the following commands to look around:"
|
10
|
-
puts "classes, objects, get_objects, symbols,
|
8
|
+
puts " classes, objects, get_objects, symbols, gems,"
|
9
|
+
puts " local_variables, draw_this, start_garbage_collection"
|
10
|
+
puts " stop_garbage_collection, help"
|
11
11
|
end
|
12
12
|
|
13
13
|
def classes
|
@@ -42,14 +42,15 @@ module ExploreRb
|
|
42
42
|
puts "File saved in #{path}."
|
43
43
|
end
|
44
44
|
|
45
|
-
def
|
46
|
-
|
47
|
-
|
48
|
-
GC.
|
49
|
-
#puts "Dumped #{GC.stat[:total_freed_object]} objects from memory"
|
50
|
-
GC.stat
|
45
|
+
def start_garbage_collection
|
46
|
+
ENV['RUBY_GC_MALLOC_LIMIT']='0'
|
47
|
+
GC.stress=true
|
48
|
+
GC.start
|
51
49
|
end
|
52
50
|
|
51
|
+
def stop_garbage_collection
|
52
|
+
GC.stress=false
|
53
|
+
end
|
53
54
|
|
54
55
|
end
|
55
56
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: explore_rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Williamson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: traceur
|